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