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