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