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