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