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