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