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