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