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