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