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