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