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