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