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