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