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