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