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