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