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