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