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