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