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