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