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