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