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