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