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