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