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