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