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