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