db099d66660fb593f4da8014e57ba63a722638a3
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2004-10-09  Darin Adler  <darin@apple.com>
2
3         Reviewed by Kevin.
4
5         - fixed <rdar://problem/3822618> REGRESSION (164-165): expedia.com's popup help doesn't work
6
7         * kjs/reference.cpp: (Reference::putValue): Change so that references not found in any object
8         work with the window object of the page the function is in, not the page of the caller. This
9         is what all other browsers do. This code was hidden before by the "everything is defined on
10         window object" hack in WebCore.
11
12 2004-10-07  Richard Williamson   <rjw@apple.com>
13
14         Added simple JavaScript call tracing.  Very useful for
15         debugging complex pages.
16
17         Tracing is only available in development builds and is
18         enabled by:
19
20         (gdb) set traceJavaScript = 1
21
22         or programatically
23
24         setTraceJavaScript(true)
25
26         Function, args, and return values are printed to console.  Very
27         verbose.
28
29         Reviewed by Ken.
30
31         * kjs/function_object.cpp:
32         (FunctionProtoFuncImp::call):
33         * kjs/object.cpp:
34         (KJS::Object::call):
35
36 === Safari-166 ===
37
38 2004-10-05  Richard Williamson   <rjw@apple.com>
39
40         Fixed <rdar://problem/3819234> NPN_SetException (and throwException:) isn't implemented
41
42         Reviewed by Chris.
43
44         * bindings/NP_jsobject.cpp:
45         (_NPN_SetException):
46         * bindings/npruntime.cpp:
47         (_NPN_SetExceptionWithUTF8):
48         * bindings/objc/WebScriptObject.mm:
49         (+[WebScriptObject throwException:]):
50         * kjs/internal.h:
51         (KJS::InterpreterImp::context):
52
53 2004-10-05  Richard Williamson   <rjw@apple.com>
54
55         Fixed <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number
56
57         Reviewed by Ken.
58
59         * bindings/objc/objc_utility.mm:
60         (KJS::Bindings::convertObjcValueToValue):
61
62 2004-10-04  Darin Adler  <darin@apple.com>
63
64         Reviewed by Ken.
65
66         - rolled in a fix the KDE folks did for the operations that generate HTML fragments
67
68         * kjs/string_object.cpp: (StringProtoFuncImp::call): Added quote marks to generated HTML.
69
70         - rolled out an old workaround we don't need any more
71
72         * JavaScriptCore.pbproj/project.pbxproj: Remove -Wno-long-double because the <math.h> issue that
73         required it is no longer there.
74
75 2004-09-30  Richard Williamson  <rjw@apple.com>
76
77         Fixed <rdar://problem/3821215> NPN hasMethod and hasProperty functions should take NPObjects, not NPClass
78
79         Reviewed by Chris.
80
81         * bindings/NP_jsobject.cpp:
82         (_NPN_GetProperty):
83         (_NPN_HasProperty):
84         (_NPN_HasMethod):
85         * bindings/c/c_class.cpp:
86         (CClass::methodsNamed):
87         (CClass::fieldNamed):
88         * bindings/c/c_class.h:
89         * bindings/c/c_instance.cpp:
90         (CInstance::invokeMethod):
91         * bindings/jni/jni_class.cpp:
92         (JavaClass::methodsNamed):
93         * bindings/jni/jni_class.h:
94         * bindings/npruntime.h:
95         * bindings/objc/objc_class.h:
96         * bindings/objc/objc_class.mm:
97         (ObjcClass::methodsNamed):
98         * bindings/runtime.h:
99         * bindings/runtime_object.cpp:
100         (RuntimeObjectImp::get):
101         (RuntimeObjectImp::hasProperty):
102
103 2004-09-29  Chris Blumenberg  <cblu@apple.com>
104
105         Prepended underscores to NPN methods so that when the QT plug-in loads these symbols, it uses the non-underscore versions in WebKit. Without this, the QT plug-in was failing to load when launching Safari from the command-line.
106
107         Reviewed by rjw.
108
109         * JavaScriptCore.pbproj/project.pbxproj:
110         * bindings/NP_jsobject.cpp:
111         (_NPN_CreateScriptObject):
112         (_NPN_InvokeDefault):
113         (_NPN_Invoke):
114         (_NPN_Evaluate):
115         (_NPN_GetProperty):
116         (_NPN_SetProperty):
117         (_NPN_RemoveProperty):
118         (_NPN_HasProperty):
119         (_NPN_HasMethod):
120         * bindings/c/c_class.cpp:
121         (CClass::methodsNamed):
122         (CClass::fieldNamed):
123         * bindings/c/c_instance.cpp:
124         (CInstance::CInstance):
125         (CInstance::~CInstance):
126         (CInstance::operator=):
127         (CInstance::invokeMethod):
128         (CInstance::invokeDefaultMethod):
129         * bindings/c/c_runtime.cpp:
130         * bindings/c/c_runtime.h:
131         (KJS::Bindings::CField::name):
132         (KJS::Bindings::CMethod::name):
133         * bindings/npruntime.cpp:
134         (_NPN_GetStringIdentifier):
135         (_NPN_GetStringIdentifiers):
136         (_NPN_GetIntIdentifier):
137         (_NPN_IdentifierIsString):
138         (_NPN_UTF8FromIdentifier):
139         (_NPN_IntFromIdentifier):
140         (NPN_InitializeVariantWithObject):
141         (_NPN_ReleaseVariantValue):
142         (_NPN_CreateObject):
143         (_NPN_RetainObject):
144         (_NPN_ReleaseObject):
145         (_NPN_SetExceptionWithUTF8):
146         (_NPN_SetException):
147
148 2004-09-26  Darin Adler  <darin@apple.com>
149
150         * kjs/string_object.cpp: (StringProtoFuncImp::call): Remove strange use of high() and
151         low() to get Unicode value of character, and just use unicode().
152
153 2004-09-26  Darin Adler  <darin@apple.com>
154
155         - refine charAt/charCodeAt fix slightly
156
157         * kjs/string_object.cpp: (StringProtoFuncImp::call): Treat undefined the same was as an
158         omitted parameter, as we do everywhere else, and as other browsers do here.
159
160 2004-09-26  Darin Adler  <darin@apple.com>
161
162         Reviewed by Kevin.
163
164         - fixed <rdar://problem/3816097> REGRESSION: mailblocks, and presumably many other pages, failing because variable not found
165
166         * kjs/internal.cpp: (InterpreterImp::evaluate): Process variable declarations before executing
167         the program. We were doing this properly for functions, but not entire programs.
168
169         - fixed <rdar://problem/3814706> REGRESSION: text fields in mailblocks wizards do not accept keystrokes due to use of charCodeAt()
170
171         * kjs/string_object.cpp: (StringProtoFuncImp::call): Changed the implementation of charAt
172         and charCodeAt to treat a missing parameter as an index of 0, rather than an invalid index.
173
174         * tests/mozilla/expected.html: Update for two tests that now pass with these changes.
175
176 === Safari-165 ===
177
178 === Safari-164 ===
179
180 2004-09-14  Richard Williamson   <rjw@apple.com>
181
182         1.  Add class parameter to object allocation function.  This is somewhat redundant, given that
183         the allocation function is in the class function vector, but people wanted to use the same
184         allocation function for different classes.
185         
186         2.  Renamed NPN_Class to NPN_Invoke to match the name in the function vector.
187         
188         3.  Add support for a default function on an object.  This is a feature that ActiveX supports,
189         and will allow JavaScript code to be written that will look exactly the same for both ActiveX
190         plugins and Netscape or WebKit plugins.  There are implementations included for the 'C' and
191         'Objective-C' bindings.
192         
193         There bugs are covered by
194         
195         <rdar://problem/3776343> Support for default functions in the JavaScript bindings
196         <rdar://problem/3779186> NPN_Call needs to be renamed to NPN_Invoke
197         <rdar://problem/3674754> Need to implement latest npruntime.h
198
199         Reviewed by John.
200
201         * bindings/NP_jsobject.cpp:
202         (jsAllocate):
203         (NPN_InvokeDefault):
204         (NPN_Invoke):
205         * bindings/c/c_class.cpp:
206         * bindings/c/c_instance.cpp:
207         (CInstance::CInstance):
208         (CInstance::operator=):
209         (CInstance::invokeMethod):
210         (CInstance::invokeDefaultMethod):
211         * bindings/c/c_instance.h:
212         * bindings/c/c_runtime.cpp:
213         * bindings/c/c_runtime.h:
214         * bindings/jni/jni_instance.cpp:
215         (JavaInstance::invokeDefaultMethod):
216         * bindings/jni/jni_instance.h:
217         * bindings/npruntime.cpp:
218         (NPN_CreateObject):
219         * bindings/npruntime.h:
220         * bindings/objc/WebScriptObject.h:
221         * bindings/objc/objc_class.mm:
222         (ObjcClass::fallbackObject):
223         * bindings/objc/objc_instance.h:
224         * bindings/objc/objc_instance.mm:
225         (ObjcInstance::invokeDefaultMethod):
226         * bindings/objc/objc_runtime.h:
227         * bindings/objc/objc_runtime.mm:
228         (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
229         (ObjcFallbackObjectImp::get):
230         (ObjcFallbackObjectImp::put):
231         (ObjcFallbackObjectImp::canPut):
232         (ObjcFallbackObjectImp::implementsCall):
233         (ObjcFallbackObjectImp::call):
234         (ObjcFallbackObjectImp::hasProperty):
235         (ObjcFallbackObjectImp::deleteProperty):
236         (ObjcFallbackObjectImp::defaultValue):
237         * bindings/runtime.h:
238         (KJS::Bindings::Class::fallbackObject):
239         (KJS::Bindings::Instance::getValueOfUndefinedField):
240         (KJS::Bindings::Instance::setValueOfUndefinedField):
241         (KJS::Bindings::Instance::valueOf):
242         * bindings/runtime_object.cpp:
243         (RuntimeObjectImp::implementsCall):
244         (RuntimeObjectImp::call):
245         * bindings/runtime_object.h:
246
247 2004-09-13  Maciej Stachowiak  <mjs@apple.com>
248
249         Reviewed by Darin.
250
251         <rdar://problem/3794735> Gmail- sending a very long message with Safari is so slow it seems like a hang
252         
253         * kjs/string_object.cpp:
254         (StringProtoFuncImp::call): Replaced implementation of replace()
255         method with function below...
256         (replace): In order to avoid excessive allocation and copying,
257         figure out the ranges of the original string and replacement
258         strings to be assembled, instead of constantly creating new
259         strings at each substitution. The old behavior is basically O(N^2)
260         for a global replace on a pattern that matches many places in the
261         string.
262         (regExpIsGlobal): Helper function for the above.
263         (expandSourceRanges): ditto
264         (pushSourceRange): ditto
265         (expandReplacements): ditto
266         (pushReplacement): ditto
267         * kjs/ustring.cpp:
268         (KJS::UString::spliceSubstringsWithSeparators): New method that
269         pieces together substring ranges of this string together with
270         specified separators, all at one go.
271         * kjs/ustring.h:
272         (KJS::UString::Range::Range): Added new helper class to represent
273         substring choices.
274
275 2004-09-14  Maciej Stachowiak  <mjs@apple.com>
276
277         Reviewed by Darin.
278
279         - fixed <rdar://problem/3800315> encode-URI-test layout test is failing
280         
281         * kjs/function.cpp:
282         (KJS::GlobalFuncImp::call): Make sure to escape null
283         characters. This is a bug in the new code that made part of the
284         test fail.
285
286 2004-09-13  Darin Adler  <darin@apple.com>
287
288         Reviewed by Kevin and Maciej.
289
290         - new function to support fix for DIG bug in WebCore
291
292         * kjs/scope_chain.h: Added new push function that pushes another entire scope chain.
293         * kjs/scope_chain.cpp: (KJS::ScopeChain::push): Ditto.
294
295 2004-09-12  Darin Adler  <darin@apple.com>
296
297         * tests/mozilla/expected.html: Updated test results for 3 more tests that pass with the new version
298         of escape and unescape.
299
300 2004-09-12  Darin Adler  <darin@apple.com>
301
302         Reviewed by Maciej.
303
304         - fixed <rdar://problem/3798209> any non-ASCII characters are garbled in the result of toLocaleString
305
306         * kjs/date_object.cpp:
307         (formatLocaleDate): Replaced two old functions that used LongDateTime with this one new function that
308         uses CFDateFormatter.
309         (DateProtoFuncImp::call): Call the new formatLocaleDate instead of both formatLocaleDate and formatLocaleTime.
310
311 2004-09-09  Maciej Stachowiak  <mjs@apple.com>
312
313         Reviewed by Richard.
314
315         <rdar://problem/3493140> REGRESSION (85-100): cedille displays %-escaped in JavaScript message at hotmail.com
316
317         * kjs/function.cpp:
318         (KJS::GlobalFuncImp::call): Replace our escape() and unescape() implementations with
319         ones from KDE KJS, which have the proper latin-1 behavior to match Win IE.
320         * kjs/lexer.cpp:
321         (Lexer::isHexDigit): Made static and non-const.
322         * kjs/lexer.h:
323
324 === Safari-163 ===
325
326 2004-09-06  Darin Adler  <darin@apple.com>
327
328         * JavaScriptCore.pbproj/project.pbxproj: Bump MACOSX_DEPLOYMENT_TARGET to 10.3.
329
330 === Safari-162 ===
331
332 2004-09-01  Richard Williamson   <rjw@apple.com>
333
334         Add pid to exception messages (to help debug dashboard clients).
335
336         Reviewed by Chris.
337
338         * kjs/interpreter.cpp:
339         (Interpreter::evaluate):
340
341 === Safari-161 ===
342
343 2004-08-20  Richard Williamson   <rjw@apple.com>
344
345         Implemented new JNI abstraction.  We no longer invoke Java methods
346         directly with JNI, rather we call into the plugin.  This allows the
347         plugin to dispatch the call to the appropriate VM thread.  This
348         change should (will?) fix a whole class of threading related problems with
349         the Java VM.
350
351         Reviewed by Hyatt.
352
353         * JavaScriptCore.pbproj/project.pbxproj:
354         * bindings/c/c_instance.h:
355         (KJS::Bindings::CInstance::setExecutionContext):
356         (KJS::Bindings::CInstance::executionContext):
357         * bindings/jni/jni_instance.cpp:
358         (JavaInstance::JavaInstance):
359         (JavaInstance::invokeMethod):
360         (JavaInstance::setExecutionContext):
361         (JavaInstance::executionContext):
362         * bindings/jni/jni_instance.h:
363         * bindings/jni/jni_jsobject.cpp:
364         (JSObject::convertJObjectToValue):
365         * bindings/jni/jni_runtime.cpp:
366         (JavaField::JavaField):
367         (JavaArray::convertJObjectToArray):
368         (JavaField::valueFromInstance):
369         (JavaArray::JavaArray):
370         (JavaArray::valueAt):
371         * bindings/jni/jni_runtime.h:
372         (KJS::Bindings::JavaArray::operator=):
373         (KJS::Bindings::JavaArray::executionContext):
374         * bindings/jni/jni_utility.h:
375         * bindings/objc/objc_instance.h:
376         (KJS::Bindings::ObjcInstance::setExecutionContext):
377         (KJS::Bindings::ObjcInstance::executionContext):
378         * bindings/runtime.cpp:
379         (Instance::createBindingForLanguageInstance):
380         * bindings/runtime.h:
381         * bindings/runtime_root.h:
382         (KJS::Bindings::RootObject::nativeHandle):
383
384 === Safari-158 ===
385
386 2004-08-19  Vicki Murley  <vicki@apple.com>
387
388         Reviewed by John.
389
390         * kjs/property_map.cpp:
391         (KJS::PropertyMap::put): initialize deletedElementIndex to zero, to make the compiler happy
392
393 2004-08-17  Darin Adler  <darin@apple.com>
394
395         Reviewed by Adele.
396
397         - fixed <rdar://problem/3746676> SAP WebDynpro app hangs inside JavaScript property map hash table code (deleted sentinel problem)
398
399         * kjs/property_map.h: Added some private functions.
400         * kjs/property_map.cpp:
401         (KJS::PropertyMap::clear): Set sentinelCount to 0.
402         (KJS::PropertyMap::put): Complete search for the element before choosing to use the deleted-element sentinel.
403         Also keep sentinel count up to date when we destroy a sentinel by overwriting with a new added element.
404         (KJS::PropertyMap::expand): Added. Calls rehash with a size 2x the old size, or 16.
405         (KJS::PropertyMap::rehash): Added. Refactored the rehash code into a separate function.
406         (KJS::PropertyMap::remove): Add one to sentinelCount, and rehash if 1/4 or more of the elements are
407         deleted-element sentinels.
408         (KJS::PropertyMap::checkConsistency): Check the sentinelCount.
409
410 2004-08-16  Maciej Stachowiak  <mjs@apple.com>
411
412         Code change by Eric Albert, reviewd by me.
413
414         <rdar://problem/3571960> washingtonpost.com claims I don't have cookies enabled and won't let me read articles
415
416         * kjs/date_object.cpp:
417         (timetUsingCF): Clamp time to LONG_MAX (getting rid of time_t
418         entirely would be even better, but is not required to fix this bug.
419
420 === Safari-157 ===
421
422 2004-08-16  Richard Williamson   <rjw@apple.com>
423
424         Fixed <rdar://problem/3581092> cash in KJS::Bindings::JSObject::eval at tcvetantcvetkov.com
425
426         Adds bullet proofing to protect against evaluation of bogus JS in all the flavors of bindings (Java, C, and ObjC).
427
428         Reviewed by Chris.
429
430         * bindings/NP_jsobject.cpp:
431         (NPN_Evaluate):
432         * bindings/jni/jni_jsobject.cpp:
433         (JSObject::eval):
434         * bindings/objc/WebScriptObject.mm:
435         (-[WebScriptObject evaluateWebScript:]):
436
437 2004-08-15  Richard Williamson   <rjw@apple.com>
438
439         More updates to np headers.  Implemented new NPN functions.
440
441         Reviewed by Darin.
442
443         * bindings/NP_jsobject.cpp:
444         (NPN_HasProperty):
445         (NPN_HasMethod):
446         * bindings/npapi.h:
447         * bindings/npruntime.h:
448
449 2004-08-13  Darin Adler  <darin@apple.com>
450
451         - fix build so we can compile again
452
453         * bindings/npapi.h: Added. Richard forgot to check this in. The one I'm checking in here
454         is good enough so that we can compile, but it's only a stopgap measure, because I think
455         Richard has a newer one he wants to check in.
456
457 2004-08-12  Richard Williamson   <rjw@apple.com>
458
459         Bring npruntime.h and friends closer to compliance with
460         latest spec.
461
462         Reviewed by Maciej.
463
464         * JavaScriptCore.pbproj/project.pbxproj:
465         * bindings/NP_jsobject.cpp:
466         (jsAllocate):
467         (_NPN_CreateScriptObject):
468         (NPN_Call):
469         (NPN_Evaluate):
470         (NPN_GetProperty):
471         (NPN_SetProperty):
472         (NPN_RemoveProperty):
473         * bindings/NP_jsobject.h:
474         * bindings/c/c_instance.cpp:
475         (CInstance::invokeMethod):
476         * bindings/c/c_utility.cpp:
477         (convertNPVariantToValue):
478         * bindings/npruntime.cpp:
479         (NPN_IdentifierIsString):
480         (NPN_VariantIsVoid):
481         (NPN_VariantIsNull):
482         (NPN_VariantIsUndefined):
483         (NPN_VariantIsBool):
484         (NPN_VariantIsInt32):
485         (NPN_VariantIsDouble):
486         (NPN_VariantIsString):
487         (NPN_VariantIsObject):
488         (NPN_VariantToBool):
489         (NPN_VariantToString):
490         (NPN_VariantToInt32):
491         (NPN_VariantToDouble):
492         (NPN_VariantToObject):
493         (NPN_InitializeVariantAsVoid):
494         (NPN_InitializeVariantAsNull):
495         (NPN_InitializeVariantAsUndefined):
496         (NPN_InitializeVariantWithBool):
497         (NPN_InitializeVariantWithInt32):
498         (NPN_InitializeVariantWithDouble):
499         (NPN_InitializeVariantWithString):
500         (NPN_InitializeVariantWithStringCopy):
501         (NPN_InitializeVariantWithObject):
502         (NPN_InitializeVariantWithVariant):
503         (NPN_ReleaseVariantValue):
504         (NPN_CreateObject):
505         * bindings/npruntime.h:
506         (_NPString::):
507         (_NPString::_NPVariant::):
508         * bindings/npruntime_priv.h: Added.
509
510 2004-08-12  Darin Adler  <darin@apple.com>
511
512         Reviewed by Adele.
513
514         - fixed 3 problems with parse functions that I just wrote, fixing 3 more Mozilla JavaScript tests
515
516         * kjs/function.cpp:
517         (KJS::parseDigit): Fix typo, 'Z' instead of 'z', that prevented lowercase hex digits from working.
518         (KJS::parseInt): Add octal support. Specification says it's optional, but I guess not.
519         (KJS::parseFloat): Fix check for "0x" in parseFloat to return 0 rather than NaN. Also add code
520         to skip leading "+" or "-".
521
522 === Safari-156 ===
523
524 2004-08-12  Darin Adler  <darin@apple.com>
525
526         Reviewed by Ken.
527
528         - fixed 43 Mozilla JavaScript tests
529
530         * kjs/date_object.h: Change parseDate and timeClip to take and return doubles.
531         * kjs/date_object.cpp:
532         (DateObjectImp::construct): Change to use a timeClip function that takes and returns a double rather
533         than constructing a number object to pass to it.
534         (DateObjectFuncImp::call): Change to use a parseDate function that returns a double.
535         (KJS::parseDate): Change to return a double instead of creating the Number object here.
536         (KJS::timeClip): Implement this as specified in the language standard.
537
538         * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set the DontDelete, ReadOnly, and DontEnum
539         flags on the prototype property.
540
541         * kjs/function.cpp:
542         (KJS::FunctionImp::get): Return null rather than undefined for arguments when the function is not
543         currently in scope.
544         (KJS::isStrWhiteSpace): Added. Matches specification for StrWhiteSpace. Could move it to some utility
545         file later.
546         (KJS::parseDigit): Added. Helper function for parseInt.
547         (KJS::parseInt): Added. Integer parser that puts result in a double so we're not limited to what
548         strtoll can handle. Also matches standard more closely.
549         (KJS::parseFloat): Added. Handles "0x" properly and passes flag to make empty string turn into NaN
550         instead of 0.
551         (KJS::GlobalFuncImp::call): Use the new parseInt and parseFloat.
552
553         * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Add a length property.
554
555         * kjs/lexer.h: Added error flag and sawError() function for detecting errors.
556         * kjs/lexer.cpp:
557         (Lexer::setCode): Clear error state.
558         (Lexer::lex): Set error state if the lexer encounters an error
559
560         * kjs/internal.cpp:
561         (NumberImp::toString): Roll in change from KDE version to special case 0 so we handle -0 correctly.
562         (Parser::parse): Use new lexer error method so those errors are treated like parser errors.
563
564         * kjs/math_object.cpp: (MathFuncImp::call): Change min and max to treat -0 as less than +0.
565         Change round to round values between -0.5 and -0 to -0 instead of +0.
566
567         * kjs/nodes.h: Add evaluateReference function to GroupNode.
568         * kjs/nodes.cpp: (GroupNode::evaluateReference): Pass references through groups (parenthesized
569         expressions) properly so that expressions like "delete (x.y)" work. Before, the parentheses
570         would change x.y into a value that can't be deleted as a side effect.
571
572         * kjs/string_object.cpp: Change parameter count for indexOf and lastIndexOf from 2 to 1 to match
573         the specification.
574
575         * kjs/testkjs.cpp: Rolled in changes from KDE to add a "quit" function to the test tool and
576         get rid of the fixed size limit for code.
577
578         * kjs/ustring.cpp: (KJS::UString::substr): Added optimized case for substr(0, length) so it just
579         returns the string without creating a new Rep, since I'm using substr in a place where it will
580         often be passed a 0.
581
582         * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed one wrong entry in the Unicode table I added to
583         the other day that was making a couple tests fail.
584         * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
585         * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
586         * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
587         * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
588         * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
589
590         * kjs/string_object.lut.h: Regenerated.
591
592 2004-08-11  Darin Adler  <darin@apple.com>
593
594         - fixed a tiny problem with the UTF-16 PCRE check-in
595
596         * pcre/maketables.c: (pcre_maketables): Fix mistake in table-generating code that sometimes caused
597         the ctype_meta flag to get set in items that should not have it.
598
599         * pcre/chartables.c: Regenerated.
600
601 2004-08-10  Richard Williamson   <rjw@apple.com>
602
603         Fixed <rdar://problem/3674747> Need to implement invokeUndefinedMethodFromWebScript:withArguments:
604
605         The following WebScripting methods are now supported on bound
606         objects:
607
608         - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args;
609         - (void)setValue:(id)value forUndefinedKey:(NSString *)key
610         - (id)valueForUndefinedKey:(NSString *)key
611
612         Reviewed by Chris.
613
614         * bindings/c/c_class.cpp:
615         (CClass::fieldNamed):
616         * bindings/c/c_class.h:
617         * bindings/jni/jni_class.cpp:
618         (JavaClass::fieldNamed):
619         * bindings/jni/jni_class.h:
620         * bindings/objc/objc_class.h:
621         (KJS::Bindings::ObjcClass::isa):
622         * bindings/objc/objc_class.mm:
623         (ObjcClass::methodsNamed):
624         (ObjcClass::fieldNamed):
625         (ObjcClass::fallbackObject):
626         * bindings/objc/objc_instance.h:
627         * bindings/objc/objc_instance.mm:
628         (ObjcInstance::invokeMethod):
629         (ObjcInstance::setValueOfField):
630         (ObjcInstance::setValueOfUndefinedField):
631         (ObjcInstance::getValueOfField):
632         (ObjcInstance::getValueOfUndefinedField):
633         * bindings/objc/objc_runtime.h:
634         (KJS::Bindings::ObjcField::~ObjcField):
635         (KJS::Bindings::ObjcField::ObjcField):
636         (KJS::Bindings::ObjcField::operator=):
637         (KJS::Bindings::FallbackObjectImp::classInfo):
638         * bindings/objc/objc_runtime.mm:
639         (ObjcField::ObjcField):
640         (ObjcField::name):
641         (ObjcField::type):
642         (ObjcField::valueFromInstance):
643         (ObjcField::setValueToInstance):
644         (FallbackObjectImp::FallbackObjectImp):
645         (FallbackObjectImp::get):
646         (FallbackObjectImp::put):
647         (FallbackObjectImp::canPut):
648         (FallbackObjectImp::implementsCall):
649         (FallbackObjectImp::call):
650         (FallbackObjectImp::hasProperty):
651         (FallbackObjectImp::deleteProperty):
652         (FallbackObjectImp::defaultValue):
653         * bindings/runtime.h:
654         (KJS::Bindings::Class::fallbackObject):
655         (KJS::Bindings::Instance::getValueOfUndefinedField):
656         (KJS::Bindings::Instance::setValueOfUndefinedField):
657         * bindings/runtime_object.cpp:
658         (RuntimeObjectImp::get):
659         (RuntimeObjectImp::put):
660         (RuntimeObjectImp::canPut):
661         (RuntimeObjectImp::hasProperty):
662         * bindings/testbindings.mm:
663         (-[MyFirstInterface valueForUndefinedKey:]):
664         (-[MyFirstInterface setValue:forUndefinedKey:]):
665
666 2004-08-10  Darin Adler  <darin@apple.com>
667
668         Reviewed by Dave.
669
670         - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
671
672         * pcre/pcre.h: Added PCRE_UTF16 switch, set to 1. Added pcre_char typedef, which is char
673         or uint16_t depending on the mode, and used appropriate in the 7 public functions
674         that need to use it.
675         * pcre/pcre.c: Add UTF-16 support to all functions.
676         * pcre/study.c: Ditto.
677
678         * pcre/internal.h: Added ichar typedef, which is unsigned char or uint16_t depending on
679         the mode. Changed declarations to use symbolic constants and typedefs so we size
680         things to ichar when needed.
681
682         * pcre/maketables.c: (pcre_maketables): Change code to make tables that are
683         sized to 16-bit characters instead of 8-bit.
684
685         * pcre/get.c:
686         (pcre_copy_substring): Use pcre_char instead of char.
687         (pcre_get_substring_list): Ditto.
688         (pcre_free_substring_list): Ditto.
689         (pcre_get_substring): Ditto.
690         (pcre_free_substring): Ditto.
691
692         * pcre/dftables.c: (main): Used a bit more const, and use ICHAR sizes instead
693         of hard-coding 8-bit table sizes.
694
695         * pcre/chartables.c: Regenerated.
696
697         * kjs/ustring.h: Remove functions that convert UTF-16 to/from UTF-8 offsets.
698         * kjs/ustring.cpp: Change the shared empty string to have a unicode pointer that
699         is not null. The null string still has a null pointer. This prevents us from
700         passing a null through to the regular expression engine (which results in a null
701         error even when the string length is 0).
702
703         * kjs/regexp.cpp:
704         (KJS::RegExp::RegExp): Null-terminate the pattern and pass it.
705         (KJS::RegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
706
707 2004-08-09  Darin Adler  <darin@apple.com>
708
709         Reviewed by Maciej.
710
711         - fixed 28 Mozilla JavaScript tests
712
713         * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Check for undefined rather than
714         checking the number of arguments for the join method.
715
716         * kjs/lexer.cpp: (Lexer::lex): Parse hexadecimal and octal constants in doubles rather
717         than integers, so we aren't limited to 32 bits.
718
719         * kjs/math_object.cpp: (MathFuncImp::call): Get rid of many unneeded special cases in
720         the implementation of the pow operation. Also simplied a case that was handling positive
721         and negative infinity separately.
722
723         * kjs/nodes.cpp: (ShiftNode::evaluate): Keep the result of shifts in a double instead of
724         putting them in a long, so that unsigned shift will work properly.
725
726         * kjs/number_object.cpp: Add the DontDelete and ReadOnly flags to the numeric constants.
727
728         * kjs/operations.cpp:
729         (KJS::isPosInf): Added an implementation inside APPLE_CHANGES that does not depend on the
730         sign of isinf; our isinf function returns +1 even for negative infinity.
731         (KJS::isNegInf): And again.
732         (KJS::relation): Put in a nice simple implementation of comparison inside APPLE_CHANGES.
733         Our floating point already handles the various infinity cases correctly.
734
735         * kjs/regexp_object.cpp:
736         (RegExpProtoFuncImp::call): Add missing return before Null() in Exec method.
737         (RegExpObjectImp::arrayOfMatches): Put undefined rather than an empty string into the
738         array in cases where we did not match.
739         (RegExpObjectImp::construct): Set the DontDelete, ReadOnly, and DontEnum flags for
740         "global", "ignoreCase", "multiline", and "source".
741
742         * kjs/string_object.cpp: (StringProtoFuncImp::call): For the match method, turn a null
743         string into undefined rather than an empty string. For the slice method, handle an
744         undefined parameter for the limit properly as decribed in the specification, and add
745         the limit to one case that didn't have the limit at all. For the methods that generate
746         HTML strings, use lowercase tags instead of uppercase.
747
748         * kjs/ustring.cpp:
749         (KJS::UChar::toLower): Use u_tolower from the ICU library.
750         (KJS::UChar::toUpper): Use u_toupper from the ICU library.
751         (KJS::UString::append): Fix some math that caused a buffer overflow.
752         (KJS::convertUTF16OffsetsToUTF8Offsets): Ignore negative numbers (-1 is used as a special
753         flag) rather than converting them all to 0.
754         (KJS::convertUTF8OffsetsToUTF16Offsets): Ditto.
755
756         * tests/mozilla/jsDriver.pl: Fixed the relative links to point to our actual test files.
757
758         * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed the Unicode table in this test to match
759         the Unicode specification in a few cases where it was wrong before.
760         * tests/mozilla/ecma/String/15.5.4.11-2.js: Ditto.
761         * tests/mozilla/ecma/String/15.5.4.11-3.js: Ditto.
762         * tests/mozilla/ecma/String/15.5.4.11-5.js: Ditto.
763         * tests/mozilla/ecma/String/15.5.4.11-6.js: Ditto.
764         * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
765         * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
766         * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
767         * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
768         * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
769
770         * JavaScriptCore.pbproj/project.pbxproj: Link to libicu.
771
772         * kjs/number_object.lut.h: Regenerated.
773
774 2004-08-09  Darin Adler  <darin@apple.com>
775
776         Reviewed by Maciej.
777
778         - fixed <rdar://problem/3753467> REGRESSION (137-138): reproducible buffer overrun in UString manipulation code
779
780         * kjs/ustring.cpp: (KJS::UString::append): Fix incorrect size computation. Without it
781         we get a buffer overflow.
782
783 === Safari-155 ===
784
785 2004-08-05  Richard Williamson   <rjw@apple.com>
786
787         Fixed part of 3674747.  The QT guys need this for feature freeze.
788
789         This patch implements support for the
790
791         - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args
792
793         method of objects bound to JavaScript.
794
795         Reviewed by John.
796
797         * ChangeLog:
798         * bindings/objc/objc_class.mm:
799         (ObjcClass::methodsNamed):
800         (ObjcClass::fieldNamed):
801         * bindings/objc/objc_instance.mm:
802         (ObjcInstance::invokeMethod):
803         * bindings/objc/objc_runtime.h:
804         (KJS::Bindings::ObjcMethod::~ObjcMethod):
805         (KJS::Bindings::ObjcMethod::isFallbackMethod):
806         (KJS::Bindings::ObjcMethod::javaScriptName):
807         * bindings/objc/objc_runtime.mm:
808         (ObjcMethod::ObjcMethod):
809         (ObjcMethod::getMethodSignature):
810         (ObjcMethod::setJavaScriptName):
811         * bindings/testbindings.mm:
812
813 2004-08-04  Vicki Murley  <vicki@apple.com>
814
815         Reviewed by mjs.
816  
817         - fix <rdar://problem/3649789> SAP WebGUI has problems loading first page because of parse error        
818
819         * kjs/lexer.cpp:
820         (Lexer::lex): if the current character is a '\' and the next character is a line terminator,
821         go to the next line and continue parsing the string (instead of failing).  This matches 
822         behavior in Mac IE and Mozilla.
823
824 2004-08-03  Kevin Decker  <kdecker@apple.com>
825
826         Reviewed by Darin.
827
828         Rolled in changes from the latest KJS sources that support additional 
829         Number.prototype functions. 
830
831         Specifically this patch covers the follow parts of the ECMA 3 spec:
832         15.7.4.5, 15.7.4.6, and 15.7.4.7 
833         
834         Fixes:
835         <rdar://problem/3663716> missing Number.toFixed (and toPrecision, toExponential)
836         <rdar://problem/3749492> missing Number.toPrecision prototype implementation
837         <rdar://problem/3749591> missing Number.toExponential prototype implementation
838
839         * kjs/identifier.h: Added toFixed, toPrecision, and toExponential to the
840         list of supported identifiers (a macro).
841         * kjs/number_object.cpp: Implemented support for toFixed(), toPrecision(),
842         and toExponential(). 
843         (NumberPrototypeImp::NumberPrototypeImp):
844         (NumberProtoFuncImp::call):
845         * kjs/number_object.h: Added property names for toFixed, toPrecision,
846         and toExponential. 
847         (KJS::NumberProtoFuncImp::):
848         * tests/mozilla/expected.html: Update results.
849
850 2004-08-03  Darin Adler  <darin@apple.com>
851
852         Reviewed by Ken.
853
854         - added support for copying RegExp objects so 7 more Mozilla regexp tests pass
855
856         * kjs/regexp_object.cpp: (RegExpObjectImp::construct): Check for case where
857         we are supposed to just copy the regular expression object, and do so.
858         Also tighten up arguments check to handle case where an actual "undefined"
859         is passed rather than just omitting an argument.
860
861         * tests/mozilla/expected.html: Update results.
862
863 2004-08-02  Darin Adler  <darin@apple.com>
864
865         * tests/mozilla/.cvsignore: Added.
866         * tests/mozilla/expected.html: Update results.
867
868 2004-08-02  Darin Adler  <darin@apple.com>
869
870         Reviewed by Ken.
871
872         - fixed RegExp.toString so 3 more Mozilla regexp tests pass
873
874         * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call):
875         Append the flags here so more tests paseed.
876
877 2004-08-02  Darin Adler  <darin@apple.com>
878
879         Reviewed by Ken.
880
881         - fixed a couple things making 5 Mozilla regexp tests pass
882
883         * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call): Implement toString
884         for the prototype.
885         (RegExpObjectImp::construct): Fix bug where the string "undefined" would
886         be used as the flags string when no parameter was passed.
887
888         * kjs/regexp_object.h: (KJS::RegExpPrototypeImp::classInfo):
889         Added a class info object for RegExp prototype so it can return
890         a string instead of raising an exception when converting to a string.
891
892         * tests/mozilla/expected.html: Update results.
893
894 2004-08-02  Darin Adler  <darin@apple.com>
895
896         Reviewed by Kevin.
897
898         - fix crashes in mozilla tests due to mishandling NaN
899
900         * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Rerranged range checks after
901         calls to toInteger so that NaN will get turned into something that fits in an integer.
902         These were the ones John already fixed, but his fix used isnan and the new fix is
903         more efficient.
904
905         * kjs/number_object.cpp: (NumberProtoFuncImp::call): Rearranged radix range checks
906         after a call to toInteger to handle NaN properly. Also removed separate check
907         for undefined that's not needed.
908
909         * kjs/string_object.cpp: (StringProtoFuncImp::call): More of the same kinds of changes
910         as in the above two files, but for a lot more functions. Also changed one place with
911         an explicit check for undefined to instead just check isNaN.
912
913         * tests/mozilla/run-mozilla-tests: Changed to invoke jst using $SYMROOTS for people
914         like me who don't keep $SYMROOTS in their $PATH.
915
916 === Safari-154 ===
917
918 === Safari-153 ===
919
920 2004-07-26  Kevin Decker  <kdecker@apple.com>
921
922         Changes done by Darin, reviewed by Kevin.
923
924         - changed testkjs to build in Xcode rather than from Makefile
925
926         * .cvsignore: Removed obsolete files from this list.
927         * Makefile.am: Removed code to build testkjs; we do this in Xcode now.
928         Changed to build target "All" rather than default target. This makes us
929         build the testkjs test tool.
930         * dummy.cpp: Removed.
931         * kjs/.cvsignore: Removed obsolete files from this list, including
932         the testkjs tool, which is now built in the symroots directory.
933         * kjs/testkjs.cpp: Added copyright notice that was missing, since we have
934         changed this file. Also this has the nice side effect of causing the tool
935         to be rebuilt in the new location even if there are no other changes in
936         your tree when you check this out.
937         * tests/mozilla/run-mozilla-tests: Invoke perl explicitly so this works
938         without setting the execute bit on jsDriver.pl.
939
940 2004-07-22  Kevin Decker  <kdecker@apple.com>
941
942         Reviewed by Darin
943         
944         Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions). 
945
946         * kjs/function_object.cpp:
947         (FunctionObjectImp::construct):
948         * kjs/function_object.h:
949         * kjs/object.cpp:
950         (KJS::ObjectImp::construct):
951         * kjs/object.h:
952         (KJS::Object::construct):
953
954 2004-07-21  Darin Adler  <darin@apple.com>
955
956         * bindings/npruntime.h: Fixed typo.
957
958 2004-07-19  John Sullivan  <sullivan@apple.com>
959
960         Reviewed by Maciej.
961         
962         - bulletproofed array.slice() against NAN arguments. Harri noticed this
963         vulnerability in my patch for 3714644
964
965         * kjs/array_object.cpp:
966         (ArrayProtoFuncImp::call):
967         handle NAN parameters passed to slice() by clamping to 0 and length.
968
969 2004-07-19  Richard Williamson   <rjw@apple.com>
970
971         Fixed 3733349.  Prevent Java applet callbacks into JavaScript after applet
972         has been destroyed.
973
974         Reviewed by John.
975
976         * bindings/jni/jni_jsobject.cpp:
977         (JSObject::invoke):
978         (JSObject::JSObject):
979
980 2004-07-16  John Sullivan  <sullivan@apple.com>
981
982         Reviewed by Maciej.
983         
984         - fixed <rdar://problem/3714644> REGRESSION (125.8-146): bugzilla submit link 
985         hangs browser with javascript
986
987         * kjs/array_object.cpp:
988         (ArrayProtoFuncImp::call):
989         Check for undefined type for args[0] the same way we were already checking
990         for args[1]. In this case, args was zero-length, but we were treating
991         args[0] like an integer anyway. Resulted in some code looping from a NAN
992         value to 4, taking approximately forever.
993
994         * JavaScriptCore.pbproj/project.pbxproj:
995         version wars
996         
997 === Safari-152 ===
998
999 2004-07-14  Maciej Stachowiak  <mjs@apple.com>
1000
1001         Reviewed by John.
1002
1003         <rdar://problem/3711474>: (REGRESSION (125-146): JavaScript 'toString(16)' is broken)
1004         <rdar://problem/3644873>: (REGRESSION (125-140u): secondary list doesn't fill in at Southwest.com)
1005
1006         * kjs/number_object.cpp:
1007         (NumberProtoFuncImp::call): Initialize radix from dradix, not from itself!
1008
1009 2004-07-13  Kevin Decker  <kdecker@apple.com>
1010
1011         Reviewed by kocienda.
1012
1013         - made testkjs and JavaScriptCore a subtarget of 'All'
1014         - testkjs now builds in $SYMROOTS
1015
1016         * JavaScriptCore.pbproj/project.pbxproj:
1017
1018 === Safari-151 ===
1019
1020 2004-06-24  Chris Blumenberg  <cblu@apple.com>
1021
1022         Ignore .mode1 files in JavaScriptCore.pbproj
1023
1024         Reviewed by kocienda.
1025
1026         * JavaScriptCore.pbproj/.cvsignore:
1027
1028 2004-06-23  Richard Williamson   <rjw@apple.com>
1029
1030         Implemented changes for latest npruntime.h.
1031         
1032         Reviewed by Chris.
1033
1034         * JavaScriptCore.pbproj/project.pbxproj:
1035         * bindings/NP_jsobject.cpp:
1036         (listFromVariantArgs):
1037         (identiferFromNPIdentifier):
1038         (_NPN_CreateScriptObject):
1039         (NPN_Call):
1040         (NPN_Evaluate):
1041         (NPN_GetProperty):
1042         (NPN_SetProperty):
1043         (NPN_RemoveProperty):
1044         * bindings/NP_jsobject.h:
1045         * bindings/c/c_class.cpp:
1046         (CClass::methodsNamed):
1047         (CClass::fieldNamed):
1048         * bindings/c/c_instance.cpp:
1049         (CInstance::invokeMethod):
1050         * bindings/c/c_utility.cpp:
1051         (convertNPVariantToValue):
1052         * bindings/c/c_utility.h:
1053         * bindings/npruntime.cpp:
1054         (stringIdentifierEqual):
1055         (stringIdentifierHash):
1056         (getStringIdentifierDictionary):
1057         (intIdentifierEqual):
1058         (intIdentifierHash):
1059         (getIntIdentifierDictionary):
1060         (NPN_GetStringIdentifier):
1061         (NPN_GetStringIdentifiers):
1062         (NPN_GetIntIdentifier):
1063         (NPN_IdentifierIsString):
1064         (NPN_UTF8FromIdentifier):
1065         (NPN_VariantToInt32):
1066         (NPN_VariantToDouble):
1067         (NPN_SetException):
1068         * bindings/npruntime.h:
1069         * bindings/objc/WebScriptObject.mm:
1070         (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1071         * bindings/runtime_object.cpp:
1072         (RuntimeObjectImp::~RuntimeObjectImp):
1073         * bindings/runtime_root.cpp:
1074         (KJS::Bindings::rootForInterpreter):
1075         * bindings/testbindings.cpp:
1076         (initializeIdentifiers):
1077         (logMessage):
1078         (setDoubleValue):
1079         (setIntValue):
1080         (setBooleanValue):
1081
1082 === JavaScriptCore-146.1 ===
1083
1084 2004-06-16  Richard Williamson   <rjw@apple.com>
1085
1086         Fixed <rdar://problem/3702287> Crash returning nil from bound ObjC
1087
1088         This turned out to be a show stopper for Dashboard.  Accessing a nil
1089         ObjC property from JS caused a crash.  Similar to the problem
1090         3696112 fixed below.
1091         
1092         Reviewed by Trey.
1093
1094         * bindings/objc/objc_runtime.mm:
1095         (KJS::Bindings::ObjcField::valueFromInstance):
1096
1097 === Safari-146 ===
1098
1099 2004-06-16  Richard Williamson   <rjw@apple.com>
1100
1101         Fixed <rdar://problem/3696112>: nil from an Objective-C class seems to get wrapped as a JavaScript proxy that will not print.
1102
1103         This turned out to be a show stopper for Dashboard.  We now
1104         return Undefined() when nil is returned from a ObjC method
1105         that returns an object type.
1106         
1107         Reviewed by Maciej.
1108
1109         * bindings/objc/objc_utility.mm:
1110         (KJS::Bindings::convertObjcValueToValue):
1111
1112 === Safari-145 ===
1113
1114 2004-06-15  Richard Williamson   <rjw@apple.com>
1115
1116         Fixed <rdar://problem/3695875>: Objective-C instances that are exported to JavaScript are too promiscuous
1117
1118         No longer need to check respondsToSelector: for
1119         isSelectorExcludedFromWebScript: and isKeyExcludedFromWebScript:
1120         because these now have a default implementation on NSObject.
1121
1122         Reviewed by Trey.
1123
1124         * bindings/objc/objc_class.mm:
1125         (ObjcClass::methodsNamed):
1126         (ObjcClass::fieldNamed):
1127
1128 2004-06-14  Darin Adler  <darin@apple.com>
1129
1130         Reviewed by Maciej.
1131
1132         - fixed some things for GC that Patrick missed, or that happened after the branch
1133
1134         * bindings/objc/WebScriptObject.mm:
1135         (-[WebScriptObject dealloc]): Moved removeNativeReference call here from private object.
1136         (-[WebScriptObject finalize]): Added.
1137
1138         - added some missing nil checks
1139
1140         * bindings/objc/objc_instance.mm:
1141         (ObjcInstance::ObjcInstance): Check for nil.
1142         (ObjcInstance::~ObjcInstance): Check for nil.
1143         (ObjcInstance::operator=): Check for nil.
1144
1145 2004-06-14  Darin Adler  <darin@apple.com>
1146
1147         Reviewed by me, code changes by Patrick Beard.
1148
1149         - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
1150
1151         * bindings/objc/objc_instance.mm:
1152         (ObjcInstance::ObjcInstance): Use CFRetain instead of retain.
1153         (ObjcInstance::~ObjcInstance): Use CFRelease instead of release.
1154         (ObjcInstance::operator=): More of the same.
1155         (ObjcInstance::end): Use [pool drain] if compiling on Tiger.
1156
1157         * bindings/objc/objc_runtime.mm:
1158         (ObjcArray::ObjcArray): Use CFRetain instead of retain.
1159         (ObjcArray::~ObjcArray): Use CFRelease instead of release.
1160         (ObjcArray::operator=): More of the same.
1161
1162         * bindings/testbindings.mm: Fixed incorrect license.
1163         (main): Use [pool drain] if compiling on Tiger.
1164
1165 === Safari-144 ===
1166
1167 2004-06-10  Kevin Decker  <kdecker@apple.com>
1168
1169         Reviewed by John.
1170
1171         * kjs/lexer.cpp: 
1172         (Lexer::setCode):
1173             - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
1174         * kjs/lexer.h:
1175         (KJS::Lexer::lineNo):
1176             - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
1177
1178 === JavaScriptCore-143.2 ===
1179
1180 2004-06-07  Darin Adler  <darin@apple.com>
1181
1182         - fixed <rdar://problem/3682489>: (JavaScriptGlue no longer compiles because Interpreter::evaluate parameters changed)
1183
1184         * kjs/interpreter.h: Added an overload to make JavaScriptGlue compile.
1185         * kjs/interpreter.cpp: (KJS::Interpreter::evaluate): Implemented the overload.
1186
1187 === JavaScriptCore-143.1 ===
1188
1189 2004-06-04  Kevin Decker  <kdecker@apple.com>
1190
1191         Reviewed by Darin
1192         
1193         - fixed <rdar://problem/3680594>
1194
1195         * kjs/object.cpp:
1196         (KJS::Error::create):
1197
1198 === Safari-143 ===
1199
1200 2004-06-04  Darin Adler  <darin@apple.com>
1201
1202         * kjs/testkjs.cpp: (main): Fix build breakage by adding URL and line number parameters.
1203
1204 2004-06-04  Kevin Decker  <kdecker@apple.com>
1205
1206         Reviewed by Dave.
1207
1208         - ObjC bindings do not (yet) pass along sourceurl or line numbers
1209         - we don't have a way as of yet to accomidate line numbers and urls for dynamic javascript
1210         - changed the wording of an error message
1211         - the lexer, parser, and interpreter have been made "sourceURL aware"
1212         - stored the url into Error
1213          
1214         * bindings/NP_jsobject.cpp:
1215         (NPN_Evaluate):
1216         * bindings/jni/jni_jsobject.cpp:
1217         (JSObject::eval):
1218         * bindings/objc/WebScriptObject.mm:
1219         (-[WebScriptObject evaluateWebScript:]):
1220         * kjs/function.cpp:
1221         (GlobalFuncImp::call):
1222         * kjs/function_object.cpp:
1223         (FunctionObjectImp::construct):
1224         * kjs/internal.cpp:
1225         (Parser::parse):
1226         (InterpreterImp::checkSyntax):
1227         (InterpreterImp::evaluate):
1228         * kjs/internal.h:
1229         * kjs/interpreter.cpp:
1230         (Interpreter::evaluate):
1231         * kjs/interpreter.h:
1232         * kjs/lexer.cpp:
1233         (Lexer::setCode):
1234         * kjs/lexer.h:
1235         (KJS::Lexer::sourceURL):
1236         * kjs/nodes.cpp:
1237         (Node::Node):
1238         (Node::throwError):
1239         (FunctionCallNode::evaluate):
1240         * kjs/nodes.h:
1241         * kjs/object.cpp:
1242         (KJS::Error::create):
1243         * kjs/object.h:
1244
1245 2004-06-04  Richard Williamson   <rjw@apple.com>
1246
1247         Fixed crash when attempting to access properties on nil
1248         object.
1249         
1250         Reviewed by John.
1251
1252         * bindings/objc/objc_instance.mm:
1253         (ObjcInstance::getClass):
1254         * bindings/runtime_object.cpp:
1255         (RuntimeObjectImp::get):
1256         * bindings/testM.js:
1257         * bindings/testbindings.mm:
1258         (-[MyFirstInterface getString]):
1259
1260 2004-05-27  Kevin Decker  <kdecker@apple.com>
1261
1262         Reviewed by Ken.
1263
1264         -revised generated error message content
1265         
1266         * kjs/error_object.cpp:
1267         (ErrorProtoFuncImp::call):
1268         * kjs/internal.cpp:
1269         (Parser::parse):
1270         * kjs/object.cpp:
1271         (KJS::Error::create):
1272
1273 === Safari-142 ===
1274
1275 2004-05-27  Richard Williamson   <rjw@apple.com>
1276
1277         Renamed WebScriptMethods to WebScripting based on feedback from Nancy.
1278
1279         Reviewed by Chris.
1280
1281         * bindings/objc/WebScriptObject.h:
1282
1283 2004-05-27  Darin Adler  <darin@apple.com>
1284
1285         Reviewed by Maciej.
1286
1287         - moved to new symlink technique for embedding frameworks
1288
1289         * JavaScriptCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
1290         because we don't need it any more.
1291
1292 2004-05-24  Richard Williamson   <rjw@apple.com>
1293
1294         Changed RuntimeArrayImp to inherit from ArrayInstanceImp and
1295         fixed ClassInfo to correctly reflect inheritance.  This is required
1296         because of the runtime checks in JSC for arrays, i.e. in
1297         the Function objects apply method.
1298
1299         Reviewed by Ken.
1300
1301         * bindings/jni/jni_runtime.cpp:
1302         (JavaArray::convertJObjectToArray):
1303         * bindings/objc/objc_utility.mm:
1304         (KJS::Bindings::convertObjcValueToValue):
1305         * bindings/runtime_array.cpp:
1306         (RuntimeArrayImp::RuntimeArrayImp):
1307         * bindings/runtime_array.h:
1308         * bindings/testM.js: Added.
1309         * bindings/testbindings.mm:
1310         (+[MyFirstInterface webScriptNameForSelector:]):
1311         (-[MyFirstInterface logMessages:]):
1312         (-[MyFirstInterface logMessage:prefix:]):
1313         (-[MyFirstInterface callJSObject::]):
1314
1315 2004-05-22  Darin Adler  <darin@apple.com>
1316
1317         Reviewed by Maciej.
1318
1319         - fixed <rdar://problem/3664260>: (JS needs to listen to timezone change notifications)
1320
1321         * kjs/date_object.cpp: (CopyLocalTimeZone): As per Chris Kane and Jordan Hubbard, use <notify.h>
1322         with a hardcoded string of "com.apple.system.timezone", and do CFTimeZoneResetSystem since
1323         CoreFoundation doesn't do this itself. Turns out this affects the default time zone as long as
1324         it hasn't been set explicitly.
1325
1326 === Safari-141 ===
1327
1328 2004-05-20  Richard Williamson   <rjw@apple.com>
1329
1330         Implemented WebScriptObject/DOM wrapper voodoo.  DOM wrappers
1331         can now be referenced like any other WebScriptObject, meaning
1332         you can do JS operations on them.
1333
1334         All added implementation of finalizeForWebScript.
1335
1336         Reviewed by Ken.
1337
1338         * bindings/objc/WebScriptObject.h:
1339         * bindings/objc/WebScriptObject.mm:
1340         (-[WebScriptObject _initializeWithObjectImp:KJS::root:Bindings::]):
1341         (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
1342         (-[WebScriptObject KJS::]):
1343         (-[WebScriptObject dealloc]):
1344         (-[WebScriptObject callWebScriptMethod:withArguments:]):
1345         (-[WebScriptObject evaluateWebScript:]):
1346         (-[WebScriptObject setValue:forKey:]):
1347         (-[WebScriptObject valueForKey:]):
1348         (-[WebScriptObject stringRepresentation]):
1349         * bindings/objc/WebScriptObjectPrivate.h:
1350         * bindings/objc/objc_instance.mm:
1351         (ObjcInstance::~ObjcInstance):
1352
1353 2004-05-19  Richard Williamson   <rjw@apple.com>
1354
1355         Removed extraneous tabs that were added (by XCode?).
1356
1357         * bindings/objc/WebScriptObject.h:
1358
1359 2004-05-19  Darin Adler  <darin@apple.com>
1360
1361         - fixed headers with licenses mangled by Xcode auto-indenting
1362
1363         * bindings/jni/jni_jsobject.cpp:
1364         * bindings/jni/jni_jsobject.h:
1365         * bindings/runtime_array.h:
1366         * bindings/runtime_root.cpp:
1367         * bindings/runtime_root.h:
1368
1369 2004-05-18  Richard Williamson   <rjw@apple.com>
1370
1371         Added exception logging.  Also check for exception and
1372         set results as appropriate.
1373
1374         Reviewed by Maciej (partially reviewed).
1375
1376         * bindings/objc/WebScriptObject.mm:
1377         (-[WebScriptObject callWebScriptMethod:withArguments:]):
1378         (-[WebScriptObject evaluateWebScript:]):
1379         (-[WebScriptObject setValue:forKey:]):
1380         (-[WebScriptObject valueForKey:]):
1381
1382 2004-05-18  Richard Williamson   <rjw@apple.com>
1383
1384         Finsished implementing support for windowScriptObject.
1385         Had to make WebScriptObjectPrivate.h accessible from
1386         WebCore.
1387
1388         Reviewed by Maciej.
1389
1390         * JavaScriptCore.pbproj/project.pbxproj:
1391         * bindings/objc/WebScriptObjectPrivate.h:
1392
1393 2004-05-18  Richard Williamson   <rjw@apple.com>
1394
1395         Use KVC to set/get values instead of directly accessing
1396         ivars.
1397
1398         Reviewed by Maciej.
1399
1400         * bindings/objc/WebScriptObject.mm:
1401         (-[WebScriptObject callWebScriptMethod:withArguments:]):
1402         (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1403         * bindings/objc/objc_runtime.mm:
1404         (ObjcField::valueFromInstance):
1405         (convertValueToObjcObject):
1406         (ObjcField::setValueToInstance):
1407
1408 2004-05-17  Richard Williamson   <rjw@apple.com>
1409
1410         Implemented new API for WebScriptObject.
1411
1412         Fixed <rdar://problem/3657145>: (objc to javascript method calls do not cause updates.)
1413         Fixed <rdar://problem/3654887>: (Update to JSC to refer to new JSObject LiveConnect object)  (w/ help from Vicki)
1414
1415         Reviewed by Hyatt.
1416
1417         * JavaScriptCore.pbproj/project.pbxproj:
1418         * bindings/c/c_instance.cpp:
1419         (CInstance::invokeMethod):
1420         * bindings/jni/jni_instance.cpp:
1421         (JavaInstance::invokeMethod):
1422         * bindings/jni/jni_jsobject.cpp:
1423         (JSObject::convertValueToJObject):
1424         * bindings/jni/jni_utility.cpp:
1425         (KJS::Bindings::getJNIField):
1426         * bindings/objc/WebScriptObject.mm:
1427         (_didExecute):
1428         (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
1429         (-[WebScriptObject KJS::]):
1430         (-[WebScriptObject dealloc]):
1431         (+[WebScriptObject throwException:]):
1432         (listFromNSArray):
1433         (-[WebScriptObject callWebScriptMethod:withArguments:]):
1434         (-[WebScriptObject evaluateWebScript:]):
1435         (-[WebScriptObject setValue:forKey:]):
1436         (-[WebScriptObject valueForKey:]):
1437         (-[WebScriptObject stringRepresentation]):
1438         (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1439         (+[WebUndefined undefined]):
1440         (-[WebUndefined initWithCoder:]):
1441         (-[WebUndefined encodeWithCoder:]):
1442         (-[WebUndefined copyWithZone:]):
1443         (-[WebUndefined retain]):
1444         (-[WebUndefined release]):
1445         (-[WebUndefined retainCount]):
1446         (-[WebUndefined autorelease]):
1447         (-[WebUndefined dealloc]):
1448         (-[WebUndefined copy]):
1449         (-[WebUndefined replacementObjectForPortCoder:]):
1450         * bindings/objc/WebScriptObjectPrivate.h: Added.
1451         * bindings/objc/objc_class.mm:
1452         (ObjcClass::methodsNamed):
1453         (ObjcClass::fieldNamed):
1454         * bindings/objc/objc_instance.mm:
1455         (ObjcInstance::invokeMethod):
1456         * bindings/objc/objc_jsobject.h:
1457         * bindings/objc/objc_jsobject.mm:
1458         * bindings/objc/objc_runtime.mm:
1459         (ObjcField::valueFromInstance):
1460         * bindings/objc/objc_utility.mm:
1461         (KJS::Bindings::JSMethodNameToObjCMethodName):
1462         (KJS::Bindings::convertValueToObjcValue):
1463         (KJS::Bindings::convertObjcValueToValue):
1464         * bindings/runtime.cpp:
1465         (Instance::setDidExecuteFunction):
1466         (Instance::didExecuteFunction):
1467         (Instance::setValueOfField):
1468         * bindings/runtime.h:
1469         * bindings/testbindings.mm:
1470         (+[MyFirstInterface webScriptNameForSelector:]):
1471         (-[MyFirstInterface callJSObject::]):
1472
1473 2004-05-14  Vicki Murley  <vicki@apple.com>
1474
1475         Reviewed by mjs.
1476  
1477         <rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release
1478
1479         * JavaScriptCore.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0
1480
1481 === Safari-140 ===
1482
1483 2004-05-13  Richard Williamson   <rjw@apple.com>
1484
1485         Fixed indentation.
1486
1487         Reviewed by Chris.
1488
1489         * ChangeLog:
1490         * bindings/objc/WebScriptObject.h:
1491
1492 2004-05-13  Richard Williamson   <rjw@apple.com>
1493
1494         Approved API changes.  Currently unimplemented.
1495
1496         Reviewed by Chris.
1497
1498         * ChangeLog:
1499         * JavaScriptCore.pbproj/project.pbxproj:
1500         * bindings/objc/WebScriptObject.h: Added.
1501         * bindings/objc/WebScriptObject.mm: Added.
1502         (+[WebScriptObject throwException:]):
1503         (-[WebScriptObject callWebScriptMethod:withArguments:]):
1504         (-[WebScriptObject evaluateWebScript:]):
1505         (-[WebScriptObject stringRepresentation]):
1506         (+[WebUndefined undefined]):
1507         (-[WebUndefined initWithCoder:]):
1508         (-[WebUndefined encodeWithCoder:]):
1509         (-[WebUndefined copyWithZone:]):
1510
1511 2004-05-07  Vicki Murley  <vicki@apple.com>
1512
1513         Reviewed by darin.
1514
1515         Turn off GC since it uses ppc only instructions (which breaks 
1516         the B&I build).   
1517     
1518         * kjs/value.h: set USE_CONSERVATIVE_GC to 0
1519
1520 === Safari-139 ===
1521
1522 2004-05-07  Maciej Stachowiak  <mjs@apple.com>
1523
1524         Reviewed by Darin.
1525
1526         - add -funroll-loops=16 compiler option for approx .5% speedup on
1527         HTML iBench and .5-1% speedup on JS iBench.
1528         
1529         * JavaScriptCore.pbproj/project.pbxproj:
1530
1531 2004-04-25  Maciej Stachowiak  <mjs@apple.com>
1532
1533         Reviewed by Darin.
1534
1535         Enable full conservative GC mode in addition to test mode. When
1536         conservative GC is enabled, we now get an 11% speed improvement on
1537         the iBench. Also fix some spots I missed before.
1538
1539         Specific noteworth changes:
1540         
1541         * kjs/collector.cpp:
1542         (KJS::Collector::markStackObjectsConservatively): Check possible
1543         cell pointers for 8-byte aligment and verify they are not 0.
1544
1545         * kjs/protected_values.cpp:
1546         (KJS::ProtectedValues::increaseProtectCount): Move null-tolerance from here...
1547         (KJS::ProtectedValues::decreaseProtectCount): ...and here...
1548         * kjs/protect.h:
1549         (KJS::gcProtectNullTolerant): ...to here...
1550         (KJS::gcUnprotectNullTolerant): ...and here, because not all callers need the null
1551         tolerance, and doing the check is expensive.
1552
1553         * kjs/protected_values.cpp:
1554         (KJS::ProtectedValues::computeHash): Replace hash function with a much faster one
1555         that is still very good.
1556
1557         * kjs/protect.h:
1558         (KJS::gcProtect):
1559         (KJS::gcUnprotect):
1560         (KJS::ProtectedValue::ProtectedValue):
1561         (KJS::ProtectedValue::~ProtectedValue):
1562         (KJS::ProtectedValue::operator=):
1563         (KJS::ProtectedObject::ProtectedObject):
1564         (KJS::ProtectedObject::~ProtectedObject):
1565         (KJS::ProtectedObject::operator=):
1566         (KJS::ProtectedReference::ProtectedReference):
1567         (KJS::ProtectedReference::~ProtectedReference):
1568         (KJS::ProtectedReference::operator=):
1569         * kjs/protected_values.cpp:
1570         (KJS::ProtectedValues::getProtectCount):
1571         (KJS::ProtectedValues::increaseProtectCount):
1572         (KJS::ProtectedValues::decreaseProtectCount):
1573         (KJS::ProtectedValues::computeHash):
1574         * bindings/runtime_root.cpp:
1575         (KJS::Bindings::addNativeReference):
1576         (KJS::Bindings::removeNativeReference):
1577         (RootObject::removeAllNativeReferences):
1578         * bindings/runtime_root.h:
1579         (KJS::Bindings::RootObject::~RootObject):
1580         (KJS::Bindings::RootObject::setRootObjectImp):
1581         * kjs/collector.cpp:
1582         (KJS::Collector::allocate):
1583         (KJS::Collector::collect):
1584         * kjs/collector.h:
1585         * kjs/internal.cpp:
1586         (NumberImp::create):
1587         (InterpreterImp::globalInit):
1588         (InterpreterImp::globalClear):
1589         (InterpreterImp::mark):
1590         * kjs/list.cpp:
1591         (KJS::List::derefValues):
1592         (KJS::List::refValues):
1593         (KJS::List::append):
1594         * kjs/object.cpp:
1595         (KJS::ObjectImp::setInternalValue):
1596         (KJS::ObjectImp::putDirect):
1597         * kjs/value.cpp:
1598         (ValueImp::mark):
1599         (ValueImp::marked):
1600         * kjs/value.h:
1601         (KJS::ValueImp::ValueImp):
1602         (KJS::ValueImp::~ValueImp):
1603         (KJS::ValueImp::):
1604         (KJS::Value::Value):
1605         (KJS::Value::~Value):
1606         (KJS::Value::operator=):
1607
1608 2004-04-30  Richard Williamson   <rjw@apple.com>
1609
1610         Asking an NSInvocation for it's return value when return type
1611         is void throws an exception.  Added check for void return types
1612         to avoid this exception.
1613
1614         Reviewed by Ken.
1615
1616         * bindings/objc/objc_instance.mm:
1617         (ObjcInstance::invokeMethod):
1618
1619 2004-04-29  Richard Williamson   <rjw@apple.com>
1620
1621         Fixed several bad problems with the ObjC bindings.  In particular, conversion
1622         to/from JavaScriptObject (soon to be WebScriptObject) was completely broken.
1623
1624         Reviewed by Chris.
1625
1626         * bindings/objc/objc_jsobject.h:
1627         * bindings/objc/objc_jsobject.mm:
1628         (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
1629         (-[JavaScriptObject KJS::]):
1630         (+[JavaScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1631         (-[JavaScriptObject call:arguments:]):
1632         (-[JavaScriptObject evaluate:]):
1633         (-[JavaScriptObject getMember:]):
1634         (-[JavaScriptObject getSlot:]):
1635         * bindings/objc/objc_runtime.mm:
1636         (ObjcField::valueFromInstance):
1637         (ObjcField::setValueToInstance):
1638         * bindings/objc/objc_utility.mm:
1639         (KJS::Bindings::convertValueToObjcValue):
1640         (KJS::Bindings::convertObjcValueToValue):
1641         * bindings/runtime.h:
1642         * bindings/runtime_root.cpp:
1643         (KJS::Bindings::rootForInterpreter):
1644         (KJS::Bindings::addNativeReference):
1645         (KJS::Bindings::removeNativeReference):
1646         * bindings/runtime_root.h:
1647         * bindings/testbindings.mm:
1648         (-[MyFirstInterface logMessage:]):
1649         (-[MyFirstInterface setJSObject:]):
1650         (-[MyFirstInterface callJSObject::]):
1651
1652 2004-04-24  Darin Adler  <darin@apple.com>
1653
1654         Reviewed by Dave.
1655
1656         * kjs/ustring.cpp: (KJS::UString::append): Fix one case that was allocating a buffer
1657         that is 2x too big.
1658
1659 2004-04-23  Maciej Stachowiak  <mjs@apple.com>
1660
1661         Reviewed by Darin.
1662
1663         Implementation of conservative GC, based partly on code from
1664         Darin. It's turned off for now, so it shouldn't have any effect on
1665         the normal build.
1666         
1667         * JavaScriptCore.pbproj/project.pbxproj:
1668         * kjs/collector.cpp:
1669         (KJS::Collector::markStackObjectsConservatively):
1670         (KJS::Collector::markProtectedObjects):
1671         (KJS::Collector::collect):
1672         * kjs/collector.h:
1673         * kjs/protect.h:
1674         (KJS::gcProtect):
1675         (KJS::gcUnprotect):
1676         * kjs/protected_values.cpp: Added.
1677         (KJS::ProtectedValues::getProtectCount):
1678         (KJS::ProtectedValues::increaseProtectCount):
1679         (KJS::ProtectedValues::insert):
1680         (KJS::ProtectedValues::decreaseProtectCount):
1681         (KJS::ProtectedValues::expand):
1682         (KJS::ProtectedValues::shrink):
1683         (KJS::ProtectedValues::rehash):
1684         (KJS::ProtectedValues::computeHash):
1685         * kjs/protected_values.h: Added.
1686         * kjs/value.cpp:
1687         (ValueImp::useConservativeMark):
1688         (ValueImp::mark):
1689         (ValueImp::marked):
1690         * kjs/value.h:
1691         (KJS::ValueImp::):
1692
1693 === Safari-138 ===
1694
1695 2004-04-22  Richard Williamson   <rjw@apple.com>
1696
1697         Fixed build snafu (re-declaration of NPBool in npruntime.h and
1698         npapi.h).
1699
1700         * bindings/npruntime.h:
1701
1702 2004-04-22  Richard Williamson   <rjw@apple.com>
1703
1704         Updated plugin binding API to reflect latest revision from
1705         working group.
1706         
1707         Biggest change is the introduction of NPVariant used to represent
1708         value types.  NPVariant replaces the use of NPObject for the
1709         exchange of values between scripting environment and native code.
1710
1711         Reviewed by John.
1712
1713         * JavaScriptCore.pbproj/project.pbxproj:
1714         * bindings/NP_jsobject.cpp:
1715         (identiferFromNPIdentifier):
1716         (NPN_Call):
1717         (NPN_Evaluate):
1718         (NPN_GetProperty):
1719         (NPN_SetProperty):
1720         (NPN_ToString):
1721         (NPN_GetPropertyAtIndex):
1722         (NPN_SetPropertyAtIndex):
1723         * bindings/c/c_class.cpp:
1724         (CClass::methodsNamed):
1725         (CClass::fieldNamed):
1726         * bindings/c/c_instance.cpp:
1727         (CInstance::invokeMethod):
1728         (CInstance::defaultValue):
1729         * bindings/c/c_runtime.cpp:
1730         (CField::valueFromInstance):
1731         (CField::setValueToInstance):
1732         * bindings/c/c_utility.cpp:
1733         (convertNPStringToUTF16):
1734         (convertUTF8ToUTF16):
1735         (coerceValueToNPVariantStringType):
1736         (convertValueToNPVariant):
1737         (convertNPVariantToValue):
1738         * bindings/c/c_utility.h:
1739         * bindings/npruntime.cpp:
1740         (NPN_GetIdentifier):
1741         (NPN_GetIdentifiers):
1742         (NPN_UTF8FromIdentifier):
1743         (NPN_VariantIsVoid):
1744         (NPN_VariantIsNull):
1745         (NPN_VariantIsUndefined):
1746         (NPN_VariantIsBool):
1747         (NPN_VariantIsInt32):
1748         (NPN_VariantIsDouble):
1749         (NPN_VariantIsString):
1750         (NPN_VariantIsObject):
1751         (NPN_VariantToBool):
1752         (NPN_VariantToString):
1753         (NPN_VariantToInt32):
1754         (NPN_VariantToDouble):
1755         (NPN_VariantToObject):
1756         (NPN_InitializeVariantAsVoid):
1757         (NPN_InitializeVariantAsNull):
1758         (NPN_InitializeVariantAsUndefined):
1759         (NPN_InitializeVariantWithBool):
1760         (NPN_InitializeVariantWithInt32):
1761         (NPN_InitializeVariantWithDouble):
1762         (NPN_InitializeVariantWithString):
1763         (NPN_InitializeVariantWithStringCopy):
1764         (NPN_InitializeVariantWithObject):
1765         (NPN_InitializeVariantWithVariant):
1766         (NPN_ReleaseVariantValue):
1767         (NPN_CreateObject):
1768         (NPN_RetainObject):
1769         (NPN_ReleaseObject):
1770         (NPN_IsKindOfClass):
1771         (NPN_SetExceptionWithUTF8):
1772         (NPN_SetException):
1773         * bindings/npruntime.h:
1774         (_NPString::):
1775         (_NPString::_NPVariant::):
1776         * bindings/testbindings.cpp:
1777         (logMessage):
1778         (setDoubleValue):
1779         (setIntValue):
1780         (setStringValue):
1781         (setBooleanValue):
1782         (getDoubleValue):
1783         (getIntValue):
1784         (getStringValue):
1785         (getBooleanValue):
1786         (myGetProperty):
1787         (mySetProperty):
1788         (myInvoke):
1789         (myAllocate):
1790
1791 2004-04-22  Darin Adler  <darin@apple.com>
1792
1793         Reviewed by Maciej.
1794
1795         - fixed <rdar://problem/3627473>: "REGRESSION (125-137): memory trasher in UString::append, causing many different crashes"
1796
1797         * kjs/ustring.cpp:
1798         (KJS::UString::expandCapacity): Fix sizeof(UChar *) that should be sizeof(UChar).
1799         Was resulting in a buffer 2x the needed size.
1800         (KJS::UString::expandPreCapacity): Ditto.
1801         (KJS::UString::append): Fix malloc that is missing a sizeof(UChar).
1802
1803 2004-04-21  Maciej Stachowiak  <mjs@apple.com>
1804
1805         Reviewed by Darin.
1806
1807         Preliminary change for conservative GC. Create "protected"
1808         subclasses to GC-protect objects when on heap, since we will soon
1809         remove the built-in refcounting of the normal wrapper classes. Use
1810         them where needed.
1811         
1812         * JavaScriptCore.pbproj/project.pbxproj:
1813         * kjs/context.h:
1814         * kjs/internal.h:
1815         (KJS::InterpreterImp::globalObject):
1816         * kjs/interpreter.h:
1817         * kjs/property_map.cpp:
1818         * kjs/reference.h:
1819         * kjs/reference_list.cpp:
1820
1821 2004-04-19  Maciej Stachowiak  <mjs@apple.com>
1822
1823         Reviewed by Dave.
1824
1825         Optimize prepend using the shared substring optimization. Also,
1826         limit the applicability of shared append and shared prepend. If
1827         you overdo it, it does more harm than good, because you create a
1828         bunch of strings that are disqualified from future shared
1829         append/prepend, for not much immediate savings in allocate/copy
1830         expense.
1831         
1832         * kjs/ustring.cpp:
1833         (KJS::):
1834         (KJS::UString::Rep::create):
1835         (KJS::UString::expandedSize):
1836         (KJS::UString::usedPreCapacity):
1837         (KJS::UString::expandCapacity):
1838         (KJS::UString::expandPreCapacity):
1839         (KJS::UString::UString):
1840         (KJS::UString::append):
1841         (KJS::UString::operator=):
1842         * kjs/ustring.h:
1843         (KJS::UString::Rep::data):
1844
1845 2004-04-16  Maciej Stachowiak  <mjs@apple.com>
1846         Reviewed by Richard.
1847
1848         No more need for Completion or Reference to privately inherit from
1849         Value, none of the superclass functionality is used.
1850
1851         * kjs/completion.h:
1852         * kjs/reference.h:
1853
1854 === Safari-137 ===
1855
1856 2004-04-16  Richard Williamson   <rjw@apple.com>
1857
1858         Added interpreter lock protection around object creation.
1859
1860         Reviewed by Chris.
1861
1862         * bindings/runtime.cpp:
1863         (Instance::createRuntimeObject):
1864
1865 2004-04-16  Maciej Stachowiak  <mjs@apple.com>
1866
1867         Reviewed by Ken.
1868
1869         Another JavaScript speed improvement: use the mechanism from
1870         string append optimization to make taking a substring fast, again
1871         sharing the buffer.
1872
1873         A further 22% improvement on the 24fun string speed test.
1874         
1875         * kjs/ustring.cpp:
1876         (KJS::):
1877         (KJS::UString::Rep::create):
1878         (KJS::UString::UString):
1879         (KJS::UString::append):
1880         (KJS::UString::operator=):
1881         (KJS::UString::substr):
1882         * kjs/ustring.h:
1883         (KJS::UString::Rep::data):
1884
1885 2004-04-13  Maciej Stachowiak  <mjs@apple.com>
1886
1887         Reviewed by Darin.
1888
1889         - fixed <rdar://problem/3600695>: String manipulation in JavaScript 24fun test is very slow (slow)
1890         - fixed <rdar://problem/3600691>: Table generation test is really slow
1891         - fixed <rdar://problem/3600661>: 24fun date test is really slow
1892
1893         80% speedup on the string test, lesser speedups on the other two.
1894         
1895         Two different optimizations here:
1896
1897         1) Avoid large overhead of scanning strings to see if they are all
1898         ASCII before numeric conversion.
1899         
1900         * kjs/nodes.cpp:
1901         (AssignNode::evaluate): Don't convert to integer until we know for
1902         sure the operation will need it. Attempting to convert strings to
1903         numbers is a waste when they are being appended with +=.
1904
1905         2) Avoid huge cost of appending strings.
1906
1907         This is done by allowing multiple strings to share a buffer but
1908         actually use different ranges of it. The first time a string is
1909         appended to, we start leaving at least 10% extra space in the
1910         buffer, so doing N appends to the same string takes O(log N)
1911         mallocs instead of O(N).
1912         
1913         * kjs/identifier.cpp:
1914         (KJS::Identifier::equal):
1915         (KJS::Identifier::add):
1916         * kjs/ustring.cpp:
1917         (KJS::):
1918         (KJS::UCharReference::operator=):
1919         (KJS::UCharReference::ref):
1920         (KJS::UString::Rep::create):
1921         (KJS::UString::Rep::destroy):
1922         (KJS::UString::expandedSize):
1923         (KJS::UString::usedCapacity):
1924         (KJS::UString::expandCapacity):
1925         (KJS::UString::UString):
1926         (KJS::UString::null):
1927         (KJS::UString::append):
1928         (KJS::UString::operator=):
1929         (KJS::UString::toStrictUInt32):
1930         (KJS::UString::detach):
1931         (KJS::KJS::operator==):
1932         * kjs/ustring.h:
1933         (KJS::UString::Rep::data):
1934         (KJS::UString::Rep::hash):
1935
1936 2004-04-09  Maciej Stachowiak  <mjs@apple.com>
1937
1938         Reviewed by John.
1939
1940         - fix deployment build by avoiding deployment-only warning.
1941
1942         * kjs/scope_chain.cpp:
1943         (KJS::ScopeChain::bottom):
1944
1945 2004-04-09  Maciej Stachowiak  <mjs@apple.com>
1946
1947         Reviewed by John.
1948
1949         Changed things so that newly created objects get a prototype based
1950         on the scope chain of the current function, rather than the
1951         interpreter that started execution. This fixes the following bugs:
1952         
1953         <rdar://problem/3368523>: ARCH: wrong prototype used to create new objects (hang on lookup.atomica.com)
1954         <rdar://problem/3559173>: ARCH: Cannot scan using a HP Jetdirect product (JS object prototypes bind incorrectly)
1955
1956         * JavaScriptCore.pbproj/project.pbxproj:
1957         * kjs/array_object.cpp:
1958         (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
1959         (ArrayProtoFuncImp::ArrayProtoFuncImp):
1960         (ArrayProtoFuncImp::call):
1961         (ArrayObjectImp::construct):
1962         * kjs/bool_object.cpp:
1963         (BooleanObjectImp::construct):
1964         * kjs/date_object.cpp:
1965         (DateProtoFuncImp::DateProtoFuncImp):
1966         (DateProtoFuncImp::call):
1967         (DateObjectImp::construct):
1968         * kjs/error_object.cpp:
1969         (ErrorObjectImp::construct):
1970         * kjs/function.cpp:
1971         (FunctionImp::FunctionImp):
1972         (FunctionImp::call):
1973         (DeclaredFunctionImp::construct):
1974         (ArgumentsImp::ArgumentsImp):
1975         (GlobalFuncImp::call):
1976         * kjs/function_object.cpp:
1977         (FunctionProtoFuncImp::call):
1978         (FunctionObjectImp::construct):
1979         * kjs/internal.cpp:
1980         (BooleanImp::toObject):
1981         (StringImp::toObject):
1982         (NumberImp::toObject):
1983         (InterpreterImp::InterpreterImp):
1984         (InterpreterImp::clear):
1985         (InterpreterImp::interpreterWithGlobalObject):
1986         * kjs/internal.h:
1987         * kjs/interpreter.cpp:
1988         (ExecState::lexicalInterpreter):
1989         * kjs/interpreter.h:
1990         (KJS::ExecState::dynamicInterpreter):
1991         (KJS::ExecState::interpreter):
1992         * kjs/math_object.cpp:
1993         (MathFuncImp::MathFuncImp):
1994         * kjs/nodes.cpp:
1995         (StatementNode::hitStatement):
1996         (StatementNode::abortStatement):
1997         (RegExpNode::evaluate):
1998         (ElementNode::evaluate):
1999         (ArrayNode::evaluate):
2000         (ObjectLiteralNode::evaluate):
2001         (PropertyValueNode::evaluate):
2002         (FunctionCallNode::evaluate):
2003         (FuncDeclNode::processFuncDecl):
2004         (FuncExprNode::evaluate):
2005         * kjs/number_object.cpp:
2006         (NumberObjectImp::construct):
2007         * kjs/object.cpp:
2008         (KJS::ObjectImp::defaultValue):
2009         (KJS::Error::create):
2010         * kjs/object_object.cpp:
2011         (ObjectObjectImp::construct):
2012         * kjs/reference.cpp:
2013         (Reference::putValue):
2014         * kjs/regexp_object.cpp:
2015         (RegExpProtoFuncImp::call):
2016         (RegExpObjectImp::arrayOfMatches):
2017         (RegExpObjectImp::construct):
2018         * kjs/scope_chain.cpp:
2019         (KJS::ScopeChain::bottom):
2020         * kjs/scope_chain.h:
2021         * kjs/string_object.cpp:
2022         (StringProtoFuncImp::StringProtoFuncImp):
2023         (StringProtoFuncImp::call):
2024         (StringObjectImp::construct):
2025
2026 === Safari-136 ===
2027
2028 === Safari-135 ===
2029
2030 2004-03-31  Richard Williamson   <rjw@apple.com>
2031
2032         Tedious renames based on feedback from plugin-futures list.
2033         NP_ functions are renamed with NPN_ prefix.
2034         Types prefix renamed from NP_ to NP.
2035         NPN_CreateStringWithUTF8 and NPN_SetExceptionWithUTF8 now take a length, optionally -1 if string is null terminated. 
2036         
2037         No review because this was just a renaming patch.
2038
2039         * bindings/NP_jsobject.cpp:
2040         (listFromNPArray):
2041         (jsAllocate):
2042         (identiferFromNPIdentifier):
2043         (NPN_Call):
2044         (NPN_Evaluate):
2045         (NPN_GetProperty):
2046         (NPN_SetProperty):
2047         (NPN_RemoveProperty):
2048         (NPN_ToString):
2049         (NPN_GetPropertyAtIndex):
2050         (NPN_SetPropertyAtIndex):
2051         * bindings/NP_jsobject.h:
2052         * bindings/c/c_class.cpp:
2053         (CClass::_commonInit):
2054         (CClass::classForIsA):
2055         (CClass::CClass):
2056         (CClass::methodsNamed):
2057         (CClass::fieldNamed):
2058         * bindings/c/c_class.h:
2059         * bindings/c/c_instance.cpp:
2060         (CInstance::CInstance):
2061         (CInstance::~CInstance):
2062         (CInstance::operator=):
2063         (CInstance::invokeMethod):
2064         (CInstance::defaultValue):
2065         * bindings/c/c_instance.h:
2066         (KJS::Bindings::CInstance::getObject):
2067         * bindings/c/c_runtime.cpp:
2068         (CField::valueFromInstance):
2069         (CField::setValueToInstance):
2070         * bindings/c/c_runtime.h:
2071         (KJS::Bindings::CField::CField):
2072         (KJS::Bindings::CField::name):
2073         (KJS::Bindings::CMethod::CMethod):
2074         (KJS::Bindings::CMethod::name):
2075         * bindings/c/c_utility.cpp:
2076         (coerceValueToNPString):
2077         (convertValueToNPValueType):
2078         (convertNPValueTypeToValue):
2079         * bindings/c/c_utility.h:
2080         * bindings/npruntime.cpp:
2081         (NPN_IdentifierFromUTF8):
2082         (NPN_IsValidIdentifier):
2083         (NPN_GetIdentifiers):
2084         (NPN_UTF8FromIdentifier):
2085         (NPN_CreateObject):
2086         (NPN_RetainObject):
2087         (NPN_ReleaseObject):
2088         (NPN_IsKindOfClass):
2089         (NPN_SetExceptionWithUTF8):
2090         (NPN_SetException):
2091         (numberAllocate):
2092         (NPN_CreateNumberWithInt):
2093         (NPN_CreateNumberWithFloat):
2094         (NPN_CreateNumberWithDouble):
2095         (NPN_IntFromNumber):
2096         (NPN_FloatFromNumber):
2097         (NPN_DoubleFromNumber):
2098         (stringAllocate):
2099         (NPN_CreateStringWithUTF8):
2100         (NPN_CreateStringWithUTF16):
2101         (NPN_DeallocateUTF8):
2102         (NPN_UTF8FromString):
2103         (NPN_UTF16FromString):
2104         (NPN_StringLength):
2105         (booleanAllocate):
2106         (NPN_CreateBoolean):
2107         (NPN_BoolFromBoolean):
2108         (nullAllocate):
2109         (NPN_GetNull):
2110         (undefinedAllocate):
2111         (NPN_GetUndefined):
2112         (arrayAllocate):
2113         (arrayDeallocate):
2114         (NPN_CreateArray):
2115         (NPN_CreateArrayV):
2116         (NPN_ObjectAtIndex):
2117         * bindings/npruntime.h:
2118         * bindings/runtime.cpp:
2119         (Instance::createBindingForLanguageInstance):
2120         * bindings/testbindings.cpp:
2121         (initializeIdentifiers):
2122         (myHasProperty):
2123         (myHasMethod):
2124         (myGetProperty):
2125         (mySetProperty):
2126         (logMessage):
2127         (setDoubleValue):
2128         (setIntValue):
2129         (setStringValue):
2130         (setBooleanValue):
2131         (getDoubleValue):
2132         (getIntValue):
2133         (getStringValue):
2134         (getBooleanValue):
2135         (myInvoke):
2136         (myAllocate):
2137         (myInvalidate):
2138         (myDeallocate):
2139         (main):
2140
2141 2004-03-31  Richard Williamson   <rjw@apple.com>
2142
2143         Changed references to NP_runtime.h to npruntime.h
2144         
2145         * JavaScriptCore.pbproj/project.pbxproj:
2146         * bindings/NP_jsobject.h:
2147         * bindings/c/c_class.h:
2148         * bindings/c/c_instance.h:
2149         * bindings/c/c_runtime.h:
2150         * bindings/c/c_utility.h:
2151         * bindings/npruntime.cpp:
2152
2153 2004-03-31  Richard Williamson   <rjw@apple.com>
2154
2155         Renamed NP_runtime.h to npruntime.h to match Netscape SDK.
2156
2157         * JavaScriptCore.pbproj/project.pbxproj:
2158         * bindings/NP_jsobject.h:
2159         * bindings/npruntime.cpp:
2160
2161 === Safari-134 ===
2162
2163 2004-03-23  Richard Williamson   <rjw@apple.com>
2164
2165         Added implementation of KJS::Value <-> NP_Object conversion functions.
2166         Augmented test program for 'C' bindings.
2167         Added asserts and parameter checking to all public API.        
2168
2169         Reviewed by Ken.
2170
2171         * JavaScriptCore.pbproj/project.pbxproj:
2172         * bindings/NP_jsobject.cpp:
2173         (NP_ToString):
2174         * bindings/NP_jsobject.h: Added.
2175         * bindings/NP_runtime.cpp:
2176         (NP_IdentifierFromUTF8):
2177         (NP_IsValidIdentifier):
2178         (NP_GetIdentifiers):
2179         (NP_CreateObject):
2180         (NP_RetainObject):
2181         (NP_ReleaseObject):
2182         (NP_IsKindOfClass):
2183         (NP_SetExceptionWithUTF8):
2184         (NP_SetException):
2185         (NP_IntFromNumber):
2186         (NP_FloatFromNumber):
2187         (NP_DoubleFromNumber):
2188         (NP_CreateStringWithUTF8):
2189         (NP_CreateStringWithUTF16):
2190         (NP_DeallocateUTF8):
2191         (NP_UTF8FromString):
2192         (NP_UTF16FromString):
2193         (NP_StringLength):
2194         (NP_BoolFromBoolean):
2195         * bindings/NP_runtime.h:
2196         * bindings/c/c_instance.cpp:
2197         (CInstance::invokeMethod):
2198         * bindings/c/c_utility.cpp:
2199         (coerceValueToNPString):
2200         (convertValueToNPValueType):
2201         (convertNPValueTypeToValue):
2202         * bindings/c/c_utility.h:
2203         * bindings/test.js:
2204         * bindings/testC.js: Added.
2205         * bindings/testbindings.cpp:
2206         (logMessage):
2207         (setDoubleValue):
2208         (setIntValue):
2209         (setStringValue):
2210         (setBooleanValue):
2211         (getDoubleValue):
2212         (getIntValue):
2213         (getStringValue):
2214         (getBooleanValue):
2215         (myInterfaceInvoke):
2216         (myInterfaceAllocate):
2217
2218 === Safari-133 ===
2219
2220 2004-03-19  Darin Adler  <darin@apple.com>
2221
2222         Reviewed by Ken.
2223
2224         - fixed problem with methods like setUTCHour
2225
2226         * kjs/date_object.cpp: (DateProtoFuncImp::call): Fix conversion back to time_t to use the appropriate
2227         GMT vs. local time function based on the utc flag.
2228
2229 2004-03-17  Richard Williamson   <rjw@apple.com>
2230
2231         Added a context parameter to result callbacks use by JavaScriptObject functions.  This was a change requested by Eric Carlson on the QT plugin team.
2232
2233         Reviewed by Ken.
2234
2235         * bindings/NP_jsobject.cpp:
2236         (NP_Call):
2237         (NP_Evaluate):
2238         (NP_GetProperty):
2239         (NP_ToString):
2240         (NP_GetPropertyAtIndex):
2241         * bindings/NP_runtime.h:
2242
2243 2004-03-16  Richard Williamson   <rjw@apple.com>
2244
2245         Fixed 3590169.  Regression (crash) caused by the switch to MethodLists.  Crash when attempting to invoke a method from JavaScript to Java that is not implemented.
2246
2247         Reviewed by John.
2248
2249         * bindings/jni/jni_class.cpp:
2250         (JavaClass::methodsNamed):
2251
2252 2004-03-15  Richard Williamson   <rjw@apple.com>
2253
2254         Fixed 3570854.  Don't attempt to convert Null to strings.  We
2255         were incorrectly converting to "Null".
2256
2257         Actually fixed by Scott Kovatch.
2258
2259         Reviewed by Richard.
2260
2261         * bindings/jni/jni_utility.cpp:
2262         (KJS::Bindings::convertValueToJValue):
2263
2264 === Safari-132 ===
2265
2266 2004-03-11  Richard Williamson   <rjw@apple.com>
2267
2268         Stitched together the NP stuff to our language independent
2269         JavaScript binding stuff.  Very close to being done.
2270         
2271         Added program to test C bindings (and NP stuff).  Just tests
2272         properties.  Will add methods and JavaScript access, etc.
2273
2274         Updated Makefile.am to account for new bindings/c directory.
2275
2276         Change NP_UTF8 from "const char *" to "char" to allow for
2277         declarations like "const NP_UTF8 *" and "NP_UTF8 *".  Ditto
2278         for NP_UTF16.
2279
2280         Added NP_IsValidIdentifier().
2281
2282         Reviewed by Chris.
2283
2284         * JavaScriptCore.pbproj/project.pbxproj:
2285         * Makefile.am:
2286         * bindings/NP_jsobject.cpp:
2287         (identiferFromNPIdentifier):
2288         (NP_Evaluate):
2289         * bindings/NP_runtime.cpp:
2290         (NP_IdentifierFromUTF8):
2291         (NP_IsValidIdentifier):
2292         (NP_GetIdentifiers):
2293         (NP_UTF8FromIdentifier):
2294         (NP_SetExceptionWithUTF8):
2295         (NP_SetException):
2296         (NP_CreateStringWithUTF8):
2297         (NP_CreateStringWithUTF16):
2298         (NP_UTF8FromString):
2299         (NP_UTF16FromString):
2300         * bindings/NP_runtime.h:
2301         * bindings/c/c_class.cpp: Added.
2302         (CClass::_commonDelete):
2303         (CClass::_commonCopy):
2304         (CClass::_commonInit):
2305         (_createClassesByIsAIfNecessary):
2306         (CClass::classForIsA):
2307         (CClass::CClass):
2308         (CClass::name):
2309         (CClass::methodsNamed):
2310         (CClass::fieldNamed):
2311         * bindings/c/c_class.h: Added.
2312         (KJS::Bindings::CClass::~CClass):
2313         (KJS::Bindings::CClass::CClass):
2314         (KJS::Bindings::CClass::operator=):
2315         (KJS::Bindings::CClass::constructorAt):
2316         (KJS::Bindings::CClass::numConstructors):
2317         * bindings/c/c_instance.cpp: Added.
2318         (CInstance::CInstance):
2319         (CInstance::~CInstance):
2320         (CInstance::operator=):
2321         (CInstance::getClass):
2322         (CInstance::begin):
2323         (CInstance::end):
2324         (CInstance::invokeMethod):
2325         (CInstance::defaultValue):
2326         (CInstance::stringValue):
2327         (CInstance::numberValue):
2328         (CInstance::booleanValue):
2329         (CInstance::valueOf):
2330         * bindings/c/c_instance.h: Added.
2331         (KJS::Bindings::CInstance::getObject):
2332         * bindings/c/c_runtime.cpp: Added.
2333         (CField::valueFromInstance):
2334         (CField::setValueToInstance):
2335         * bindings/c/c_runtime.h: Added.
2336         (KJS::Bindings::CField::CField):
2337         (KJS::Bindings::CField::name):
2338         (KJS::Bindings::CField::type):
2339         (KJS::Bindings::CMethod::CMethod):
2340         (KJS::Bindings::CMethod::name):
2341         (KJS::Bindings::CMethod::numParameters):
2342         * bindings/c/c_utility.cpp: Added.
2343         (coerceValueToNPValueType):
2344         (convertValueToNPValueType):
2345         (convertNPValueTypeToValue):
2346         * bindings/c/c_utility.h: Added.
2347         * bindings/make_testbindings:
2348         * bindings/runtime.cpp:
2349         (Instance::createBindingForLanguageInstance):
2350         * bindings/runtime.h:
2351         (KJS::Bindings::Instance::):
2352         * bindings/testbindings.cpp: Added.
2353         (initializeIdentifiers):
2354         (myInterfaceHasProperty):
2355         (myInterfaceHasMethod):
2356         (myInterfaceGetProperty):
2357         (myInterfaceSetProperty):
2358         (myInterfaceInvoke):
2359         (myInterfaceAllocate):
2360         (myInterfaceInvalidate):
2361         (myInterfaceDeallocate):
2362         (GlobalImp::className):
2363         (readJavaScriptFromFile):
2364         (main):
2365
2366 2004-03-10  Richard Williamson   <rjw@apple.com>
2367
2368         Made changes to support new asychronous approach to calls from
2369         plugin to JavaScript
2370
2371         Reviewed by Chris.
2372
2373         * bindings/NP_jsobject.cpp:
2374         (NP_Call):
2375         (NP_Evaluate):
2376         (NP_GetProperty):
2377         (NP_ToString):
2378         (NP_GetPropertyAtIndex):
2379         * bindings/NP_runtime.h:
2380         * bindings/make_testbindings:
2381         * bindings/runtime.cpp:
2382         (Instance::createBindingForLanguageInstance):
2383
2384 2004-03-10  Richard Williamson   <rjw@apple.com>
2385
2386         Updated header to include proposed changes from
2387         plugin-futures list.  Calls from plugin to JavaScript
2388         are now asynchronous.
2389
2390         Reviewed by Chris.
2391
2392         * bindings/NP_runtime.h:
2393
2394 === Safari-131 ===
2395
2396 2004-03-04  Richard Williamson   <rjw@apple.com>
2397
2398         Implementation of NP_JavaScriptObject.  This is the 'C' class
2399         that wraps a JavaScript object.
2400
2401         Reviewed by Chris.
2402
2403         * JavaScriptCore.pbproj/project.pbxproj:
2404         * bindings/NP_jsobject.cpp: Added.
2405         (coerceValueToNPValueType):
2406         (convertValueToNPValueType):
2407         (convertNPValueTypeToValue):
2408         (listFromNPArray):
2409         (jsAllocate):
2410         (jsDeallocate):
2411         (identiferFromNPIdentifier):
2412         (NP_Call):
2413         (NP_Evaluate):
2414         (NP_GetProperty):
2415         (NP_SetProperty):
2416         (NP_RemoveProperty):
2417         (NP_ToString):
2418         (NP_GetPropertyAtIndex):
2419         (NP_SetPropertyAtIndex):
2420         * bindings/NP_runtime.cpp:
2421         (NP_ObjectAtIndex):
2422         * bindings/NP_runtime.h:
2423         * bindings/runtime_object.h:
2424
2425 2004-03-04  Richard Williamson   <rjw@apple.com>
2426
2427         Added NP_Array implementation.  
2428
2429         Changed NP_Boolean to just depend on two static instances, no
2430         space is required for values.
2431
2432         Reviewed by Chris.
2433
2434         * bindings/NP_runtime.cpp:
2435         (NP_CreateBoolean):
2436         (NP_BoolFromBoolean):
2437         (arrayAllocate):
2438         (arrayDeallocate):
2439         (NP_CreateArray):
2440         (NP_CreateArrayV):
2441         (NP_ObjectAtIndex):
2442         * bindings/NP_runtime.h:
2443
2444 2004-03-03  Darin Adler  <darin@apple.com>
2445
2446         Reviewed by Vicki.
2447
2448         * English.lproj/InfoPlist.strings: Removed. No need to localize the version and
2449         copyright string, and that's all that was in here.
2450         * JavaScriptCore.pbproj/project.pbxproj: Removed InfoPlist.strings from build.
2451
2452 2004-03-03  Richard Williamson   <rjw@apple.com>
2453
2454         More 'C' binding implementation.  Fleshed out all the
2455         'primitive' data types.
2456
2457         Reviewed by Chris.
2458
2459         * bindings/NP_runtime.cpp:
2460         (NP_ReleaseObject):
2461         (numberAllocate):
2462         (stringAllocate):
2463         (stringDeallocate):
2464         (NP_CreateStringWithUTF8):
2465         (NP_CreateStringWithUTF16):
2466         (NP_UTF8FromString):
2467         (NP_UTF16FromString):
2468         (NP_StringLength):
2469         (booleanAllocate):
2470         (booleanDeallocate):
2471         (NP_CreateBoolean):
2472         (NP_BoolFromBoolean):
2473         (nullAllocate):
2474         (nullDeallocate):
2475         (NP_GetNull):
2476         (undefinedAllocate):
2477         (undefinedDeallocate):
2478         (NP_GetUndefined):
2479         * bindings/NP_runtime.h:
2480
2481 2004-03-03  Richard Williamson   <rjw@apple.com>
2482
2483         More 'C' binding implementation.
2484
2485         Reviewed by Chris.
2486
2487         * bindings/NP_runtime.cpp:
2488         (identifierEqual):
2489         (identifierHash):
2490         (getIdentifierDictionary):
2491         (NP_IdentifierFromUTF8):
2492         (NP_UTF8FromIdentifier):
2493         (NP_CreateObject):
2494         (NP_ReleaseObject):
2495         (NP_IsKindOfClass):
2496         (numberCreate):
2497         (NP_CreateNumberWithInt):
2498         (NP_CreateNumberWithFloat):
2499         (NP_CreateNumberWithDouble):
2500         (NP_IntFromNumber):
2501         (NP_FloatFromNumber):
2502         (NP_DoubleFromNumber):
2503         * bindings/NP_runtime.h:
2504
2505 2004-03-02  Richard Williamson   <rjw@apple.com>
2506
2507         Removed retain/release from NP_Class.  Classes will not be allowed to implement their
2508         own customer retain/release scheme.
2509
2510         Reviewed by Chris.
2511
2512         * bindings/NP_runtime.cpp:
2513         (NP_RetainObject):
2514         (NP_ReleaseObject):
2515         * bindings/NP_runtime.h:
2516
2517 2004-03-02  Richard Williamson   <rjw@apple.com>
2518
2519         C binding API.  Partial implementation.
2520
2521         Completed ObjectiveC bindings (not based on the C API).  These will re-implemented over the C binding API, but I wanted to get this code in the tree.
2522
2523         Factored root object reference counting scheme.  It is now useful independent
2524         of LiveConnect.
2525
2526         Reviewed by Chris.
2527
2528         * JavaScriptCore.pbproj/project.pbxproj:
2529         * bindings/NP_runtime.cpp: Added.
2530         (NP_IdentifierFromUTF8):
2531         (NP_GetIdentifiers):
2532         (NP_UTF8FromIdentifier):
2533         (NP_CreateObject):
2534         (NP_RetainObject):
2535         (NP_ReleaseObject):
2536         (NP_IsKindOfClass):
2537         (NP_SetException):
2538         (NP_Call):
2539         (NP_Evaluate):
2540         (NP_GetProperty):
2541         (NP_SetProperty):
2542         (NP_RemoveProperty):
2543         (NP_ToString):
2544         (NP_GetPropertyAtIndex):
2545         (NP_SetPropertyAtIndex):
2546         (NP_CreateNumberWithInt):
2547         (NP_CreateNumberWithFloat):
2548         (NP_CreateNumberWithDouble):
2549         (NP_IntFromNumber):
2550         (NP_FloatFromNumber):
2551         (NP_DoubleFromNumber):
2552         (NP_CreateStringWithUTF8):
2553         (NP_CreateStringWithUTF16):
2554         (NP_UTF8FromString):
2555         (NP_UTF16FromString):
2556         (NP_CreateBoolean):
2557         (NP_BoolFromBoolean):
2558         (NP_GetNull):
2559         (NP_GetUndefined):
2560         (NP_CreateArray):
2561         (NP_CreateArrayV):
2562         (NP_ObjectAtIndex):
2563         * bindings/NP_runtime.h: Added.
2564         * bindings/jni/jni_jsobject.cpp:
2565         (JSObject::invoke):
2566         (JSObject::finalize):
2567         (JSObject::createNative):
2568         (JSObject::convertValueToJObject):
2569         * bindings/jni/jni_jsobject.h:
2570         * bindings/objc/objc_jsobject.h:
2571         * bindings/objc/objc_jsobject.mm:
2572         (rootForView):
2573         (windowJavaScriptObject):
2574         (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
2575         (-[JavaScriptObject dealloc]):
2576         (-[JavaScriptObject _convertValueToObjcValue:KJS::]):
2577         (-[JavaScriptObject call:arguments:]):
2578         (-[JavaScriptObject evaluate:]):
2579         (-[JavaScriptObject getMember:]):
2580         (-[JavaScriptObject setMember:value:]):
2581         (-[JavaScriptObject removeMember:]):
2582         (-[JavaScriptObject toString]):
2583         (-[JavaScriptObject getSlot:]):
2584         (-[JavaScriptObject setSlot:value:]):
2585         * bindings/objc/objc_utility.h:
2586         * bindings/objc/objc_utility.mm:
2587         (KJS::Bindings::convertValueToObjcValue):
2588         * bindings/runtime_root.cpp: Added.
2589         (getReferencesByRootDictionary):
2590         (getReferencesDictionary):
2591         (KJS::Bindings::findReferenceDictionary):
2592         (KJS::Bindings::rootForImp):
2593         (KJS::Bindings::addNativeReference):
2594         (KJS::Bindings::removeNativeReference):
2595         (completedJavaScriptAccess):
2596         (initializeJavaScriptAccessLock):
2597         (lockJavaScriptAccess):
2598         (unlockJavaScriptAccess):
2599         (RootObject::dispatchToJavaScriptThread):
2600         (performJavaScriptAccess):
2601         (RootObject::setFindRootObjectForNativeHandleFunction):
2602         (RootObject::removeAllNativeReferences):
2603         * bindings/runtime_root.h: Added.
2604         (KJS::Bindings::RootObject::RootObject):
2605         (KJS::Bindings::RootObject::~RootObject):
2606         (KJS::Bindings::RootObject::setRootObjectImp):
2607         (KJS::Bindings::RootObject::rootObjectImp):
2608         (KJS::Bindings::RootObject::setInterpreter):
2609         (KJS::Bindings::RootObject::interpreter):
2610         (KJS::Bindings::RootObject::findRootObjectForNativeHandleFunction):
2611         (KJS::Bindings::RootObject::runLoop):
2612         (KJS::Bindings::RootObject::performJavaScriptSource):
2613
2614 === Safari-130 ===
2615
2616 === Safari-129 ===
2617
2618 2004-02-18  Richard Williamson   <rjw@apple.com>
2619
2620         Added NSNumber/Number conversion.
2621
2622         Removed some unnecessary KJS:: namespace specifiers.
2623
2624         Reviewed by Ken.
2625
2626         * bindings/objc/objc_utility.mm:
2627         (KJS::Bindings::convertValueToObjcValue):
2628         (KJS::Bindings::convertObjcValueToValue):
2629         * bindings/runtime_array.h:
2630
2631 2004-02-18  Richard Williamson   <rjw@apple.com>
2632
2633         Added support for export NSArrays.
2634
2635         Updated valueAt() to take an ExecState so we can throw
2636         JS exceptions.
2637
2638         Implemented excludeSelectorFromJavaScript: in ObjcClass.  This allows
2639         ObjectiveC classes to control the visibility of their methods in 
2640         JavaScript.
2641
2642         Reviewed by Ken.
2643
2644         * bindings/jni/jni_runtime.cpp:
2645         (JavaField::valueFromInstance):
2646         (JavaArray::valueAt):
2647         * bindings/jni/jni_runtime.h:
2648         * bindings/objc/objc_class.mm:
2649         (ObjcClass::methodsNamed):
2650         * bindings/objc/objc_runtime.h:
2651         (KJS::Bindings::ObjcArray::getObjcArray):
2652         * bindings/objc/objc_runtime.mm:
2653         (ObjcField::valueFromInstance):
2654         (ObjcField::setValueToInstance):
2655         (ObjcArray::ObjcArray):
2656         (ObjcArray::~ObjcArray):
2657         (ObjcArray::operator=):
2658         (ObjcArray::setValueAt):
2659         (ObjcArray::valueAt):
2660         (ObjcArray::getLength):
2661         * bindings/objc/objc_utility.mm:
2662         (KJS::Bindings::convertValueToObjcValue):
2663         (KJS::Bindings::convertObjcValueToValue):
2664         * bindings/runtime.cpp:
2665         (Instance::getValueOfField):
2666         * bindings/runtime.h:
2667         * bindings/runtime_array.cpp:
2668         (RuntimeArrayImp::get):
2669         * bindings/runtime_object.cpp:
2670         (RuntimeObjectImp::get):
2671
2672 2004-02-17  Richard Williamson   <rjw@apple.com>
2673
2674         Added String <-> NSString conversion.
2675         Added tests of String <-> NSString conversion to test program.
2676
2677         Reviewed by Chris.
2678
2679         * bindings/objc/objc_utility.mm:
2680         (KJS::Bindings::convertValueToObjcValue):
2681         (KJS::Bindings::convertObjcValueToValue):
2682         * bindings/test.js:
2683         * bindings/testbindings.mm:
2684         (-[MyFirstInterface getString]):
2685
2686 2004-02-15  Darin Adler  <darin@apple.com>
2687
2688         Reviewed by Dave.
2689
2690         * JavaScriptCore.pbproj/project.pbxproj: Tweak build styles a bit, fixing OptimizedWithSymbols,
2691         and removing redundant settings of things that match defaults in other build styles.
2692
2693 2004-02-13  Richard Williamson   <rjw@apple.com>
2694
2695         Work towards the JavaScript ObjC bindings.  The bindings now work for 
2696         simple scalar types.  testbindings.mm is an illustration of how the 
2697         bindings work.
2698
2699         Reviewed by Ken.
2700
2701         * JavaScriptCore.pbproj/project.pbxproj:
2702         * Makefile.am:
2703         * bindings/jni/jni_class.cpp:
2704         (JavaClass::methodsNamed):
2705         * bindings/jni/jni_class.h:
2706         * bindings/jni/jni_instance.cpp:
2707         (JavaInstance::invokeMethod):
2708         * bindings/jni/jni_instance.h:
2709         * bindings/jni/jni_runtime.h:
2710         (KJS::Bindings::JavaMethod::returnType):
2711         * bindings/make_testbindings: Added.
2712         * bindings/objc/objc_class.h: Added.
2713         (KJS::Bindings::ObjcClass::~ObjcClass):
2714         (KJS::Bindings::ObjcClass::ObjcClass):
2715         (KJS::Bindings::ObjcClass::operator=):
2716         (KJS::Bindings::ObjcClass::constructorAt):
2717         (KJS::Bindings::ObjcClass::numConstructors):
2718         * bindings/objc/objc_class.mm: Added.
2719         (ObjcClass::_commonDelete):
2720         (ObjcClass::_commonCopy):
2721         (ObjcClass::_commonInit):
2722         (_createClassesByIsAIfNecessary):
2723         (ObjcClass::classForIsA):
2724         (ObjcClass::ObjcClass):
2725         (ObjcClass::name):
2726         (ObjcClass::methodsNamed):
2727         (ObjcClass::fieldNamed):
2728         * bindings/objc/objc_header.h: Added.
2729         * bindings/objc/objc_instance.h: Added.
2730         (KJS::Bindings::ObjcInstance::getObject):
2731         * bindings/objc/objc_instance.mm: Added.
2732         (ObjcInstance::ObjcInstance):
2733         (ObjcInstance::~ObjcInstance):
2734         (ObjcInstance::operator=):
2735         (ObjcInstance::begin):
2736         (ObjcInstance::end):
2737         (ObjcInstance::getClass):
2738         (ObjcInstance::invokeMethod):
2739         (ObjcInstance::defaultValue):
2740         (ObjcInstance::stringValue):
2741         (ObjcInstance::numberValue):
2742         (ObjcInstance::booleanValue):
2743         (ObjcInstance::valueOf):
2744         * bindings/objc/objc_jsobject.h: Added.
2745         * bindings/objc/objc_jsobject.mm: Added.
2746         * bindings/objc/objc_runtime.h:
2747         (KJS::Bindings::ObjcField::~ObjcField):
2748         (KJS::Bindings::ObjcField::ObjcField):
2749         (KJS::Bindings::ObjcField::operator=):
2750         (KJS::Bindings::ObjcMethod::ObjcMethod):
2751         (KJS::Bindings::ObjcMethod::~ObjcMethod):
2752         (KJS::Bindings::ObjcMethod::operator=):
2753         * bindings/objc/objc_runtime.mm: Added.
2754         (ObjcMethod::ObjcMethod):
2755         (ObjcMethod::name):
2756         (ObjcMethod::numParameters):
2757         (ObjcMethod::getMethodSignature):
2758         (ObjcField::ObjcField):
2759         (ObjcField::name):
2760         (ObjcField::type):
2761         (ObjcField::valueFromInstance):
2762         (ObjcField::setValueToInstance):
2763         * bindings/objc/objc_utility.h: Added.
2764         (KJS::Bindings::):
2765         * bindings/objc/objc_utility.mm: Added.
2766         (KJS::Bindings::JSMethodNameToObjCMethodName):
2767         (KJS::Bindings::convertValueToObjcValue):
2768         (KJS::Bindings::convertObjcValueToValue):
2769         (KJS::Bindings::objcValueTypeForType):
2770         * bindings/runtime.cpp:
2771         (MethodList::MethodList):
2772         (MethodList::operator=):
2773         (Instance::setValueOfField):
2774         (Instance::createBindingForLanguageInstance):
2775         (Instance::createRuntimeObject):
2776         * bindings/runtime.h:
2777         * bindings/runtime_method.cpp:
2778         (RuntimeMethodImp::RuntimeMethodImp):
2779         (RuntimeMethodImp::get):
2780         (RuntimeMethodImp::call):
2781         * bindings/runtime_method.h:
2782         * bindings/runtime_object.cpp:
2783         (RuntimeObjectImp::get):
2784         (RuntimeObjectImp::hasProperty):
2785         * bindings/test.js: Added.
2786         * bindings/testbindings.mm: Added.
2787         (-[MySecondInterface init]):
2788         (-[MyFirstInterface init]):
2789         (-[MyFirstInterface dealloc]):
2790         (+[MyFirstInterface JavaScriptNameForSelector:]):
2791         (-[MyFirstInterface getInt]):
2792         (-[MyFirstInterface setInt:]):
2793         (-[MyFirstInterface getMySecondInterface]):
2794         (-[MyFirstInterface logMessage:]):
2795         (GlobalImp::className):
2796         (readJavaScriptFromFile):
2797         (main):
2798
2799 === Safari-128 ===
2800
2801 2004-02-08  Darin Adler  <darin@apple.com>
2802
2803         Reviewed by Dave.
2804
2805         - fixed things seen in the profile, for a total speedup of 4% on cvs-base (including changes across all projects)
2806
2807         * JavaScriptCorePrefix.h: Add a workaround for a bug in our system headers that prevents the <ctype.h>
2808         macros from working right in C++ code that uses the <cctype> header.
2809
2810         * kjs/ustring.cpp:
2811         (KJS::inlineUTF8SequenceLengthNonASCII): Added.
2812         (KJS::UTF8SequenceLengthNonASCII): Added.
2813         (KJS::inlineUTF8SequenceLength): Added.
2814         (KJS::UTF8SequenceLength): Calls inlineUTF8SequenceLengthNonASCII now.
2815         (KJS::decodeUTF8Sequence): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
2816         (KJS::createSortedOffsetsArray): Add special case for 1, 2, and 3 offsets, so we don't do qsort for those.
2817         (KJS::convertUTF16OffsetsToUTF8Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
2818         (KJS::convertUTF8OffsetsToUTF16Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
2819
2820         - fixed the test program so it won't hit the interpreter lock assertion
2821
2822         * kjs/testkjs.cpp: (main): Just lock around the whole thing, since the test is singly threaded.
2823
2824 === Safari-127 ===
2825
2826 2004-02-06  Richard Williamson   <rjw@apple.com>
2827
2828         Fixed 3550242 and 3546977.  The first diff prevents an assert from firing.  The second diff prevents a JavaScript exception, caused be an invalid conversion, which has a downstream consequence of preventing a valid conversion.
2829
2830         Reviewed by John.
2831
2832         * bindings/jni/jni_jsobject.cpp:
2833         (JSObject::toString):
2834         * bindings/jni/jni_utility.cpp:
2835         (KJS::Bindings::convertValueToJValue):
2836
2837 2004-02-02  Darin Adler  <darin@apple.com>
2838
2839         Reviewed by Maciej.
2840
2841         - fixed <rdar://problem/3546613>: array of negative size leads to crash (test page at oscar.the-rileys.net)
2842
2843         * kjs/array_object.cpp:
2844         (ArrayInstanceImp::ArrayInstanceImp): If the length is greater than 10,000, don't allocate an array until
2845         we start putting values in. This prevents new Array(2147483647) from causing trouble.
2846         (ArrayObjectImp::construct): Check number as described in specification, and raise a range error if the
2847         number is out of range. This prevents new Array(-1) from causing trouble.
2848
2849         - fixed <rdar://problem/3545756>: Math.round screws up on numbers bigger than 2^31 (incorrect results on HP-35 calculator page)
2850
2851         * kjs/math_object.cpp: (MathFuncImp::call): Change implementation to be much simpler and not involve
2852         casting to int. Results now match those in other browsers.
2853
2854 2004-02-02  Darin Adler  <darin@apple.com>
2855
2856         Reviewed by Maciej.
2857
2858         - fixed <rdar://problem/3519285>: integer operations on large negative numbers yield bad results (discovered with "HTMLCrypt")
2859         - fixed other related overflow issues
2860
2861         * kjs/value.h: Changed return types of toInteger, toInt32, toUInt32, and toUInt16.
2862         * kjs/value.cpp:
2863         (ValueImp::toInteger): Change to return a double, since this operation, from the ECMA specification,
2864         must not restrict values to the range of a particular integer type.
2865         (ValueImp::toInt32): Used a sized integer type for the result of this function, and also added
2866         proper handling for negative results from fmod.
2867         (ValueImp::toUInt32): Ditto.
2868         (ValueImp::toUInt16): Ditto.
2869         (ValueImp::dispatchToUInt32): Changed result type from unsigned to uint32_t.
2870
2871         * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Use a double instead of an int to handle
2872         out-of-integer-range values better in the slice function.
2873         * kjs/internal.cpp: (KJS::roundValue): Streamline the function, handling NAN and infinity properly.
2874         * kjs/number_object.cpp: (NumberProtoFuncImp::call): Use a double instead of an int to handle
2875         out-of-integer-range values better in the toString function.
2876         * kjs/string_object.cpp: (StringProtoFuncImp::call): Use a double instead of an int to handle
2877         out-of-integer-range values better in the charAt, charCodeAt, indexOf, lastIndexOf, slice,
2878         and substr functions.
2879
2880 === Safari-126 ===
2881
2882 2004-01-30  Richard Williamson   <rjw@apple.com>
2883
2884         Fixed 3542044.  Create KJS::String using UString constructor instead of passing UTF8 string to char* constructor.
2885
2886         Reviewed by Darin.
2887
2888         * bindings/jni/jni_instance.cpp:
2889         (JavaInstance::stringValue):
2890
2891 2004-01-26  Darin Adler  <darin@apple.com>
2892
2893         * Makefile.am: Switch from pbxbuild to xcodebuild.
2894
2895 2004-01-22  Richard Williamson   <rjw@apple.com>
2896
2897         Added stubs for ObjC language binding to JavaScript.
2898
2899         * JavaScriptCore.pbproj/project.pbxproj:
2900         * bindings/jni/jni_runtime.h:
2901         * bindings/objc/objc_runtime.h: Added.
2902         (KJS::Bindings::ObjcParameter::ObjcParameter):
2903         (KJS::Bindings::ObjcParameter::~ObjcParameter):
2904         (KJS::Bindings::ObjcParameter::operator=):
2905         (KJS::Bindings::ObjcParameter::type):
2906         (KJS::Bindings::ObjcConstructor::ObjcConstructor):
2907         (KJS::Bindings::ObjcConstructor::~ObjcConstructor):
2908         (KJS::Bindings::ObjcConstructor::_commonCopy):
2909         (KJS::Bindings::ObjcConstructor::operator=):
2910         (KJS::Bindings::ObjcConstructor::value):
2911         (KJS::Bindings::ObjcConstructor::parameterAt):
2912         (KJS::Bindings::ObjcConstructor::numParameters):
2913         (KJS::Bindings::ObjcField::ObjcField):
2914         (KJS::Bindings::ObjcField::~ObjcField):
2915         * bindings/runtime.h:
2916
2917 2004-01-22  Richard Williamson   <rjw@apple.com>
2918
2919         Simplified JavaString by using UString as backing store.  This
2920         revealed a bug in CString's assignment operator which I fixed.
2921
2922         Removed some dead code.
2923  
2924         Reviewed by John.
2925
2926         * bindings/jni/jni_runtime.h:
2927         (KJS::Bindings::JavaString::JavaString):
2928         (KJS::Bindings::JavaString::_commonInit):
2929         (KJS::Bindings::JavaString::UTF8String):
2930         (KJS::Bindings::JavaString::uchars):
2931         (KJS::Bindings::JavaString::length):
2932         (KJS::Bindings::JavaString::ustring):
2933         * bindings/runtime_object.cpp:
2934         (RuntimeObjectImp::RuntimeObjectImp):
2935         * bindings/runtime_object.h:
2936         * kjs/ustring.cpp:
2937         (KJS::CString::CString):
2938         (KJS::CString::operator=):
2939
2940 === Safari-125 ===
2941
2942 === Safari-124 ===
2943
2944 2004-01-16  Richard Williamson   <rjw@apple.com>
2945
2946         Fixed 3525853.  We weren't handling mapping to overloaded Java
2947         methods very well.  Even though this is undefined the other
2948         browsers support it.  Also fixed a bug with returning arrays
2949         from Java functions.
2950
2951         Reviewed by John.
2952
2953         * bindings/jni/jni_class.cpp:
2954         (JavaClass::_commonInit):
2955         (JavaClass::methodsNamed):
2956         * bindings/jni/jni_class.h:
2957         * bindings/jni/jni_instance.cpp:
2958         (JavaInstance::invokeMethod):
2959         * bindings/jni/jni_instance.h:
2960         * bindings/jni/jni_runtime.cpp:
2961         (JavaArray::convertJObjectToArray):
2962         (JavaField::valueFromInstance):
2963         (JavaMethod::signature):
2964         (JavaArray::valueAt):
2965         * bindings/jni/jni_runtime.h:
2966         * bindings/jni_jsobject.cpp:
2967         (JSObject::call):
2968         (JSObject::convertJObjectToValue):
2969         * bindings/runtime.cpp:
2970         (MethodList::addMethod):
2971         (MethodList::length):
2972         (MethodList::methodAt):
2973         (MethodList::~MethodList):
2974         * bindings/runtime.h:
2975         (KJS::Bindings::MethodList::MethodList):
2976         * bindings/runtime_method.cpp:
2977         (RuntimeMethodImp::RuntimeMethodImp):
2978         (RuntimeMethodImp::get):
2979         (RuntimeMethodImp::call):
2980         * bindings/runtime_method.h:
2981         * bindings/runtime_object.cpp:
2982         (RuntimeObjectImp::get):
2983         (RuntimeObjectImp::hasProperty):
2984
2985 2004-01-16  Richard Williamson   <rjw@apple.com>
2986
2987         Fixed 3531229.  Another place that needs the  Push/PopLocalFrame
2988         protection implemented for 3530401.
2989
2990         Reviewed by John.
2991
2992         * bindings/runtime_method.cpp:
2993         (RuntimeMethodImp::call):
2994
2995 2004-01-15  Richard Williamson   <rjw@apple.com>
2996
2997         Fixed 3530401.  JNI doesn't cleanup local refs created on the
2998         main thread.   IMO this is a bad bug in our JMI implementation.
2999
3000         To work-around the problem I explicitly delete all local refs.
3001         Further, I've added Push/PopLocalFrame calls to catch any refs
3002         that I may have missed.  This will guarantee that we don't leak
3003         any Java references.
3004
3005         Reviewed by John.
3006
3007         * bindings/jni/jni_class.cpp:
3008         (JavaClass::_commonInit):
3009         (JavaClass::JavaClass):
3010         * bindings/jni/jni_instance.cpp:
3011         (JavaInstance::begin):
3012         (JavaInstance::end):
3013         * bindings/jni/jni_instance.h:
3014         * bindings/jni/jni_runtime.cpp:
3015         (JavaConstructor::JavaConstructor):
3016         (JavaMethod::JavaMethod):
3017         * bindings/jni_jsobject.cpp:
3018         (JSObject::listFromJArray):
3019         * bindings/runtime.h:
3020         (KJS::Bindings::Instance::begin):
3021         (KJS::Bindings::Instance::end):
3022         * bindings/runtime_object.cpp:
3023         (RuntimeObjectImp::get):
3024         (RuntimeObjectImp::put):
3025         (RuntimeObjectImp::canPut):
3026         (RuntimeObjectImp::hasProperty):
3027         (RuntimeObjectImp::defaultValue):
3028
3029 2004-01-15  Vicki Murley  <vicki@apple.com>
3030
3031         Reviewed by Darin.
3032
3033         * JavaScriptCore.pbproj/project.pbxproj: Update copyright date to 2004.
3034
3035 2004-01-14  Richard Williamson   <rjw@apple.com>
3036         
3037         Fixed 3529466.  With recent changes to Java plugin we must no
3038         longer call DeleteLocalRef().  Not a problem, it was an optimization anyway.
3039
3040         Reviewed by John.
3041
3042         * bindings/jni/jni_instance.cpp:
3043         (JObjectWrapper::JObjectWrapper):
3044
3045 === Safari-122 ===
3046
3047 2004-01-14  Richard Williamson   <rjw@apple.com>
3048
3049         Fixed 3529010.
3050
3051         Finalize may be called on an JSObject after we've already remove all our references.  The assert in this case is firing because we've received a finalize call from Java for an instance that we no longer know about.  The fix is to check in finalize that we're getting a call on an instance that we still care about.
3052
3053         Reviewed by John.
3054
3055         * bindings/jni_jsobject.cpp:
3056         (addJavaReference):
3057         (removeJavaReference):
3058         (RootObject::removeAllJavaReferencesForRoot):
3059         (JSObject::invoke):
3060
3061 2004-01-13  Richard Williamson   <rjw@apple.com>
3062
3063         Fixed 3528324. 
3064
3065         The run loop that is used to execute JavaScript (in practice, always the main run loop) is held in a class variable.  It is set and retained once and should not be released.  Unfortunately is it being released when the 'root' object on a LiveConnect applet is released.  This has the symptom of eventually causing an deallocation of the main run loop!  Usually after about 5 instantiations/destructions of a LiveConnect applet.  The CFRelease of the run loop was removed.
3066
3067         Reviewed by Hyatt.
3068
3069         * bindings/jni_jsobject.h:
3070         (KJS::Bindings::RootObject::~RootObject):
3071
3072 === Safari-121 ===
3073
3074 === Safari-120 ===
3075
3076 2004-01-06  Richard Williamson   <rjw@apple.com>
3077
3078         Fixed 3521814.  Finalize messages weren't being dispatched!
3079
3080         Reviewed by John.
3081
3082         * bindings/jni_jsobject.cpp:
3083         (JSObject::invoke):
3084
3085 2004-01-05  Richard Williamson   <rjw@apple.com>
3086
3087         Added cache of JNI method IDs to minimize allocations.  This mitigates the problem
3088         described by 3515579.
3089
3090         Also cleanup up logging of Java exceptions.
3091
3092         Reviewed by John.
3093
3094         * bindings/jni/jni_class.cpp:
3095         (JavaClass::classForInstance):
3096         * bindings/jni/jni_instance.cpp:
3097         (JavaInstance::JavaInstance):
3098         (JavaInstance::getClass):
3099         (JavaInstance::invokeMethod):
3100         (JObjectWrapper::JObjectWrapper):
3101         (JObjectWrapper::~JObjectWrapper):
3102         * bindings/jni/jni_instance.h:
3103         (KJS::Bindings::JavaInstance::operator=):
3104         * bindings/jni/jni_runtime.cpp:
3105         (JavaMethod::JavaMethod):
3106         (JavaMethod::methodID):
3107         * bindings/jni/jni_runtime.h:
3108         (KJS::Bindings::JavaMethod::JavaMethod):
3109         * bindings/jni/jni_utility.cpp:
3110         (callJNIMethod):
3111         (callJNIMethodIDA):
3112         (callJNIMethodA):
3113         (KJS::Bindings::getMethodID):
3114         (KJS::Bindings::callJNIVoidMethodIDA):
3115         (KJS::Bindings::callJNIObjectMethodIDA):
3116         (KJS::Bindings::callJNIByteMethodIDA):
3117         (KJS::Bindings::callJNICharMethodIDA):
3118         (KJS::Bindings::callJNIShortMethodIDA):
3119         (KJS::Bindings::callJNIIntMethodIDA):
3120         (KJS::Bindings::callJNILongMethodIDA):
3121         (KJS::Bindings::callJNIFloatMethodIDA):
3122         (KJS::Bindings::callJNIDoubleMethodIDA):
3123         (KJS::Bindings::callJNIBooleanMethodIDA):
3124         (KJS::Bindings::getCharactersFromJStringInEnv):
3125         (KJS::Bindings::getUCharactersFromJStringInEnv):
3126         (KJS::Bindings::getJNIField):
3127         * bindings/jni/jni_utility.h:
3128
3129 l2003-12-23  John Sullivan  <sullivan@apple.com>
3130
3131         * JavaScriptCore.pbproj/project.pbxproj:
3132         Xcode version wars, harmless
3133
3134 2003-12-23  Darin Adler  <darin@apple.com>
3135
3136         Reviewed by John (concept, not code, which is just the old code coming back).
3137
3138         - fixed 3518092: REGRESSION (100-119): getting NaN instead of HH:MM times
3139
3140         * kjs/date_object.cpp: Added back our CF-based implementations of gmtime, localtime,
3141         mktime, timegm, and time, because mktime, at least, won't handle a year of 0.
3142
3143 2003-12-19  Richard Williamson   <rjw@apple.com>
3144
3145         Fixed 3515597.  When an error occurs we need
3146         to make sure result values are zeroed.
3147
3148         Cleaned up logs by adding a newline.
3149
3150         Reviewed by John.
3151
3152         * bindings/jni/jni_utility.cpp:
3153         (KJS::Bindings::getJavaVM):
3154         (KJS::Bindings::getJNIEnv):
3155         (callJNIMethod):
3156         (callJNIMethodA):
3157         (KJS::Bindings::getJNIField):
3158         * bindings/jni_jsobject.cpp:
3159         (JSObject::convertValueToJObject):
3160
3161 === Safari-119 ===
3162
3163 2003-12-17  Richard Williamson   <rjw@apple.com>
3164
3165         Ensure that all the symbols we export are in the KJS
3166         namespace (3512245).
3167
3168         Also renamed JavaString.characters() to JavaString.UTF8String()
3169         for enhanced clarity.
3170
3171         Added some sanity checking to constructor of JObjectWrapper.
3172
3173         Reviewed by Dave.
3174
3175         * ChangeLog:
3176         * bindings/jni/jni_class.cpp:
3177         * bindings/jni/jni_class.h:
3178         * bindings/jni/jni_instance.cpp:
3179         (JavaInstance::invokeMethod):
3180         (JObjectWrapper::JObjectWrapper):
3181         * bindings/jni/jni_instance.h:
3182         * bindings/jni/jni_runtime.cpp:
3183         (JavaParameter::JavaParameter):
3184         (JavaField::JavaField):
3185         (JavaMethod::JavaMethod):
3186         (JavaMethod::signature):
3187         * bindings/jni/jni_runtime.h:
3188         (KJS::Bindings::JavaString::ascii):
3189         (KJS::Bindings::JavaString::UTF8String):
3190         (KJS::Bindings::JavaString::JavaString):
3191         (KJS::Bindings::JavaString::_commonInit):
3192         (KJS::Bindings::JavaString::uchars):
3193         (KJS::Bindings::JavaString::length):
3194         (KJS::Bindings::JavaString::ustring):
3195         (KJS::Bindings::JavaParameter::type):
3196         (KJS::Bindings::JavaField::name):
3197         (KJS::Bindings::JavaField::type):
3198         (KJS::Bindings::JavaMethod::name):
3199         (KJS::Bindings::JavaMethod::returnType):
3200         * bindings/jni/jni_utility.cpp:
3201         (KJS::Bindings::getJavaVM):
3202         (KJS::Bindings::getJNIEnv):
3203         (KJS::Bindings::callJNIVoidMethod):
3204         (KJS::Bindings::callJNIObjectMethod):
3205         (KJS::Bindings::callJNIBooleanMethod):
3206         (KJS::Bindings::callJNIByteMethod):
3207         (KJS::Bindings::callJNICharMethod):
3208         (KJS::Bindings::callJNIShortMethod):
3209         (KJS::Bindings::callJNIIntMethod):
3210         (KJS::Bindings::callJNILongMethod):
3211         (KJS::Bindings::callJNIFloatMethod):
3212         (KJS::Bindings::callJNIDoubleMethod):
3213         (KJS::Bindings::callJNIVoidMethodA):
3214         (KJS::Bindings::callJNIObjectMethodA):
3215         (KJS::Bindings::callJNIByteMethodA):
3216         (KJS::Bindings::callJNICharMethodA):
3217         (KJS::Bindings::callJNIShortMethodA):
3218         (KJS::Bindings::callJNIIntMethodA):
3219         (KJS::Bindings::callJNILongMethodA):
3220         (KJS::Bindings::callJNIFloatMethodA):
3221         (KJS::Bindings::callJNIDoubleMethodA):
3222         (KJS::Bindings::callJNIBooleanMethodA):
3223         (KJS::Bindings::getCharactersFromJString):
3224         (KJS::Bindings::releaseCharactersForJString):
3225         (KJS::Bindings::getCharactersFromJStringInEnv):
3226         (KJS::Bindings::releaseCharactersForJStringInEnv):
3227         (KJS::Bindings::getUCharactersFromJStringInEnv):
3228         (KJS::Bindings::releaseUCharactersForJStringInEnv):
3229         (KJS::Bindings::JNITypeFromClassName):
3230         (KJS::Bindings::signatureFromPrimitiveType):
3231         (KJS::Bindings::JNITypeFromPrimitiveType):
3232         (KJS::Bindings::getJNIField):
3233         (KJS::Bindings::convertValueToJValue):
3234         * bindings/jni/jni_utility.h:
3235         * bindings/jni_jsobject.cpp:
3236         (KJS::Bindings::JSObject::invoke):
3237         (KJS::Bindings::JSObject::JSObject):
3238         (KJS::Bindings::JSObject::call):
3239         (KJS::Bindings::JSObject::eval):
3240         (KJS::Bindings::JSObject::getMember):
3241         (KJS::Bindings::JSObject::setMember):
3242         (KJS::Bindings::JSObject::removeMember):
3243         (KJS::Bindings::JSObject::getSlot):
3244         (KJS::Bindings::JSObject::setSlot):
3245         (KJS::Bindings::JSObject::toString):
3246         (KJS::Bindings::JSObject::finalize):
3247         (KJS::Bindings::JSObject::createNative):
3248         (KJS::Bindings::JSObject::convertValueToJObject):
3249         (KJS::Bindings::JSObject::convertJObjectToValue):
3250         (KJS::Bindings::JSObject::listFromJArray):
3251         * bindings/jni_jsobject.h:
3252         * bindings/runtime.cpp:
3253         * bindings/runtime.h:
3254         * bindings/runtime_method.cpp:
3255         * bindings/runtime_method.h:
3256
3257 === Safari-118 ===
3258
3259 2003-12-16  Richard Williamson   <rjw@apple.com>
3260
3261         Ack!  More assertions.  Lock ALL entry points into the interpreter!
3262         (3511733).
3263
3264         Reviewed by Ken.
3265
3266         * bindings/jni_jsobject.cpp:
3267         (Bindings::JSObject::call):
3268         (Bindings::JSObject::eval):
3269         (Bindings::JSObject::getMember):
3270         (Bindings::JSObject::setMember):
3271         (Bindings::JSObject::removeMember):
3272         (Bindings::JSObject::getSlot):
3273         (Bindings::JSObject::setSlot):
3274         (Bindings::JSObject::convertJObjectToValue):
3275
3276 2003-12-15  Richard Williamson   <rjw@apple.com>
3277
3278         Fixed a couple of snafus and removed some logging.
3279
3280         Reviewed by Maciej.
3281
3282         * bindings/jni_jsobject.cpp:
3283         (Bindings::performJavaScriptAccess):
3284         (Bindings::completedJavaScriptAccess):
3285         (Bindings::dispatchToJavaScriptThread):
3286         Removed some annoying JS_LOG clutter.
3287
3288         (Bindings::RootObject::removeAllJavaReferencesForRoot):
3289         Fixed allocation of key buffer that was called after it was needed.
3290
3291         (Bindings::JSObject::invoke):
3292         (Bindings::JSObject::JSObject):
3293         (Bindings::JSObject::getMember):
3294         (Bindings::JSObject::getSlot):
3295         Added additional interpreter locks around getMember and getSlot. 
3296         These functions may cause allocation of JS impls.  
3297
3298 2003-12-15  Richard Williamson   <rjw@apple.com>
3299
3300         args weren't passed to 'call' invocation.  d'oh.
3301         lock interpreter when we create instances of JS impls.        
3302
3303         Reviewed by Maciej.
3304
3305         * bindings/jni_jsobject.cpp:
3306         (Bindings::JSObject::call):
3307         (Bindings::JSObject::eval):
3308         (Bindings::JSObject::getMember):
3309         (Bindings::JSObject::setMember):
3310         (Bindings::JSObject::getSlot):
3311         (Bindings::JSObject::convertValueToJObject):
3312         (Bindings::JSObject::convertJObjectToValue):
3313         (Bindings::JSObject::listFromJArray):
3314         * bindings/jni_jsobject.h:
3315
3316 2003-12-15  Richard Williamson   <rjw@apple.com>
3317
3318         Last piece of LiveConnect!  This checkin adds implementation
3319         of the Java to JavaScript object conversion functions.
3320
3321         Reviewed by John.
3322
3323         * bindings/jni/jni_instance.cpp:
3324         (JavaInstance::invokeMethod):
3325         * bindings/jni/jni_utility.cpp:
3326         * bindings/jni/jni_utility.h:
3327         * bindings/jni_jsobject.cpp:
3328         (Bindings::JSObject::invoke):
3329         (Bindings::JSObject::call):
3330         (Bindings::JSObject::eval):
3331         (Bindings::JSObject::getMember):
3332         (Bindings::JSObject::setMember):
3333         (Bindings::JSObject::getSlot):
3334         (Bindings::JSObject::setSlot):
3335         (Bindings::JSObject::createNative):
3336         (Bindings::JSObject::convertValueToJObject):
3337         (Bindings::JSObject::convertJObjectToValue):
3338         (Bindings::JSObject::listFromJArray):
3339         * bindings/jni_jsobject.h:
3340         (Bindings::):
3341         * bindings/runtime_method.cpp:
3342         (RuntimeMethodImp::get):
3343         (RuntimeMethodImp::codeType):
3344         (RuntimeMethodImp::execute):
3345
3346 2003-12-12  Richard Williamson   <rjw@apple.com>
3347
3348         Added implementation of stubs in JSObject.  All that
3349         remains is a couple of simple conversion functions stubs and
3350         we're done with LiveConnect.  Also, changed string passing to
3351         JS to use uchars instead of chars.  
3352
3353         Reviewed by Maciej.
3354
3355         * bindings/jni/jni_runtime.h:
3356         (Bindings::JavaString::JavaString):
3357         (Bindings::JavaString::_commonInit):
3358         (Bindings::JavaString::_commonCopy):
3359         (Bindings::JavaString::_commonDelete):
3360         (Bindings::JavaString::~JavaString):
3361         (Bindings::JavaString::operator=):
3362         (Bindings::JavaString::uchars):
3363         (Bindings::JavaString::length):
3364         (Bindings::JavaString::ustring):
3365         * bindings/jni/jni_utility.cpp:
3366         (getUCharactersFromJStringInEnv):
3367         (releaseUCharactersForJStringInEnv):
3368         (convertValueToJObject):
3369         (convertJObjectToValue):
3370         * bindings/jni/jni_utility.h:
3371         * bindings/jni_jsobject.cpp:
3372         (Bindings::JSObject::invoke):
3373         (Bindings::JSObject::call):
3374         (Bindings::JSObject::eval):
3375         (Bindings::JSObject::getMember):
3376         (Bindings::JSObject::setMember):
3377         (Bindings::JSObject::removeMember):
3378         (Bindings::JSObject::getSlot):
3379         (Bindings::JSObject::setSlot):
3380         * bindings/jni_jsobject.h:
3381
3382 2003-12-12  Richard Williamson   <rjw@apple.com>
3383
3384         Ensure that all calls from Java into JavaScript are
3385         performed on a designated thread (the main thread).
3386
3387         Reviewed by Ken.
3388
3389         * bindings/jni_jsobject.cpp:
3390         (isJavaScriptThread):
3391         (rootForImp):
3392         (Bindings::performJavaScriptAccess):
3393         (Bindings::completedJavaScriptAccess):
3394         (Bindings::initializeJavaScriptAccessLock):
3395         (Bindings::lockJavaScriptAccess):
3396         (Bindings::unlockJavaScriptAccess):
3397         (Bindings::dispatchToJavaScriptThread):
3398         (Bindings::RootObject::setFindRootObjectForNativeHandleFunction):
3399         (Bindings::RootObject::removeAllJavaReferencesForRoot):
3400         (Bindings::JSObject::invoke):
3401         (Bindings::JSObject::JSObject):
3402         (Bindings::JSObject::call):
3403         (Bindings::JSObject::eval):
3404         (Bindings::JSObject::getMember):
3405         (Bindings::JSObject::setMember):
3406         (Bindings::JSObject::removeMember):
3407         (Bindings::JSObject::getSlot):
3408         (Bindings::JSObject::setSlot):
3409         (Bindings::JSObject::toString):
3410         (Bindings::JSObject::finalize):
3411         (Bindings::JSObject::getWindow):
3412         * bindings/jni_jsobject.h:
3413         (Bindings::RootObject::~RootObject):
3414         (Bindings::RootObject::findRootObjectForNativeHandleFunction):
3415         (Bindings::RootObject::runLoop):
3416         (Bindings::RootObject::performJavaScriptSource):
3417         (Bindings::):
3418
3419 2003-12-11  Richard Williamson   <rjw@apple.com>
3420
3421         Added support for calling a JavaScript function from
3422         Java.  Right now this only works for void func(void)
3423         functions, but the conversion of args and return values
3424         will come shortly.
3425
3426         Cleaned up and verified reference counting scheme, and
3427         dereferencing of vended JavaScript objects when applet is
3428         destroyed (actually when part is destroyed).
3429         
3430         Removed link hack for testkjs now that the Java folks think
3431         they have a solution for the 1.4.2 JavaVM link problem.  Although
3432         Greg B. thinks his solution may cause problems for the 1.3.1
3433         version of the VM!?!
3434
3435         Reviewed by Ken.
3436
3437         * Makefile.am:
3438         * bindings/jni/jni_runtime.h:
3439         (Bindings::JavaString::JavaString):
3440         * bindings/jni/jni_utility.cpp:
3441         (convertValueToJValue):
3442         (convertValueToJObject):
3443         (listFromJArray):
3444         * bindings/jni/jni_utility.h:
3445         * bindings/jni_jsobject.cpp:
3446         (KJS_setFindRootObjectForNativeHandleFunction):
3447         (KJS_findRootObjectForNativeHandleFunction):
3448         (getReferencesByRootDictionary):
3449         (getReferencesDictionary):
3450         (findReferenceDictionary):
3451         (rootForImp):
3452         (addJavaReference):
3453         (removeJavaReference):
3454         * bindings/jni_jsobject.h:
3455         (Bindings::RootObject::RootObject):
3456         (Bindings::RootObject::~RootObject):
3457         (Bindings::RootObject::setRootObjectImp):
3458         (Bindings::RootObject::rootObjectImp):
3459         (Bindings::RootObject::setInterpreter):
3460         (Bindings::RootObject::interpreter):
3461
3462 === Safari-117 ===
3463
3464 2003-12-10  Darin Adler  <darin@apple.com>
3465
3466         Reviewed by Maciej.
3467
3468         - fixed regression in JavaScript tests reported by the KDE guys
3469         - fixed 3506345: REGRESSION (115-116): VIP: chordfind.com no longer displays chords
3470
3471         * kjs/ustring.h: Add tolerateEmptyString parameter to toDouble and toULong.
3472         * kjs/ustring.cpp:
3473         (KJS::UString::toDouble): Separate the "tolerant" parameter into two separate ones:
3474         tolerateTrailingJunk and tolerateEmptyString. Add new overloads; better for code size
3475         and binary compatibility than default parameter values.
3476         (KJS::UString::toULong): Pass tolerateEmptyString down to toDouble. Add new overload.
3477
3478         * kjs/string_object.cpp: (StringProtoFuncImp::call): Pass false for the new
3479         "tolerate empty string" parameter.
3480
3481 2003-12-10  Richard Williamson   <rjw@apple.com>
3482
3483         Added code to manage reference counting of JavaScript
3484         objects passed to Java.   Also added implementation of
3485         KJS_JSCreateNativeJSObject.  This is the function that
3486         provides the root object to Java (KJS::Window).
3487
3488         Reviewed by Hyatt.
3489
3490         * JavaScriptCore.pbproj/project.pbxproj:
3491         * bindings/jni_jsobject.cpp:
3492         (KJS_setFindObjectForNativeHandleFunction):
3493         (KJS_findObjectForNativeHandleFunction):
3494         (getReferencesByOwnerDictionary):
3495         (getReferencesDictionary):
3496         (findReferenceDictionary):
3497         (addJavaReference):
3498         (removeJavaReference):
3499         (removeAllJavaReferencesForOwner):
3500         * bindings/jni_jsobject.h:
3501
3502 2003-12-09  Richard Williamson   <rjw@apple.com>
3503
3504         LiveConnect stubs that correspond to the native methods
3505         on JSObject.  These will be called from the new Java plugin
3506         when an instance of JSObject is instantiated and messaged.
3507         When these are implemented the Java will be able to originate
3508         calls into JavaScript.
3509
3510         Also a temporary work-around added to Makefile.am to solve
3511         a link problem.  The 1.4.2 JavaVM accidentally links against
3512         libobjc.  This call a failure linking testkjs.  Mike Hay is
3513         working with someone to fix the problem (3505587).
3514
3515         Reviewed by Chris.
3516
3517         * JavaScriptCore.pbproj/project.pbxproj:
3518         * Makefile.am:
3519         * bindings/jni_jsobject.cpp: Added.
3520         (KJS_JSCreateNativeJSObject):
3521         (KJS_JSObject_JSFinalize):
3522         (KJS_JSObject_JSObjectCall):
3523         (KJS_JSObject_JSObjectEval):
3524         (KJS_JSObject_JSObjectGetMember):
3525         (KJS_JSObject_JSObjectSetMember):
3526         (KJS_JSObject_JSObjectRemoveMember):
3527         (KJS_JSObject_JSObjectGetSlot):
3528         (KJS_JSObject_JSObjectSetSlot):
3529         (KJS_JSObject_JSObjectToString):
3530         * bindings/jni_jsobject.h: Added.
3531
3532 2003-12-09  Maciej Stachowiak  <mjs@apple.com>
3533
3534         Reviewed by John.
3535
3536         <rdar://problem/3505183>: JavaScriptCore should assert that interpreter is locked in collector
3537
3538         * kjs/collector.cpp:
3539         (KJS::Collector::allocate): Assert that interpreter lock count is not 0.
3540         (KJS::Collector::collect): likewise
3541
3542 2003-12-08  Richard Williamson   <rjw@apple.com>
3543
3544         LiveConnect:  The last piece of the JavaScript side of the
3545         LiveConnect implementation.  This change adds support for
3546         setting/getting values from Java arrays in JavaScript.
3547
3548         Reviewed by John.
3549
3550         * bindings/jni/jni_instance.h:
3551         * bindings/jni/jni_runtime.cpp:
3552         (JavaField::JavaField):
3553         (convertJObjectToArray):
3554         (JavaArray::JavaArray):
3555         (JavaArray::~JavaArray):
3556         (JavaArray::setValueAt):
3557         (JavaArray::valueAt):
3558         (JavaArray::getLength):
3559         * bindings/jni/jni_runtime.h:
3560         (Bindings::JavaArray::operator=):
3561         (Bindings::JavaArray::javaArray):
3562         * bindings/jni/jni_utility.cpp:
3563         (JNITypeFromPrimitiveType):
3564         (convertValueToJValue):
3565         * bindings/jni/jni_utility.h:
3566         * bindings/runtime.h:
3567         * bindings/runtime_array.cpp:
3568         (RuntimeArrayImp::RuntimeArrayImp):
3569         (RuntimeArrayImp::~RuntimeArrayImp):
3570         (RuntimeArrayImp::get):
3571         (RuntimeArrayImp::put):
3572         (RuntimeArrayImp::hasProperty):
3573         * bindings/runtime_array.h:
3574         (KJS::RuntimeArrayImp::getLength):
3575         (KJS::RuntimeArrayImp::getConcreteArray):
3576         * bindings/runtime_object.cpp:
3577         (RuntimeObjectImp::get):
3578         (RuntimeObjectImp::canPut):
3579         (RuntimeObjectImp::hasProperty):
3580
3581 2003-12-05  Richard Williamson   <rjw@apple.com>
3582
3583         LiveConnect:  Part 1 of supporting JS bindings to
3584         native language arrays.
3585
3586         Reviewed by Chris.
3587
3588         * JavaScriptCore.pbproj/project.pbxproj:
3589         * bindings/jni/jni_runtime.cpp:
3590         (JavaField::JavaField):
3591         (convertJObjectToArray):
3592         (JavaField::valueFromInstance):
3593         (JavaField::setValueToInstance):
3594         * bindings/jni/jni_runtime.h:
3595         * bindings/runtime.cpp:
3596         (Instance::setValueOfField):
3597         * bindings/runtime.h:
3598         (Bindings::Array::~Array):
3599
3600 2003-12-04  Richard Williamson   <rjw@apple.com>
3601
3602         LiveConnect:  Moved defaultValue into concrete implementation because
3603         more intelligent conversion can be perform with knowledge
3604         of the class of the original instance.
3605
3606         Reviewed by Chris.
3607
3608         * bindings/jni/jni_class.cpp:
3609         (JavaClass::isNumberClass):
3610         (JavaClass::isBooleanClass):
3611         (JavaClass::isStringClass):
3612         * bindings/jni/jni_class.h:
3613         * bindings/jni/jni_instance.cpp:
3614         (JavaInstance::defaultValue):
3615         (JavaInstance::valueOf):
3616         * bindings/jni/jni_instance.h:
3617         (Bindings::JavaInstance::javaInstance):
3618         * bindings/runtime.h:
3619         * bindings/runtime_object.cpp:
3620         (RuntimeObjectImp::defaultValue):
3621
3622 2003-12-04  Richard Williamson   <rjw@apple.com>
3623
3624         LiveConnect:  Added support for setting the value of Java
3625         fields.
3626
3627         Reviewed by Chris.
3628
3629         * bindings/jni/jni_instance.cpp:
3630         (JavaInstance::invokeMethod):
3631         * bindings/jni/jni_runtime.cpp:
3632         (JavaParameter::JavaParameter):
3633         (JavaField::JavaField):
3634         (JavaField::valueFromInstance):
3635         (JavaField::setValueToInstance):
3636         (JavaMethod::JavaMethod):
3637         * bindings/jni/jni_runtime.h:
3638         (Bindings::JavaField::getJNIType):
3639         * bindings/jni/jni_utility.cpp:
3640         (JNITypeFromClassName):
3641         (convertValueToJValue):
3642         * bindings/jni/jni_utility.h:
3643         * bindings/runtime.cpp:
3644         (Instance::setValueOfField):
3645         * bindings/runtime.h:
3646         * bindings/runtime_object.cpp:
3647         (RuntimeObjectImp::get):
3648         (RuntimeObjectImp::put):
3649         (RuntimeObjectImp::defaultValue):
3650
3651 2003-12-04  Richard Williamson   <rjw@apple.com>
3652
3653         Added support for string conversions.
3654         Changed various JavaString member variables to be inline.
3655         Implemented defaultValue for context relevant type coercion.
3656
3657         Reviewed by Chris.
3658
3659         * bindings/jni/jni_class.cpp:
3660         (JavaClass::JavaClass):
3661         (JavaClass::setClassName):
3662         (JavaClass::classForInstance):
3663         * bindings/jni/jni_class.h:
3664         * bindings/jni/jni_instance.cpp:
3665         (JavaInstance::stringValue):
3666         (JavaInstance::numberValue):
3667         (JavaInstance::booleanValue):
3668         (JavaInstance::invokeMethod):
3669         * bindings/jni/jni_instance.h:
3670         * bindings/jni/jni_runtime.cpp:
3671         (JavaParameter::JavaParameter):
3672         (JavaField::JavaField):
3673         (JavaMethod::JavaMethod):
3674         (appendClassName):
3675         (JavaMethod::signature):
3676         * bindings/jni/jni_runtime.h:
3677         (Bindings::JavaString::JavaString):
3678         (Bindings::JavaString::~JavaString):
3679         (Bindings::JavaString::operator=):
3680         (Bindings::JavaString::characters):
3681         (Bindings::JavaParameter::JavaParameter):
3682         (Bindings::JavaParameter::~JavaParameter):
3683         (Bindings::JavaParameter::operator=):
3684         (Bindings::JavaParameter::type):
3685         (Bindings::JavaField::JavaField):
3686         (Bindings::JavaField::~JavaField):
3687         (Bindings::JavaField::operator=):
3688         (Bindings::JavaField::name):
3689         (Bindings::JavaField::type):
3690         (Bindings::JavaMethod::JavaMethod):
3691         (Bindings::JavaMethod::_commonDelete):
3692         (Bindings::JavaMethod::name):
3693         (Bindings::JavaMethod::returnType):
3694         * bindings/jni/jni_utility.cpp:
3695         (convertValueToJValue):
3696         * bindings/runtime.h:
3697         (Bindings::Instance::valueOf):
3698         * bindings/runtime_method.cpp:
3699         (RuntimeMethodImp::call):
3700         * bindings/runtime_object.cpp:
3701         (RuntimeObjectImp::RuntimeObjectImp):
3702         (RuntimeObjectImp::get):
3703         (RuntimeObjectImp::defaultValue):
3704         * bindings/runtime_object.h:
3705         (KJS::RuntimeObjectImp::classInfo):
3706
3707 === Safari-116 ===
3708
3709 2003-12-03  Richard Williamson   <rjw@apple.com>
3710
3711         LiveConnect:  Added support for parameter passing to Java and conversion
3712         of return values.
3713
3714         Reviewed by Chris.
3715
3716         * bindings/jni/jni_instance.cpp:
3717         (JavaInstance::invokeMethod):
3718         * bindings/jni/jni_instance.h:
3719         * bindings/jni/jni_runtime.cpp:
3720         (JavaParameter::JavaParameter):
3721         (JavaMethod::JavaMethod):
3722         (JavaMethod::signature):
3723         * bindings/jni/jni_runtime.h:
3724         (Bindings::JavaParameter::JavaParameter):
3725         (Bindings::JavaParameter::operator=):
3726         (Bindings::JavaParameter::getJNIType):
3727         * bindings/jni/jni_utility.cpp:
3728         (callJNIBooleanMethodA):
3729         (convertValueToJValue):
3730         * bindings/jni/jni_utility.h:
3731         * bindings/runtime.h:
3732         * bindings/runtime_method.cpp:
3733         (RuntimeMethodImp::call):
3734         * bindings/runtime_object.cpp:
3735         (RuntimeObjectImp::get):
3736
3737 2003-12-02  Richard Williamson   <rjw@apple.com>
3738
3739         Added support for calling simple methods in Java from JavaScript.
3740         (void return and no parameters).  Yay, LiveConnect lives.
3741
3742         Still need write argument and return value conversion code.
3743
3744         Reviewed by Chris.
3745
3746         * JavaScriptCore.pbproj/project.pbxproj:
3747         * bindings/jni/jni_instance.cpp:
3748         (JavaInstance::getClass):
3749         (JavaInstance::invokeMethod):
3750         * bindings/jni/jni_instance.h:
3751         * bindings/jni/jni_runtime.cpp:
3752         (JavaMethod::JavaMethod):
3753         (JavaMethod::signature):
3754         (JavaMethod::JNIReturnType):
3755         * bindings/jni/jni_runtime.h:
3756         (Bindings::JavaMethod::_commonDelete):
3757         (Bindings::JavaMethod::_commonCopy):
3758         (Bindings::JavaMethod::name):
3759         * bindings/jni/jni_utility.cpp:
3760         (signatureFromPrimitiveType):
3761         * bindings/jni/jni_utility.h:
3762         * bindings/runtime.h:
3763         * bindings/runtime_method.cpp: Added.
3764         (RuntimeMethodImp::RuntimeMethodImp):
3765         (RuntimeMethodImp::~RuntimeMethodImp):
3766         (RuntimeMethodImp::get):
3767         (RuntimeMethodImp::implementsCall):
3768         (RuntimeMethodImp::call):
3769         (RuntimeMethodImp::codeType):
3770         (RuntimeMethodImp::execute):
3771         * bindings/runtime_method.h: Added.
3772         * bindings/runtime_object.cpp:
3773         (RuntimeObjectImp::RuntimeObjectImp):
3774         (RuntimeObjectImp::get):
3775         * bindings/runtime_object.h:
3776         * kjs/function.cpp:
3777         (FunctionImp::FunctionImp):
3778         * kjs/interpreter.h:
3779
3780 2003-12-01  Darin Adler  <darin@apple.com>
3781
3782         Reviewed by Maciej.
3783
3784         - fixed 3493799: JavaScript string.replace expands $ if it's the last character in replacement string
3785
3786         * kjs/ustring.cpp: (KJS::UString::toDouble): Fix backwards handling of the "tolerant" boolean.
3787         This indirectly caused the string.replace bug.
3788
3789 2003-12-02  Maciej Stachowiak  <mjs@apple.com>
3790
3791         Merged patches from Harri Porten and David Faure to fix:
3792
3793         <rdar://problem/3497643>: reproducible crash printing self-referential array
3794         
3795         * kjs/array_object.cpp:
3796         (ArrayProtoFuncImp::call): Break out of the loop if an exception was thrown.
3797         * kjs/nodes.cpp:
3798         (FunctionCallNode::evaluate): Move function call depth check from here...
3799         * kjs/object.cpp:
3800         (KJS::Object::call): ...to here.
3801         * kjs/object.h: Un-inline Object::call now that it does more.
3802
3803 2003-12-01  Richard Williamson   <rjw@apple.com>
3804
3805         Fixed mistake in method signatures used to get boolean and integer fields.
3806
3807         Reviewed by Chris.
3808
3809         * bindings/jni/jni_runtime.cpp:
3810         (JavaField::valueFromInstance):
3811
3812 2003-12-01  Richard Williamson   <rjw@apple.com>
3813
3814 Fixed parameter passing to applet.  Child elements are NOT valid in setStyle().  So we now create the widget before needed with createWidgetIfNecessary.  This either happens when doing the first layout, or when JavaScript first references the applet element.
3815
3816 Fixed early delete of the the main applet instance.  When the JS collector cleaned up the last JS object referring to the applet instance we were deleting the java instance.  This caused the applet instance cached on the applet element to be invalid.  The applet instance is the only Java object not to be cleaned up by the JS collector.
3817
3818 Added support for getting at Java object fields.
3819
3820         Reviewed by Chris.
3821
3822         * JavaScriptCore.pbproj/project.pbxproj:
3823         * Makefile.am:
3824         * bindings/jni/jni_instance.cpp:
3825         (JObjectWrapper::JObjectWrapper):
3826         * bindings/jni/jni_instance.h:
3827         (Bindings::JObjectWrapper::~JObjectWrapper):
3828         * bindings/jni/jni_runtime.cpp:
3829         (JavaField::valueFromInstance):
3830         * bindings/runtime_object.cpp:
3831         (RuntimeObjectImp::~RuntimeObjectImp):
3832         (RuntimeObjectImp::RuntimeObjectImp):
3833         (RuntimeObjectImp::get):
3834         (RuntimeObjectImp::deleteProperty):
3835         * bindings/runtime_object.h:
3836
3837 === Safari-115 ===
3838
3839 2003-11-21  Maciej Stachowiak  <mjs@apple.com>
3840
3841         Patch from Harri Porten, reviewed by me.
3842
3843         - fixed 3491712 - String slice with negative arguments does not offset from end of string
3844         
3845         * kjs/string_object.cpp:
3846         (StringProtoFuncImp::call): Handle negative arguments as offsets from end by
3847         adding length and clamping to [0,length-1].
3848
3849 2003-11-21  Maciej Stachowiak  <mjs@apple.com>
3850
3851         Patch from Harri Porten, reviewed by me.
3852
3853         - fixed 3491709 - using Function.apply with a primitive type as the arg list causes crash
3854         
3855         * kjs/function_object.cpp:
3856         (FunctionProtoFuncImp::call): Nest parentheses properly.
3857
3858 2003-11-20  Richard Williamson   <rjw@apple.com>
3859
3860         More LiveConnect stuff.  Primitive Java fields are now
3861         accessible from JavaScript!  Yay!
3862
3863         Reviewed by Maciej.
3864
3865         * bindings/jni/jni_class.cpp:
3866         (JavaClass::methodNamed):
3867         (JavaClass::fieldNamed):
3868         * bindings/jni/jni_class.h:
3869         (Bindings::JavaClass::_commonDelete):
3870         * bindings/jni/jni_instance.cpp:
3871         (JavaInstance::JavaInstance):
3872         (JavaInstance::~JavaInstance):
3873         (JavaInstance::getClass):
3874         * bindings/jni/jni_instance.h:
3875         (Bindings::JavaInstance::javaInstance):
3876         * bindings/jni/jni_runtime.cpp:
3877         (JavaField::JavaField):
3878         (JavaField::valueFromInstance):
3879         * bindings/jni/jni_runtime.h:
3880         (Bindings::JavaField::JavaField):
3881         (Bindings::JavaField::~JavaField):
3882         (Bindings::JavaField::operator=):
3883         * bindings/jni/jni_utility.cpp:
3884         (callJNIMethod):
3885         (callJNIMethodA):
3886         (callJNIVoidMethod):
3887         (callJNIObjectMethod):
3888         (callJNIBooleanMethod):
3889         (callJNIByteMethod):
3890         (callJNICharMethod):
3891         (callJNIShortMethod):
3892         (callJNIIntMethod):
3893         (callJNILongMethod):
3894         (callJNIFloatMethod):
3895         (callJNIDoubleMethod):
3896         (callJNIVoidMethodA):
3897         (callJNIObjectMethodA):
3898         (callJNIByteMethodA):
3899         (callJNICharMethodA):
3900         (callJNIShortMethodA):
3901         (callJNIIntMethodA):
3902         (callJNILongMethodA):
3903         (callJNIFloatMethodA):
3904         (callJNIDoubleMethodA):
3905         (releaseCharactersForJStringInEnv):
3906         (primitiveTypeFromClassName):
3907         (getJNIField):
3908         * bindings/jni/jni_utility.h:
3909         * bindings/runtime.cpp:
3910         (Instance::createBindingForLanguageInstance):
3911         (Instance::getValueOfField):
3912         * bindings/runtime.h:
3913         * bindings/runtime_object.cpp:
3914         (RuntimeObjectImp::get):
3915
3916 2003-11-20  Richard Williamson   <rjw@apple.com>
3917
3918         More LiveConnect stuff.
3919
3920         Reviewed by Chris.
3921
3922         * bindings/jni/jni_class.cpp:
3923         (JavaClass::classForName):
3924         (JavaClass::classForInstance):
3925         * bindings/jni/jni_instance.cpp:
3926         (JavaInstance::getValueOfField):
3927         * bindings/jni/jni_instance.h:
3928         (Bindings::JObjectWrapper::JObjectWrapper):
3929         * bindings/jni/jni_runtime.h:
3930         (Bindings::JavaConstructor::~JavaConstructor):
3931         (Bindings::JavaConstructor::operator=):
3932         (Bindings::JavaMethod::JavaMethod):
3933         (Bindings::JavaMethod::_commonDelete):
3934         (Bindings::JavaMethod::signature):
3935         * bindings/jni/jni_utility.cpp:
3936         (getJNIEnv):
3937         (attachToJavaVM):
3938         * bindings/jni/jni_utility.h:
3939         * bindings/runtime.h:
3940         * bindings/runtime_object.cpp:
3941         (RuntimeObjectImp::~RuntimeObjectImp):
3942         (RuntimeObjectImp::get):
3943         * bindings/runtime_object.h:
3944
3945 2003-11-19  Richard Williamson   <rjw@apple.com>
3946
3947         More LiveConnect stuff.
3948
3949         Reviewed by Ken.
3950
3951         * JavaScriptCore.pbproj/project.pbxproj:
3952         * bindings/jni/jni_class.cpp: Added.
3953         (JavaClass::_commonInit):
3954         (JavaClass::JavaClass):
3955         (_createClassesByNameIfNecessary):
3956         (JavaClass::classForName):
3957         (JavaClass::classForInstance):
3958         (JavaClass::methodNamed):
3959         (JavaClass::fieldNamed):
3960         * bindings/jni/jni_class.h: Added.
3961         (Bindings::JavaClass::_commonDelete):
3962         (Bindings::JavaClass::~JavaClass):
3963         (Bindings::JavaClass::_commonCopy):
3964         (Bindings::JavaClass::JavaClass):
3965         (Bindings::JavaClass::operator=):
3966         (Bindings::JavaClass::name):
3967         (Bindings::JavaClass::constructorAt):
3968         (Bindings::JavaClass::numConstructors):
3969         * bindings/jni/jni_instance.cpp: Added.
3970         (JavaInstance::JavaInstance):
3971         (JavaInstance::~JavaInstance):
3972         * bindings/jni/jni_instance.h: Added.
3973         (Bindings::JObjectWrapper::JObjectWrapper):
3974         (Bindings::JObjectWrapper::~JObjectWrapper):
3975         (Bindings::JObjectWrapper::ref):
3976         (Bindings::JObjectWrapper::deref):
3977         (Bindings::JavaInstance::getClass):
3978         (Bindings::JavaInstance::operator=):
3979         * bindings/jni/jni_runtime.cpp:
3980         (JavaMethod::JavaMethod):
3981         * bindings/jni/jni_runtime.h:
3982         (Bindings::JavaString::JavaString):
3983         (Bindings::JavaString::~JavaString):
3984         (Bindings::JavaString::operator=):
3985         * bindings/jni/jni_utility.cpp:
3986         (getJavaVM):
3987         (getJNIEnv):
3988         (getCharactersFromJString):
3989         (releaseCharactersForJString):
3990         (getCharactersFromJStringInEnv):
3991         (releaseCharactersForJStringInEnv):
3992         * bindings/jni/jni_utility.h:
3993         * bindings/runtime.cpp:
3994         (Instance::createBindingForLanguageInstance):
3995         * bindings/runtime.h:
3996         (Bindings::Instance::):
3997
3998 2003-11-18  Richard Williamson   <rjw@apple.com>
3999
4000         More live connect stubs.  We're getting close.
4001
4002         Reviewed by Chris.
4003
4004         * JavaScriptCore.pbproj/project.pbxproj:
4005         * bindings/jni/jni_runtime.cpp:
4006         (JavaClass::JavaClass):
4007         (JavaInstance::JavaInstance):
4008         (JavaInstance::~JavaInstance):
4009         * bindings/jni/jni_runtime.h:
4010         (Bindings::JavaConstructor::value):
4011         (Bindings::JavaField::value):
4012         (Bindings::JavaMethod::value):
4013         (Bindings::JavaClass::_commonDelete):
4014         (Bindings::JavaClass::_commonCopy):
4015         (Bindings::JavaClass::methodNamed):
4016         (Bindings::JavaClass::fieldNamed):
4017         (Bindings::JavaInstance::getClass):
4018         * bindings/runtime.cpp: Added.
4019         * bindings/runtime.h:
4020         (Bindings::Instance::~Instance):
4021         * bindings/runtime_object.cpp: Added.
4022         (RuntimeObjectImp::classInfo):
4023         (RuntimeObjectImp::RuntimeObjectImp):
4024         (RuntimeObjectImp::get):
4025         (RuntimeObjectImp::put):
4026         (RuntimeObjectImp::canPut):
4027         (RuntimeObjectImp::hasProperty):
4028         (RuntimeObjectImp::deleteProperty):
4029         (RuntimeObjectImp::defaultValue):
4030         (RuntimeObjectImp::_initializeClassInfoFromInstance):
4031         * bindings/runtime_object.h: Added.
4032         (KJS::RuntimeObjectImp::setInternalInstance):
4033         (KJS::RuntimeObjectImp::getInternalInstance):
4034         * kjs/object.cpp:
4035         (KJS::ObjectImp::get):
4036         (KJS::ObjectImp::hasProperty):
4037         * kjs/value.h:
4038         (KJS::):
4039
4040 2003-11-17  Maciej Stachowiak  <mjs@apple.com>
4041
4042         Patch from Harri, reviewed by me.
4043
4044         - fixed 3487375 - backwards array slice causes infinite loop
4045         
4046         * kjs/array_object.cpp:
4047         (ArrayProtoFuncImp::call):
4048
4049 2003-11-17  Maciej Stachowiak  <mjs@apple.com>
4050
4051         Patch from Harri Porten reviewed by me.
4052
4053         - fixed 3487371 - operator precedence for bitwise or, xor and and is wrong
4054
4055         * kjs/grammar.y: Correct the precedence.
4056
4057 2003-11-16  Maciej Stachowiak  <mjs@apple.com>
4058
4059         Reviewed by John.
4060
4061         - fixed 3483829 - JavaScriptCore needs workaround to compile on Merlot
4062         
4063         * JavaScriptCore.pbproj/project.pbxproj: Add -Wno-long-double to
4064         warning flags.
4065
4066 === Safari-114 ===
4067
4068 2003-11-13  Richard Williamson   <rjw@apple.com>
4069
4070         Factored common code between copy constructor and assignment operator.
4071
4072         Reviewed by Chris.
4073
4074         * ChangeLog:
4075         * bindings/jni/jni_runtime.h:
4076         (Bindings::JavaConstructor::_commonCopy):
4077         (Bindings::JavaConstructor::JavaConstructor):
4078         (Bindings::JavaConstructor::operator=):
4079         (Bindings::JavaField::type):
4080         * bindings/runtime.h:
4081
4082 2003-11-13  Richard Williamson   <rjw@apple.com>
4083
4084         More LiveConnect stuff.  This checkin adds abstract classes to model
4085         language runtimes and a JNI based set of concrete implementations for
4086         Java.
4087
4088         Reviewed by Chris.
4089
4090         * JavaScriptCore.pbproj/project.pbxproj:
4091         * Makefile.am:
4092         * bindings/Makefile.am: Removed.
4093         * bindings/jni/Makefile.am: Removed.
4094         * bindings/jni/jni_runtime.cpp: Added.
4095         (JavaField::JavaField):
4096         (JavaConstructor::JavaConstructor):
4097         (JavaMethod::JavaMethod):
4098         (JavaClass::JavaClass):
4099         * bindings/jni/jni_runtime.h: Added.
4100         (Bindings::JavaString::JavaString):
4101         (Bindings::JavaString::~JavaString):
4102         (Bindings::JavaString::operator=):
4103         (Bindings::JavaString::characters):
4104         (Bindings::JavaParameter::JavaParameter):
4105         (Bindings::JavaParameter::~JavaParameter):
4106         (Bindings::JavaParameter::operator=):
4107         (Bindings::JavaParameter::type):
4108         (Bindings::JavaConstructor::JavaConstructor):
4109         (Bindings::JavaConstructor::~JavaConstructor):
4110         (Bindings::JavaConstructor::operator=):
4111         (Bindings::JavaConstructor::parameterAt):
4112         (Bindings::JavaConstructor::numParameters):
4113         (Bindings::JavaField::JavaField):
4114         (Bindings::JavaField::~JavaField):
4115         (Bindings::JavaField::operator=):
4116         (Bindings::JavaField::name):
4117         (Bindings::JavaField::type):
4118         (Bindings::JavaMethod::JavaMethod):
4119         (Bindings::JavaMethod::_commonDelete):
4120         (Bindings::JavaMethod::~JavaMethod):
4121         (Bindings::JavaMethod::_commonCopy):
4122         (Bindings::JavaMethod::operator=):
4123         (Bindings::JavaMethod::name):
4124         (Bindings::JavaMethod::returnType):
4125         (Bindings::JavaMethod::parameterAt):
4126         (Bindings::JavaMethod::numParameters):
4127         (Bindings::JavaClass::_commonDelete):
4128         (Bindings::JavaClass::~JavaClass):
4129         (Bindings::JavaClass::_commonCopy):
4130         (Bindings::JavaClass::JavaClass):
4131         (Bindings::JavaClass::operator=):
4132         (Bindings::JavaClass::name):
4133         (Bindings::JavaClass::methodAt):
4134         (Bindings::JavaClass::numMethods):
4135         (Bindings::JavaClass::constructorAt):
4136         (Bindings::JavaClass::numConstructors):
4137         (Bindings::JavaClass::fieldAt):
4138         (Bindings::JavaClass::numFields):
4139         * bindings/jni/jni_utility.cpp:
4140         (callJNIMethod):
4141         (callJNIMethodA):
4142         (callJNIObjectMethod):
4143         (callJNIByteMethod):
4144         (callJNICharMethod):
4145         (callJNIShortMethod):
4146         (callJNIIntMethod):
4147         (callJNILongMethod):
4148         (callJNIFloatMethod):
4149         (callJNIDoubleMethod):
4150         (callJNIVoidMethodA):
4151         (callJNIObjectMethodA):
4152         (callJNIByteMethodA):
4153         (callJNICharMethodA):
4154         (callJNIShortMethodA):
4155         (callJNIIntMethodA):
4156         (callJNILongMethodA):
4157         (callJNIFloatMethodA):
4158         (callJNIDoubleMethodA):
4159         (getCharactersFromJString):
4160         (releaseCharactersForJString):
4161         * bindings/jni/jni_utility.h:
4162         * bindings/objc/Makefile.am: Removed.
4163         * bindings/runtime.h: Added.
4164         (Bindings::Parameter::~Parameter):
4165         (Bindings::Constructor::~Constructor):
4166         (Bindings::Field::~Field):
4167         (Bindings::Method::~Method):
4168         (Bindings::Class::~Class):
4169
4170 2003-11-13  Maciej Stachowiak  <mjs@apple.com>
4171
4172         Reviewed by John.
4173
4174         - fixed 3472562 - Null or Undefined variables passed to IN operator cause javascript exceptions
4175         
4176         * kjs/nodes.cpp:
4177         (ForInNode::execute): If the in value is null or undefined, bail
4178         out early, since attempting to iterate its properties will throw
4179         an exception.
4180
4181 2003-11-12  Darin Adler  <darin@apple.com>
4182
4183         - fixed the build
4184
4185         * Makefile.am: Fix the build by removing the bindings directory from SUBDIRS.
4186         Later, we can either add this back and add the Makefile.am files to the top
4187         level configure.in or leave it out and remove the Makefile.am files.
4188
4189 2003-11-12  Richard Williamson   <rjw@apple.com>
4190
4191         Added utility functions for calling JNI methods.
4192
4193         Reviewed by Chris.
4194
4195         * JavaScriptCore.pbproj/project.pbxproj:
4196         * Makefile.am:
4197         * bindings/Makefile.am: Added.
4198         * bindings/jni/Makefile.am: Added.
4199         * bindings/jni/jni_utility.cpp: Added.
4200         (attachToJavaVM):
4201         (callJNIMethod):
4202         (callJNIVoidMethod):
4203         (callJNIObjectMethod):
4204         (callJNIByteMethod):
4205         (callJNICharMethod):
4206         (callJNIShortMethod):
4207         (callJNIIntMethod):
4208         (callJNILongMethod):
4209         (callJNIFloatMethod):
4210         (callJNIDoubleMethod):
4211         * bindings/jni/jni_utility.h: Added.
4212         * bindings/objc/Makefile.am: Added.