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