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