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