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