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