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