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