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