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