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