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