Reviewed by John.
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2004-04-09  Maciej Stachowiak  <mjs@apple.com>
2
3         Reviewed by John.
4
5         - fix deployment build by avoiding deployment-only warning.
6
7         * kjs/scope_chain.cpp:
8         (KJS::ScopeChain::bottom):
9
10 2004-04-09  Maciej Stachowiak  <mjs@apple.com>
11
12         Reviewed by John.
13
14         Changed things so that newly created objects get a prototype based
15         on the scope chain of the current function, rather than the
16         interpreter that started execution. This fixes the following bugs:
17         
18         <rdar://problem/3368523>: ARCH: wrong prototype used to create new objects (hang on lookup.atomica.com)
19         <rdar://problem/3559173>: ARCH: Cannot scan using a HP Jetdirect product (JS object prototypes bind incorrectly)
20
21         * JavaScriptCore.pbproj/project.pbxproj:
22         * kjs/array_object.cpp:
23         (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
24         (ArrayProtoFuncImp::ArrayProtoFuncImp):
25         (ArrayProtoFuncImp::call):
26         (ArrayObjectImp::construct):
27         * kjs/bool_object.cpp:
28         (BooleanObjectImp::construct):
29         * kjs/date_object.cpp:
30         (DateProtoFuncImp::DateProtoFuncImp):
31         (DateProtoFuncImp::call):
32         (DateObjectImp::construct):
33         * kjs/error_object.cpp:
34         (ErrorObjectImp::construct):
35         * kjs/function.cpp:
36         (FunctionImp::FunctionImp):
37         (FunctionImp::call):
38         (DeclaredFunctionImp::construct):
39         (ArgumentsImp::ArgumentsImp):
40         (GlobalFuncImp::call):
41         * kjs/function_object.cpp:
42         (FunctionProtoFuncImp::call):
43         (FunctionObjectImp::construct):
44         * kjs/internal.cpp:
45         (BooleanImp::toObject):
46         (StringImp::toObject):
47         (NumberImp::toObject):
48         (InterpreterImp::InterpreterImp):
49         (InterpreterImp::clear):
50         (InterpreterImp::interpreterWithGlobalObject):
51         * kjs/internal.h:
52         * kjs/interpreter.cpp:
53         (ExecState::lexicalInterpreter):
54         * kjs/interpreter.h:
55         (KJS::ExecState::dynamicInterpreter):
56         (KJS::ExecState::interpreter):
57         * kjs/math_object.cpp:
58         (MathFuncImp::MathFuncImp):
59         * kjs/nodes.cpp:
60         (StatementNode::hitStatement):
61         (StatementNode::abortStatement):
62         (RegExpNode::evaluate):
63         (ElementNode::evaluate):
64         (ArrayNode::evaluate):
65         (ObjectLiteralNode::evaluate):
66         (PropertyValueNode::evaluate):
67         (FunctionCallNode::evaluate):
68         (FuncDeclNode::processFuncDecl):
69         (FuncExprNode::evaluate):
70         * kjs/number_object.cpp:
71         (NumberObjectImp::construct):
72         * kjs/object.cpp:
73         (KJS::ObjectImp::defaultValue):
74         (KJS::Error::create):
75         * kjs/object_object.cpp:
76         (ObjectObjectImp::construct):
77         * kjs/reference.cpp:
78         (Reference::putValue):
79         * kjs/regexp_object.cpp:
80         (RegExpProtoFuncImp::call):
81         (RegExpObjectImp::arrayOfMatches):
82         (RegExpObjectImp::construct):
83         * kjs/scope_chain.cpp:
84         (KJS::ScopeChain::bottom):
85         * kjs/scope_chain.h:
86         * kjs/string_object.cpp:
87         (StringProtoFuncImp::StringProtoFuncImp):
88         (StringProtoFuncImp::call):
89         (StringObjectImp::construct):
90
91 === Safari-136 ===
92
93 === Safari-135 ===
94
95 2004-03-31  Richard Williamson   <rjw@apple.com>
96
97         Tedious renames based on feedback from plugin-futures list.
98         NP_ functions are renamed with NPN_ prefix.
99         Types prefix renamed from NP_ to NP.
100         NPN_CreateStringWithUTF8 and NPN_SetExceptionWithUTF8 now take a length, optionally -1 if string is null terminated. 
101         
102         No review because this was just a renaming patch.
103
104         * bindings/NP_jsobject.cpp:
105         (listFromNPArray):
106         (jsAllocate):
107         (identiferFromNPIdentifier):
108         (NPN_Call):
109         (NPN_Evaluate):
110         (NPN_GetProperty):
111         (NPN_SetProperty):
112         (NPN_RemoveProperty):
113         (NPN_ToString):
114         (NPN_GetPropertyAtIndex):
115         (NPN_SetPropertyAtIndex):
116         * bindings/NP_jsobject.h:
117         * bindings/c/c_class.cpp:
118         (CClass::_commonInit):
119         (CClass::classForIsA):
120         (CClass::CClass):
121         (CClass::methodsNamed):
122         (CClass::fieldNamed):
123         * bindings/c/c_class.h:
124         * bindings/c/c_instance.cpp:
125         (CInstance::CInstance):
126         (CInstance::~CInstance):
127         (CInstance::operator=):
128         (CInstance::invokeMethod):
129         (CInstance::defaultValue):
130         * bindings/c/c_instance.h:
131         (KJS::Bindings::CInstance::getObject):
132         * bindings/c/c_runtime.cpp:
133         (CField::valueFromInstance):
134         (CField::setValueToInstance):
135         * bindings/c/c_runtime.h:
136         (KJS::Bindings::CField::CField):
137         (KJS::Bindings::CField::name):
138         (KJS::Bindings::CMethod::CMethod):
139         (KJS::Bindings::CMethod::name):
140         * bindings/c/c_utility.cpp:
141         (coerceValueToNPString):
142         (convertValueToNPValueType):
143         (convertNPValueTypeToValue):
144         * bindings/c/c_utility.h:
145         * bindings/npruntime.cpp:
146         (NPN_IdentifierFromUTF8):
147         (NPN_IsValidIdentifier):
148         (NPN_GetIdentifiers):
149         (NPN_UTF8FromIdentifier):
150         (NPN_CreateObject):
151         (NPN_RetainObject):
152         (NPN_ReleaseObject):
153         (NPN_IsKindOfClass):
154         (NPN_SetExceptionWithUTF8):
155         (NPN_SetException):
156         (numberAllocate):
157         (NPN_CreateNumberWithInt):
158         (NPN_CreateNumberWithFloat):
159         (NPN_CreateNumberWithDouble):
160         (NPN_IntFromNumber):
161         (NPN_FloatFromNumber):
162         (NPN_DoubleFromNumber):
163         (stringAllocate):
164         (NPN_CreateStringWithUTF8):
165         (NPN_CreateStringWithUTF16):
166         (NPN_DeallocateUTF8):
167         (NPN_UTF8FromString):
168         (NPN_UTF16FromString):
169         (NPN_StringLength):
170         (booleanAllocate):
171         (NPN_CreateBoolean):
172         (NPN_BoolFromBoolean):
173         (nullAllocate):
174         (NPN_GetNull):
175         (undefinedAllocate):
176         (NPN_GetUndefined):
177         (arrayAllocate):
178         (arrayDeallocate):
179         (NPN_CreateArray):
180         (NPN_CreateArrayV):
181         (NPN_ObjectAtIndex):
182         * bindings/npruntime.h:
183         * bindings/runtime.cpp:
184         (Instance::createBindingForLanguageInstance):
185         * bindings/testbindings.cpp:
186         (initializeIdentifiers):
187         (myHasProperty):
188         (myHasMethod):
189         (myGetProperty):
190         (mySetProperty):
191         (logMessage):
192         (setDoubleValue):
193         (setIntValue):
194         (setStringValue):
195         (setBooleanValue):
196         (getDoubleValue):
197         (getIntValue):
198         (getStringValue):
199         (getBooleanValue):
200         (myInvoke):
201         (myAllocate):
202         (myInvalidate):
203         (myDeallocate):
204         (main):
205
206 2004-03-31  Richard Williamson   <rjw@apple.com>
207
208         Changed references to NP_runtime.h to npruntime.h
209         
210         * JavaScriptCore.pbproj/project.pbxproj:
211         * bindings/NP_jsobject.h:
212         * bindings/c/c_class.h:
213         * bindings/c/c_instance.h:
214         * bindings/c/c_runtime.h:
215         * bindings/c/c_utility.h:
216         * bindings/npruntime.cpp:
217
218 2004-03-31  Richard Williamson   <rjw@apple.com>
219
220         Renamed NP_runtime.h to npruntime.h to match Netscape SDK.
221
222         * JavaScriptCore.pbproj/project.pbxproj:
223         * bindings/NP_jsobject.h:
224         * bindings/npruntime.cpp:
225
226 === Safari-134 ===
227
228 2004-03-23  Richard Williamson   <rjw@apple.com>
229
230         Added implementation of KJS::Value <-> NP_Object conversion functions.
231         Augmented test program for 'C' bindings.
232         Added asserts and parameter checking to all public API. 
233
234         Reviewed by Ken.
235
236         * JavaScriptCore.pbproj/project.pbxproj:
237         * bindings/NP_jsobject.cpp:
238         (NP_ToString):
239         * bindings/NP_jsobject.h: Added.
240         * bindings/NP_runtime.cpp:
241         (NP_IdentifierFromUTF8):
242         (NP_IsValidIdentifier):
243         (NP_GetIdentifiers):
244         (NP_CreateObject):
245         (NP_RetainObject):
246         (NP_ReleaseObject):
247         (NP_IsKindOfClass):
248         (NP_SetExceptionWithUTF8):
249         (NP_SetException):
250         (NP_IntFromNumber):
251         (NP_FloatFromNumber):
252         (NP_DoubleFromNumber):
253         (NP_CreateStringWithUTF8):
254         (NP_CreateStringWithUTF16):
255         (NP_DeallocateUTF8):
256         (NP_UTF8FromString):
257         (NP_UTF16FromString):
258         (NP_StringLength):
259         (NP_BoolFromBoolean):
260         * bindings/NP_runtime.h:
261         * bindings/c/c_instance.cpp:
262         (CInstance::invokeMethod):
263         * bindings/c/c_utility.cpp:
264         (coerceValueToNPString):
265         (convertValueToNPValueType):
266         (convertNPValueTypeToValue):
267         * bindings/c/c_utility.h:
268         * bindings/test.js:
269         * bindings/testC.js: Added.
270         * bindings/testbindings.cpp:
271         (logMessage):
272         (setDoubleValue):
273         (setIntValue):
274         (setStringValue):
275         (setBooleanValue):
276         (getDoubleValue):
277         (getIntValue):
278         (getStringValue):
279         (getBooleanValue):
280         (myInterfaceInvoke):
281         (myInterfaceAllocate):
282
283 === Safari-133 ===
284
285 2004-03-19  Darin Adler  <darin@apple.com>
286
287         Reviewed by Ken.
288
289         - fixed problem with methods like setUTCHour
290
291         * kjs/date_object.cpp: (DateProtoFuncImp::call): Fix conversion back to time_t to use the appropriate
292         GMT vs. local time function based on the utc flag.
293
294 2004-03-17  Richard Williamson   <rjw@apple.com>
295
296         Added a context parameter to result callbacks use by JavaScriptObject functions.  This was a change requested by Eric Carlson on the QT plugin team.
297
298         Reviewed by Ken.
299
300         * bindings/NP_jsobject.cpp:
301         (NP_Call):
302         (NP_Evaluate):
303         (NP_GetProperty):
304         (NP_ToString):
305         (NP_GetPropertyAtIndex):
306         * bindings/NP_runtime.h:
307
308 2004-03-16  Richard Williamson   <rjw@apple.com>
309
310         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.
311
312         Reviewed by John.
313
314         * bindings/jni/jni_class.cpp:
315         (JavaClass::methodsNamed):
316
317 2004-03-15  Richard Williamson   <rjw@apple.com>
318
319         Fixed 3570854.  Don't attempt to convert Null to strings.  We
320         were incorrectly converting to "Null".
321
322         Actually fixed by Scott Kovatch.
323
324         Reviewed by Richard.
325
326         * bindings/jni/jni_utility.cpp:
327         (KJS::Bindings::convertValueToJValue):
328
329 === Safari-132 ===
330
331 2004-03-11  Richard Williamson   <rjw@apple.com>
332
333         Stitched together the NP stuff to our language independent
334         JavaScript binding stuff.  Very close to being done.
335         
336         Added program to test C bindings (and NP stuff).  Just tests
337         properties.  Will add methods and JavaScript access, etc.
338
339         Updated Makefile.am to account for new bindings/c directory.
340
341         Change NP_UTF8 from "const char *" to "char" to allow for
342         declarations like "const NP_UTF8 *" and "NP_UTF8 *".  Ditto
343         for NP_UTF16.
344
345         Added NP_IsValidIdentifier().
346
347         Reviewed by Chris.
348
349         * JavaScriptCore.pbproj/project.pbxproj:
350         * Makefile.am:
351         * bindings/NP_jsobject.cpp:
352         (identiferFromNPIdentifier):
353         (NP_Evaluate):
354         * bindings/NP_runtime.cpp:
355         (NP_IdentifierFromUTF8):
356         (NP_IsValidIdentifier):
357         (NP_GetIdentifiers):
358         (NP_UTF8FromIdentifier):
359         (NP_SetExceptionWithUTF8):
360         (NP_SetException):
361         (NP_CreateStringWithUTF8):
362         (NP_CreateStringWithUTF16):
363         (NP_UTF8FromString):
364         (NP_UTF16FromString):
365         * bindings/NP_runtime.h:
366         * bindings/c/c_class.cpp: Added.
367         (CClass::_commonDelete):
368         (CClass::_commonCopy):
369         (CClass::_commonInit):
370         (_createClassesByIsAIfNecessary):
371         (CClass::classForIsA):
372         (CClass::CClass):
373         (CClass::name):
374         (CClass::methodsNamed):
375         (CClass::fieldNamed):
376         * bindings/c/c_class.h: Added.
377         (KJS::Bindings::CClass::~CClass):
378         (KJS::Bindings::CClass::CClass):
379         (KJS::Bindings::CClass::operator=):
380         (KJS::Bindings::CClass::constructorAt):
381         (KJS::Bindings::CClass::numConstructors):
382         * bindings/c/c_instance.cpp: Added.
383         (CInstance::CInstance):
384         (CInstance::~CInstance):
385         (CInstance::operator=):
386         (CInstance::getClass):
387         (CInstance::begin):
388         (CInstance::end):
389         (CInstance::invokeMethod):
390         (CInstance::defaultValue):
391         (CInstance::stringValue):
392         (CInstance::numberValue):
393         (CInstance::booleanValue):
394         (CInstance::valueOf):
395         * bindings/c/c_instance.h: Added.
396         (KJS::Bindings::CInstance::getObject):
397         * bindings/c/c_runtime.cpp: Added.
398         (CField::valueFromInstance):
399         (CField::setValueToInstance):
400         * bindings/c/c_runtime.h: Added.
401         (KJS::Bindings::CField::CField):
402         (KJS::Bindings::CField::name):
403         (KJS::Bindings::CField::type):
404         (KJS::Bindings::CMethod::CMethod):
405         (KJS::Bindings::CMethod::name):
406         (KJS::Bindings::CMethod::numParameters):
407         * bindings/c/c_utility.cpp: Added.
408         (coerceValueToNPValueType):
409         (convertValueToNPValueType):
410         (convertNPValueTypeToValue):
411         * bindings/c/c_utility.h: Added.
412         * bindings/make_testbindings:
413         * bindings/runtime.cpp:
414         (Instance::createBindingForLanguageInstance):
415         * bindings/runtime.h:
416         (KJS::Bindings::Instance::):
417         * bindings/testbindings.cpp: Added.
418         (initializeIdentifiers):
419         (myInterfaceHasProperty):
420         (myInterfaceHasMethod):
421         (myInterfaceGetProperty):
422         (myInterfaceSetProperty):
423         (myInterfaceInvoke):
424         (myInterfaceAllocate):
425         (myInterfaceInvalidate):
426         (myInterfaceDeallocate):
427         (GlobalImp::className):
428         (readJavaScriptFromFile):
429         (main):
430
431 2004-03-10  Richard Williamson   <rjw@apple.com>
432
433         Made changes to support new asychronous approach to calls from
434         plugin to JavaScript
435
436         Reviewed by Chris.
437
438         * bindings/NP_jsobject.cpp:
439         (NP_Call):
440         (NP_Evaluate):
441         (NP_GetProperty):
442         (NP_ToString):
443         (NP_GetPropertyAtIndex):
444         * bindings/NP_runtime.h:
445         * bindings/make_testbindings:
446         * bindings/runtime.cpp:
447         (Instance::createBindingForLanguageInstance):
448
449 2004-03-10  Richard Williamson   <rjw@apple.com>
450
451         Updated header to include proposed changes from
452         plugin-futures list.  Calls from plugin to JavaScript
453         are now asynchronous.
454
455         Reviewed by Chris.
456
457         * bindings/NP_runtime.h:
458
459 === Safari-131 ===
460
461 2004-03-04  Richard Williamson   <rjw@apple.com>
462
463         Implementation of NP_JavaScriptObject.  This is the 'C' class
464         that wraps a JavaScript object.
465
466         Reviewed by Chris.
467
468         * JavaScriptCore.pbproj/project.pbxproj:
469         * bindings/NP_jsobject.cpp: Added.
470         (coerceValueToNPValueType):
471         (convertValueToNPValueType):
472         (convertNPValueTypeToValue):
473         (listFromNPArray):
474         (jsAllocate):
475         (jsDeallocate):
476         (identiferFromNPIdentifier):
477         (NP_Call):
478         (NP_Evaluate):
479         (NP_GetProperty):
480         (NP_SetProperty):
481         (NP_RemoveProperty):
482         (NP_ToString):
483         (NP_GetPropertyAtIndex):
484         (NP_SetPropertyAtIndex):
485         * bindings/NP_runtime.cpp:
486         (NP_ObjectAtIndex):
487         * bindings/NP_runtime.h:
488         * bindings/runtime_object.h:
489
490 2004-03-04  Richard Williamson   <rjw@apple.com>
491
492         Added NP_Array implementation.  
493
494         Changed NP_Boolean to just depend on two static instances, no
495         space is required for values.
496
497         Reviewed by Chris.
498
499         * bindings/NP_runtime.cpp:
500         (NP_CreateBoolean):
501         (NP_BoolFromBoolean):
502         (arrayAllocate):
503         (arrayDeallocate):
504         (NP_CreateArray):
505         (NP_CreateArrayV):
506         (NP_ObjectAtIndex):
507         * bindings/NP_runtime.h:
508
509 2004-03-03  Darin Adler  <darin@apple.com>
510
511         Reviewed by Vicki.
512
513         * English.lproj/InfoPlist.strings: Removed. No need to localize the version and
514         copyright string, and that's all that was in here.
515         * JavaScriptCore.pbproj/project.pbxproj: Removed InfoPlist.strings from build.
516
517 2004-03-03  Richard Williamson   <rjw@apple.com>
518
519         More 'C' binding implementation.  Fleshed out all the
520         'primitive' data types.
521
522         Reviewed by Chris.
523
524         * bindings/NP_runtime.cpp:
525         (NP_ReleaseObject):
526         (numberAllocate):
527         (stringAllocate):
528         (stringDeallocate):
529         (NP_CreateStringWithUTF8):
530         (NP_CreateStringWithUTF16):
531         (NP_UTF8FromString):
532         (NP_UTF16FromString):
533         (NP_StringLength):
534         (booleanAllocate):
535         (booleanDeallocate):
536         (NP_CreateBoolean):
537         (NP_BoolFromBoolean):
538         (nullAllocate):
539         (nullDeallocate):
540         (NP_GetNull):
541         (undefinedAllocate):
542         (undefinedDeallocate):
543         (NP_GetUndefined):
544         * bindings/NP_runtime.h:
545
546 2004-03-03  Richard Williamson   <rjw@apple.com>
547
548         More 'C' binding implementation.
549
550         Reviewed by Chris.
551
552         * bindings/NP_runtime.cpp:
553         (identifierEqual):
554         (identifierHash):
555         (getIdentifierDictionary):
556         (NP_IdentifierFromUTF8):
557         (NP_UTF8FromIdentifier):
558         (NP_CreateObject):
559         (NP_ReleaseObject):
560         (NP_IsKindOfClass):
561         (numberCreate):
562         (NP_CreateNumberWithInt):
563         (NP_CreateNumberWithFloat):
564         (NP_CreateNumberWithDouble):
565         (NP_IntFromNumber):
566         (NP_FloatFromNumber):
567         (NP_DoubleFromNumber):
568         * bindings/NP_runtime.h:
569
570 2004-03-02  Richard Williamson   <rjw@apple.com>
571
572         Removed retain/release from NP_Class.  Classes will not be allowed to implement their
573         own customer retain/release scheme.
574
575         Reviewed by Chris.
576
577         * bindings/NP_runtime.cpp:
578         (NP_RetainObject):
579         (NP_ReleaseObject):
580         * bindings/NP_runtime.h:
581
582 2004-03-02  Richard Williamson   <rjw@apple.com>
583
584         C binding API.  Partial implementation.
585
586         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.
587
588         Factored root object reference counting scheme.  It is now useful independent
589         of LiveConnect.
590
591         Reviewed by Chris.
592
593         * JavaScriptCore.pbproj/project.pbxproj:
594         * bindings/NP_runtime.cpp: Added.
595         (NP_IdentifierFromUTF8):
596         (NP_GetIdentifiers):
597         (NP_UTF8FromIdentifier):
598         (NP_CreateObject):
599         (NP_RetainObject):
600         (NP_ReleaseObject):
601         (NP_IsKindOfClass):
602         (NP_SetException):
603         (NP_Call):
604         (NP_Evaluate):
605         (NP_GetProperty):
606         (NP_SetProperty):
607         (NP_RemoveProperty):
608         (NP_ToString):
609         (NP_GetPropertyAtIndex):
610         (NP_SetPropertyAtIndex):
611         (NP_CreateNumberWithInt):
612         (NP_CreateNumberWithFloat):
613         (NP_CreateNumberWithDouble):
614         (NP_IntFromNumber):
615         (NP_FloatFromNumber):
616         (NP_DoubleFromNumber):
617         (NP_CreateStringWithUTF8):
618         (NP_CreateStringWithUTF16):
619         (NP_UTF8FromString):
620         (NP_UTF16FromString):
621         (NP_CreateBoolean):
622         (NP_BoolFromBoolean):
623         (NP_GetNull):
624         (NP_GetUndefined):
625         (NP_CreateArray):
626         (NP_CreateArrayV):
627         (NP_ObjectAtIndex):
628         * bindings/NP_runtime.h: Added.
629         * bindings/jni/jni_jsobject.cpp:
630         (JSObject::invoke):
631         (JSObject::finalize):
632         (JSObject::createNative):
633         (JSObject::convertValueToJObject):
634         * bindings/jni/jni_jsobject.h:
635         * bindings/objc/objc_jsobject.h:
636         * bindings/objc/objc_jsobject.mm:
637         (rootForView):
638         (windowJavaScriptObject):
639         (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
640         (-[JavaScriptObject dealloc]):
641         (-[JavaScriptObject _convertValueToObjcValue:KJS::]):
642         (-[JavaScriptObject call:arguments:]):
643         (-[JavaScriptObject evaluate:]):
644         (-[JavaScriptObject getMember:]):
645         (-[JavaScriptObject setMember:value:]):
646         (-[JavaScriptObject removeMember:]):
647         (-[JavaScriptObject toString]):
648         (-[JavaScriptObject getSlot:]):
649         (-[JavaScriptObject setSlot:value:]):
650         * bindings/objc/objc_utility.h:
651         * bindings/objc/objc_utility.mm:
652         (KJS::Bindings::convertValueToObjcValue):
653         * bindings/runtime_root.cpp: Added.
654         (getReferencesByRootDictionary):
655         (getReferencesDictionary):
656         (KJS::Bindings::findReferenceDictionary):
657         (KJS::Bindings::rootForImp):
658         (KJS::Bindings::addNativeReference):
659         (KJS::Bindings::removeNativeReference):
660         (completedJavaScriptAccess):
661         (initializeJavaScriptAccessLock):
662         (lockJavaScriptAccess):
663         (unlockJavaScriptAccess):
664         (RootObject::dispatchToJavaScriptThread):
665         (performJavaScriptAccess):
666         (RootObject::setFindRootObjectForNativeHandleFunction):
667         (RootObject::removeAllNativeReferences):
668         * bindings/runtime_root.h: Added.
669         (KJS::Bindings::RootObject::RootObject):
670         (KJS::Bindings::RootObject::~RootObject):
671         (KJS::Bindings::RootObject::setRootObjectImp):
672         (KJS::Bindings::RootObject::rootObjectImp):
673         (KJS::Bindings::RootObject::setInterpreter):
674         (KJS::Bindings::RootObject::interpreter):
675         (KJS::Bindings::RootObject::findRootObjectForNativeHandleFunction):
676         (KJS::Bindings::RootObject::runLoop):
677         (KJS::Bindings::RootObject::performJavaScriptSource):
678
679 === Safari-130 ===
680
681 === Safari-129 ===
682
683 2004-02-18  Richard Williamson   <rjw@apple.com>
684
685         Added NSNumber/Number conversion.
686
687         Removed some unnecessary KJS:: namespace specifiers.
688
689         Reviewed by Ken.
690
691         * bindings/objc/objc_utility.mm:
692         (KJS::Bindings::convertValueToObjcValue):
693         (KJS::Bindings::convertObjcValueToValue):
694         * bindings/runtime_array.h:
695
696 2004-02-18  Richard Williamson   <rjw@apple.com>
697
698         Added support for export NSArrays.
699
700         Updated valueAt() to take an ExecState so we can throw
701         JS exceptions.
702
703         Implemented excludeSelectorFromJavaScript: in ObjcClass.  This allows
704         ObjectiveC classes to control the visibility of their methods in 
705         JavaScript.
706
707         Reviewed by Ken.
708
709         * bindings/jni/jni_runtime.cpp:
710         (JavaField::valueFromInstance):
711         (JavaArray::valueAt):
712         * bindings/jni/jni_runtime.h:
713         * bindings/objc/objc_class.mm:
714         (ObjcClass::methodsNamed):
715         * bindings/objc/objc_runtime.h:
716         (KJS::Bindings::ObjcArray::getObjcArray):
717         * bindings/objc/objc_runtime.mm:
718         (ObjcField::valueFromInstance):
719         (ObjcField::setValueToInstance):
720         (ObjcArray::ObjcArray):
721         (ObjcArray::~ObjcArray):
722         (ObjcArray::operator=):
723         (ObjcArray::setValueAt):
724         (ObjcArray::valueAt):
725         (ObjcArray::getLength):
726         * bindings/objc/objc_utility.mm:
727         (KJS::Bindings::convertValueToObjcValue):
728         (KJS::Bindings::convertObjcValueToValue):
729         * bindings/runtime.cpp:
730         (Instance::getValueOfField):
731         * bindings/runtime.h:
732         * bindings/runtime_array.cpp:
733         (RuntimeArrayImp::get):
734         * bindings/runtime_object.cpp:
735         (RuntimeObjectImp::get):
736
737 2004-02-17  Richard Williamson   <rjw@apple.com>
738
739         Added String <-> NSString conversion.
740         Added tests of String <-> NSString conversion to test program.
741
742         Reviewed by Chris.
743
744         * bindings/objc/objc_utility.mm:
745         (KJS::Bindings::convertValueToObjcValue):
746         (KJS::Bindings::convertObjcValueToValue):
747         * bindings/test.js:
748         * bindings/testbindings.mm:
749         (-[MyFirstInterface getString]):
750
751 2004-02-15  Darin Adler  <darin@apple.com>
752
753         Reviewed by Dave.
754
755         * JavaScriptCore.pbproj/project.pbxproj: Tweak build styles a bit, fixing OptimizedWithSymbols,
756         and removing redundant settings of things that match defaults in other build styles.
757
758 2004-02-13  Richard Williamson   <rjw@apple.com>
759
760         Work towards the JavaScript ObjC bindings.  The bindings now work for 
761         simple scalar types.  testbindings.mm is an illustration of how the 
762         bindings work.
763
764         Reviewed by Ken.
765
766         * JavaScriptCore.pbproj/project.pbxproj:
767         * Makefile.am:
768         * bindings/jni/jni_class.cpp:
769         (JavaClass::methodsNamed):
770         * bindings/jni/jni_class.h:
771         * bindings/jni/jni_instance.cpp:
772         (JavaInstance::invokeMethod):
773         * bindings/jni/jni_instance.h:
774         * bindings/jni/jni_runtime.h:
775         (KJS::Bindings::JavaMethod::returnType):
776         * bindings/make_testbindings: Added.
777         * bindings/objc/objc_class.h: Added.
778         (KJS::Bindings::ObjcClass::~ObjcClass):
779         (KJS::Bindings::ObjcClass::ObjcClass):
780         (KJS::Bindings::ObjcClass::operator=):
781         (KJS::Bindings::ObjcClass::constructorAt):
782         (KJS::Bindings::ObjcClass::numConstructors):
783         * bindings/objc/objc_class.mm: Added.
784         (ObjcClass::_commonDelete):
785         (ObjcClass::_commonCopy):
786         (ObjcClass::_commonInit):
787         (_createClassesByIsAIfNecessary):
788         (ObjcClass::classForIsA):
789         (ObjcClass::ObjcClass):
790         (ObjcClass::name):
791         (ObjcClass::methodsNamed):
792         (ObjcClass::fieldNamed):
793         * bindings/objc/objc_header.h: Added.
794         * bindings/objc/objc_instance.h: Added.
795         (KJS::Bindings::ObjcInstance::getObject):
796         * bindings/objc/objc_instance.mm: Added.
797         (ObjcInstance::ObjcInstance):
798         (ObjcInstance::~ObjcInstance):
799         (ObjcInstance::operator=):
800         (ObjcInstance::begin):
801         (ObjcInstance::end):
802         (ObjcInstance::getClass):
803         (ObjcInstance::invokeMethod):
804         (ObjcInstance::defaultValue):
805         (ObjcInstance::stringValue):
806         (ObjcInstance::numberValue):
807         (ObjcInstance::booleanValue):
808         (ObjcInstance::valueOf):
809         * bindings/objc/objc_jsobject.h: Added.
810         * bindings/objc/objc_jsobject.mm: Added.
811         * bindings/objc/objc_runtime.h:
812         (KJS::Bindings::ObjcField::~ObjcField):
813         (KJS::Bindings::ObjcField::ObjcField):
814         (KJS::Bindings::ObjcField::operator=):
815         (KJS::Bindings::ObjcMethod::ObjcMethod):
816         (KJS::Bindings::ObjcMethod::~ObjcMethod):
817         (KJS::Bindings::ObjcMethod::operator=):
818         * bindings/objc/objc_runtime.mm: Added.
819         (ObjcMethod::ObjcMethod):
820         (ObjcMethod::name):
821         (ObjcMethod::numParameters):
822         (ObjcMethod::getMethodSignature):
823         (ObjcField::ObjcField):
824         (ObjcField::name):
825         (ObjcField::type):
826         (ObjcField::valueFromInstance):
827         (ObjcField::setValueToInstance):
828         * bindings/objc/objc_utility.h: Added.
829         (KJS::Bindings::):
830         * bindings/objc/objc_utility.mm: Added.
831         (KJS::Bindings::JSMethodNameToObjCMethodName):
832         (KJS::Bindings::convertValueToObjcValue):
833         (KJS::Bindings::convertObjcValueToValue):
834         (KJS::Bindings::objcValueTypeForType):
835         * bindings/runtime.cpp:
836         (MethodList::MethodList):
837         (MethodList::operator=):
838         (Instance::setValueOfField):
839         (Instance::createBindingForLanguageInstance):
840         (Instance::createRuntimeObject):
841         * bindings/runtime.h:
842         * bindings/runtime_method.cpp:
843         (RuntimeMethodImp::RuntimeMethodImp):
844         (RuntimeMethodImp::get):
845         (RuntimeMethodImp::call):
846         * bindings/runtime_method.h:
847         * bindings/runtime_object.cpp:
848         (RuntimeObjectImp::get):
849         (RuntimeObjectImp::hasProperty):
850         * bindings/test.js: Added.
851         * bindings/testbindings.mm: Added.
852         (-[MySecondInterface init]):
853         (-[MyFirstInterface init]):
854         (-[MyFirstInterface dealloc]):
855         (+[MyFirstInterface JavaScriptNameForSelector:]):
856         (-[MyFirstInterface getInt]):
857         (-[MyFirstInterface setInt:]):
858         (-[MyFirstInterface getMySecondInterface]):
859         (-[MyFirstInterface logMessage:]):
860         (GlobalImp::className):
861         (readJavaScriptFromFile):
862         (main):
863
864 === Safari-128 ===
865
866 2004-02-08  Darin Adler  <darin@apple.com>
867
868         Reviewed by Dave.
869
870         - fixed things seen in the profile, for a total speedup of 4% on cvs-base (including changes across all projects)
871
872         * JavaScriptCorePrefix.h: Add a workaround for a bug in our system headers that prevents the <ctype.h>
873         macros from working right in C++ code that uses the <cctype> header.
874
875         * kjs/ustring.cpp:
876         (KJS::inlineUTF8SequenceLengthNonASCII): Added.
877         (KJS::UTF8SequenceLengthNonASCII): Added.
878         (KJS::inlineUTF8SequenceLength): Added.
879         (KJS::UTF8SequenceLength): Calls inlineUTF8SequenceLengthNonASCII now.
880         (KJS::decodeUTF8Sequence): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
881         (KJS::createSortedOffsetsArray): Add special case for 1, 2, and 3 offsets, so we don't do qsort for those.
882         (KJS::convertUTF16OffsetsToUTF8Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
883         (KJS::convertUTF8OffsetsToUTF16Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
884
885         - fixed the test program so it won't hit the interpreter lock assertion
886
887         * kjs/testkjs.cpp: (main): Just lock around the whole thing, since the test is singly threaded.
888
889 === Safari-127 ===
890
891 2004-02-06  Richard Williamson   <rjw@apple.com>
892
893         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.
894
895         Reviewed by John.
896
897         * bindings/jni/jni_jsobject.cpp:
898         (JSObject::toString):
899         * bindings/jni/jni_utility.cpp:
900         (KJS::Bindings::convertValueToJValue):
901
902 2004-02-02  Darin Adler  <darin@apple.com>
903
904         Reviewed by Maciej.
905
906         - fixed <rdar://problem/3546613>: array of negative size leads to crash (test page at oscar.the-rileys.net)
907
908         * kjs/array_object.cpp:
909         (ArrayInstanceImp::ArrayInstanceImp): If the length is greater than 10,000, don't allocate an array until
910         we start putting values in. This prevents new Array(2147483647) from causing trouble.
911         (ArrayObjectImp::construct): Check number as described in specification, and raise a range error if the
912         number is out of range. This prevents new Array(-1) from causing trouble.
913
914         - fixed <rdar://problem/3545756>: Math.round screws up on numbers bigger than 2^31 (incorrect results on HP-35 calculator page)
915
916         * kjs/math_object.cpp: (MathFuncImp::call): Change implementation to be much simpler and not involve
917         casting to int. Results now match those in other browsers.
918
919 2004-02-02  Darin Adler  <darin@apple.com>
920
921         Reviewed by Maciej.
922
923         - fixed <rdar://problem/3519285>: integer operations on large negative numbers yield bad results (discovered with "HTMLCrypt")
924         - fixed other related overflow issues
925
926         * kjs/value.h: Changed return types of toInteger, toInt32, toUInt32, and toUInt16.
927         * kjs/value.cpp:
928         (ValueImp::toInteger): Change to return a double, since this operation, from the ECMA specification,
929         must not restrict values to the range of a particular integer type.
930         (ValueImp::toInt32): Used a sized integer type for the result of this function, and also added
931         proper handling for negative results from fmod.
932         (ValueImp::toUInt32): Ditto.
933         (ValueImp::toUInt16): Ditto.
934         (ValueImp::dispatchToUInt32): Changed result type from unsigned to uint32_t.
935
936         * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Use a double instead of an int to handle
937         out-of-integer-range values better in the slice function.
938         * kjs/internal.cpp: (KJS::roundValue): Streamline the function, handling NAN and infinity properly.
939         * kjs/number_object.cpp: (NumberProtoFuncImp::call): Use a double instead of an int to handle
940         out-of-integer-range values better in the toString function.
941         * kjs/string_object.cpp: (StringProtoFuncImp::call): Use a double instead of an int to handle
942         out-of-integer-range values better in the charAt, charCodeAt, indexOf, lastIndexOf, slice,
943         and substr functions.
944
945 === Safari-126 ===
946
947 2004-01-30  Richard Williamson   <rjw@apple.com>
948
949         Fixed 3542044.  Create KJS::String using UString constructor instead of passing UTF8 string to char* constructor.
950
951         Reviewed by Darin.
952
953         * bindings/jni/jni_instance.cpp:
954         (JavaInstance::stringValue):
955
956 2004-01-26  Darin Adler  <darin@apple.com>
957
958         * Makefile.am: Switch from pbxbuild to xcodebuild.
959
960 2004-01-22  Richard Williamson   <rjw@apple.com>
961
962         Added stubs for ObjC language binding to JavaScript.
963
964         * JavaScriptCore.pbproj/project.pbxproj:
965         * bindings/jni/jni_runtime.h:
966         * bindings/objc/objc_runtime.h: Added.
967         (KJS::Bindings::ObjcParameter::ObjcParameter):
968         (KJS::Bindings::ObjcParameter::~ObjcParameter):
969         (KJS::Bindings::ObjcParameter::operator=):
970         (KJS::Bindings::ObjcParameter::type):
971         (KJS::Bindings::ObjcConstructor::ObjcConstructor):
972         (KJS::Bindings::ObjcConstructor::~ObjcConstructor):
973         (KJS::Bindings::ObjcConstructor::_commonCopy):
974         (KJS::Bindings::ObjcConstructor::operator=):
975         (KJS::Bindings::ObjcConstructor::value):
976         (KJS::Bindings::ObjcConstructor::parameterAt):
977         (KJS::Bindings::ObjcConstructor::numParameters):
978         (KJS::Bindings::ObjcField::ObjcField):
979         (KJS::Bindings::ObjcField::~ObjcField):
980         * bindings/runtime.h:
981
982 2004-01-22  Richard Williamson   <rjw@apple.com>
983
984         Simplified JavaString by using UString as backing store.  This
985         revealed a bug in CString's assignment operator which I fixed.
986
987         Removed some dead code.
988  
989         Reviewed by John.
990
991         * bindings/jni/jni_runtime.h:
992         (KJS::Bindings::JavaString::JavaString):
993         (KJS::Bindings::JavaString::_commonInit):
994         (KJS::Bindings::JavaString::UTF8String):
995         (KJS::Bindings::JavaString::uchars):
996         (KJS::Bindings::JavaString::length):
997         (KJS::Bindings::JavaString::ustring):
998         * bindings/runtime_object.cpp:
999         (RuntimeObjectImp::RuntimeObjectImp):
1000         * bindings/runtime_object.h:
1001         * kjs/ustring.cpp:
1002         (KJS::CString::CString):
1003         (KJS::CString::operator=):
1004
1005 === Safari-125 ===
1006
1007 === Safari-124 ===
1008
1009 2004-01-16  Richard Williamson   <rjw@apple.com>
1010
1011         Fixed 3525853.  We weren't handling mapping to overloaded Java
1012         methods very well.  Even though this is undefined the other
1013         browsers support it.  Also fixed a bug with returning arrays
1014         from Java functions.
1015
1016         Reviewed by John.
1017
1018         * bindings/jni/jni_class.cpp:
1019         (JavaClass::_commonInit):
1020         (JavaClass::methodsNamed):
1021         * bindings/jni/jni_class.h:
1022         * bindings/jni/jni_instance.cpp:
1023         (JavaInstance::invokeMethod):
1024         * bindings/jni/jni_instance.h:
1025         * bindings/jni/jni_runtime.cpp:
1026         (JavaArray::convertJObjectToArray):
1027         (JavaField::valueFromInstance):
1028         (JavaMethod::signature):
1029         (JavaArray::valueAt):
1030         * bindings/jni/jni_runtime.h:
1031         * bindings/jni_jsobject.cpp:
1032         (JSObject::call):
1033         (JSObject::convertJObjectToValue):
1034         * bindings/runtime.cpp:
1035         (MethodList::addMethod):
1036         (MethodList::length):
1037         (MethodList::methodAt):
1038         (MethodList::~MethodList):
1039         * bindings/runtime.h:
1040         (KJS::Bindings::MethodList::MethodList):
1041         * bindings/runtime_method.cpp:
1042         (RuntimeMethodImp::RuntimeMethodImp):
1043         (RuntimeMethodImp::get):
1044         (RuntimeMethodImp::call):
1045         * bindings/runtime_method.h:
1046         * bindings/runtime_object.cpp:
1047         (RuntimeObjectImp::get):
1048         (RuntimeObjectImp::hasProperty):
1049
1050 2004-01-16  Richard Williamson   <rjw@apple.com>
1051
1052         Fixed 3531229.  Another place that needs the  Push/PopLocalFrame
1053         protection implemented for 3530401.
1054
1055         Reviewed by John.
1056
1057         * bindings/runtime_method.cpp:
1058         (RuntimeMethodImp::call):
1059
1060 2004-01-15  Richard Williamson   <rjw@apple.com>
1061
1062         Fixed 3530401.  JNI doesn't cleanup local refs created on the
1063         main thread.   IMO this is a bad bug in our JMI implementation.
1064
1065         To work-around the problem I explicitly delete all local refs.
1066         Further, I've added Push/PopLocalFrame calls to catch any refs
1067         that I may have missed.  This will guarantee that we don't leak
1068         any Java references.
1069
1070         Reviewed by John.
1071
1072         * bindings/jni/jni_class.cpp:
1073         (JavaClass::_commonInit):
1074         (JavaClass::JavaClass):
1075         * bindings/jni/jni_instance.cpp:
1076         (JavaInstance::begin):
1077         (JavaInstance::end):
1078         * bindings/jni/jni_instance.h:
1079         * bindings/jni/jni_runtime.cpp:
1080         (JavaConstructor::JavaConstructor):
1081         (JavaMethod::JavaMethod):
1082         * bindings/jni_jsobject.cpp:
1083         (JSObject::listFromJArray):
1084         * bindings/runtime.h:
1085         (KJS::Bindings::Instance::begin):
1086         (KJS::Bindings::Instance::end):
1087         * bindings/runtime_object.cpp:
1088         (RuntimeObjectImp::get):
1089         (RuntimeObjectImp::put):
1090         (RuntimeObjectImp::canPut):
1091         (RuntimeObjectImp::hasProperty):
1092         (RuntimeObjectImp::defaultValue):
1093
1094 2004-01-15  Vicki Murley  <vicki@apple.com>
1095
1096         Reviewed by Darin.
1097
1098         * JavaScriptCore.pbproj/project.pbxproj: Update copyright date to 2004.
1099
1100 2004-01-14  Richard Williamson   <rjw@apple.com>
1101         
1102         Fixed 3529466.  With recent changes to Java plugin we must no
1103         longer call DeleteLocalRef().  Not a problem, it was an optimization anyway.
1104
1105         Reviewed by John.
1106
1107         * bindings/jni/jni_instance.cpp:
1108         (JObjectWrapper::JObjectWrapper):
1109
1110 === Safari-122 ===
1111
1112 2004-01-14  Richard Williamson   <rjw@apple.com>
1113
1114         Fixed 3529010.
1115
1116         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.
1117
1118         Reviewed by John.
1119
1120         * bindings/jni_jsobject.cpp:
1121         (addJavaReference):
1122         (removeJavaReference):
1123         (RootObject::removeAllJavaReferencesForRoot):
1124         (JSObject::invoke):
1125
1126 2004-01-13  Richard Williamson   <rjw@apple.com>
1127
1128         Fixed 3528324. 
1129
1130         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.
1131
1132         Reviewed by Hyatt.
1133
1134         * bindings/jni_jsobject.h:
1135         (KJS::Bindings::RootObject::~RootObject):
1136
1137 === Safari-121 ===
1138
1139 === Safari-120 ===
1140
1141 2004-01-06  Richard Williamson   <rjw@apple.com>
1142
1143         Fixed 3521814.  Finalize messages weren't being dispatched!
1144
1145         Reviewed by John.
1146
1147         * bindings/jni_jsobject.cpp:
1148         (JSObject::invoke):
1149
1150 2004-01-05  Richard Williamson   <rjw@apple.com>
1151
1152         Added cache of JNI method IDs to minimize allocations.  This mitigates the problem
1153         described by 3515579.
1154
1155         Also cleanup up logging of Java exceptions.
1156
1157         Reviewed by John.
1158
1159         * bindings/jni/jni_class.cpp:
1160         (JavaClass::classForInstance):
1161         * bindings/jni/jni_instance.cpp:
1162         (JavaInstance::JavaInstance):
1163         (JavaInstance::getClass):
1164         (JavaInstance::invokeMethod):
1165         (JObjectWrapper::JObjectWrapper):
1166         (JObjectWrapper::~JObjectWrapper):
1167         * bindings/jni/jni_instance.h:
1168         (KJS::Bindings::JavaInstance::operator=):
1169         * bindings/jni/jni_runtime.cpp:
1170         (JavaMethod::JavaMethod):
1171         (JavaMethod::methodID):
1172         * bindings/jni/jni_runtime.h:
1173         (KJS::Bindings::JavaMethod::JavaMethod):
1174         * bindings/jni/jni_utility.cpp:
1175         (callJNIMethod):
1176         (callJNIMethodIDA):
1177         (callJNIMethodA):
1178         (KJS::Bindings::getMethodID):
1179         (KJS::Bindings::callJNIVoidMethodIDA):
1180         (KJS::Bindings::callJNIObjectMethodIDA):
1181         (KJS::Bindings::callJNIByteMethodIDA):
1182         (KJS::Bindings::callJNICharMethodIDA):
1183         (KJS::Bindings::callJNIShortMethodIDA):
1184         (KJS::Bindings::callJNIIntMethodIDA):
1185         (KJS::Bindings::callJNILongMethodIDA):
1186         (KJS::Bindings::callJNIFloatMethodIDA):
1187         (KJS::Bindings::callJNIDoubleMethodIDA):
1188         (KJS::Bindings::callJNIBooleanMethodIDA):
1189         (KJS::Bindings::getCharactersFromJStringInEnv):
1190         (KJS::Bindings::getUCharactersFromJStringInEnv):
1191         (KJS::Bindings::getJNIField):
1192         * bindings/jni/jni_utility.h:
1193
1194 l2003-12-23  John Sullivan  <sullivan@apple.com>
1195
1196         * JavaScriptCore.pbproj/project.pbxproj:
1197         Xcode version wars, harmless
1198
1199 2003-12-23  Darin Adler  <darin@apple.com>
1200
1201         Reviewed by John (concept, not code, which is just the old code coming back).
1202
1203         - fixed 3518092: REGRESSION (100-119): getting NaN instead of HH:MM times
1204
1205         * kjs/date_object.cpp: Added back our CF-based implementations of gmtime, localtime,
1206         mktime, timegm, and time, because mktime, at least, won't handle a year of 0.
1207
1208 2003-12-19  Richard Williamson   <rjw@apple.com>
1209
1210         Fixed 3515597.  When an error occurs we need
1211         to make sure result values are zeroed.
1212
1213         Cleaned up logs by adding a newline.
1214
1215         Reviewed by John.
1216
1217         * bindings/jni/jni_utility.cpp:
1218         (KJS::Bindings::getJavaVM):
1219         (KJS::Bindings::getJNIEnv):
1220         (callJNIMethod):
1221         (callJNIMethodA):
1222         (KJS::Bindings::getJNIField):
1223         * bindings/jni_jsobject.cpp:
1224         (JSObject::convertValueToJObject):
1225
1226 === Safari-119 ===
1227
1228 2003-12-17  Richard Williamson   <rjw@apple.com>
1229
1230         Ensure that all the symbols we export are in the KJS
1231         namespace (3512245).
1232
1233         Also renamed JavaString.characters() to JavaString.UTF8String()
1234         for enhanced clarity.
1235
1236         Added some sanity checking to constructor of JObjectWrapper.
1237
1238         Reviewed by Dave.
1239
1240         * ChangeLog:
1241         * bindings/jni/jni_class.cpp:
1242         * bindings/jni/jni_class.h:
1243         * bindings/jni/jni_instance.cpp:
1244         (JavaInstance::invokeMethod):
1245         (JObjectWrapper::JObjectWrapper):
1246         * bindings/jni/jni_instance.h:
1247         * bindings/jni/jni_runtime.cpp:
1248         (JavaParameter::JavaParameter):
1249         (JavaField::JavaField):
1250         (JavaMethod::JavaMethod):
1251         (JavaMethod::signature):
1252         * bindings/jni/jni_runtime.h:
1253         (KJS::Bindings::JavaString::ascii):
1254         (KJS::Bindings::JavaString::UTF8String):
1255         (KJS::Bindings::JavaString::JavaString):
1256         (KJS::Bindings::JavaString::_commonInit):
1257         (KJS::Bindings::JavaString::uchars):
1258         (KJS::Bindings::JavaString::length):
1259         (KJS::Bindings::JavaString::ustring):
1260         (KJS::Bindings::JavaParameter::type):
1261         (KJS::Bindings::JavaField::name):
1262         (KJS::Bindings::JavaField::type):
1263         (KJS::Bindings::JavaMethod::name):
1264         (KJS::Bindings::JavaMethod::returnType):
1265         * bindings/jni/jni_utility.cpp:
1266         (KJS::Bindings::getJavaVM):
1267         (KJS::Bindings::getJNIEnv):
1268         (KJS::Bindings::callJNIVoidMethod):
1269         (KJS::Bindings::callJNIObjectMethod):
1270         (KJS::Bindings::callJNIBooleanMethod):
1271         (KJS::Bindings::callJNIByteMethod):
1272         (KJS::Bindings::callJNICharMethod):
1273         (KJS::Bindings::callJNIShortMethod):
1274         (KJS::Bindings::callJNIIntMethod):
1275         (KJS::Bindings::callJNILongMethod):
1276         (KJS::Bindings::callJNIFloatMethod):
1277         (KJS::Bindings::callJNIDoubleMethod):
1278         (KJS::Bindings::callJNIVoidMethodA):
1279         (KJS::Bindings::callJNIObjectMethodA):
1280         (KJS::Bindings::callJNIByteMethodA):
1281         (KJS::Bindings::callJNICharMethodA):
1282         (KJS::Bindings::callJNIShortMethodA):
1283         (KJS::Bindings::callJNIIntMethodA):
1284         (KJS::Bindings::callJNILongMethodA):
1285         (KJS::Bindings::callJNIFloatMethodA):
1286         (KJS::Bindings::callJNIDoubleMethodA):
1287         (KJS::Bindings::callJNIBooleanMethodA):
1288         (KJS::Bindings::getCharactersFromJString):
1289         (KJS::Bindings::releaseCharactersForJString):
1290         (KJS::Bindings::getCharactersFromJStringInEnv):
1291         (KJS::Bindings::releaseCharactersForJStringInEnv):
1292         (KJS::Bindings::getUCharactersFromJStringInEnv):
1293         (KJS::Bindings::releaseUCharactersForJStringInEnv):
1294         (KJS::Bindings::JNITypeFromClassName):
1295         (KJS::Bindings::signatureFromPrimitiveType):
1296         (KJS::Bindings::JNITypeFromPrimitiveType):
1297         (KJS::Bindings::getJNIField):
1298         (KJS::Bindings::convertValueToJValue):
1299         * bindings/jni/jni_utility.h:
1300         * bindings/jni_jsobject.cpp:
1301         (KJS::Bindings::JSObject::invoke):
1302         (KJS::Bindings::JSObject::JSObject):
1303         (KJS::Bindings::JSObject::call):
1304         (KJS::Bindings::JSObject::eval):
1305         (KJS::Bindings::JSObject::getMember):
1306         (KJS::Bindings::JSObject::setMember):
1307         (KJS::Bindings::JSObject::removeMember):
1308         (KJS::Bindings::JSObject::getSlot):
1309         (KJS::Bindings::JSObject::setSlot):
1310         (KJS::Bindings::JSObject::toString):
1311         (KJS::Bindings::JSObject::finalize):
1312         (KJS::Bindings::JSObject::createNative):
1313         (KJS::Bindings::JSObject::convertValueToJObject):
1314         (KJS::Bindings::JSObject::convertJObjectToValue):
1315         (KJS::Bindings::JSObject::listFromJArray):
1316         * bindings/jni_jsobject.h:
1317         * bindings/runtime.cpp:
1318         * bindings/runtime.h:
1319         * bindings/runtime_method.cpp:
1320         * bindings/runtime_method.h:
1321
1322 === Safari-118 ===
1323
1324 2003-12-16  Richard Williamson   <rjw@apple.com>
1325
1326         Ack!  More assertions.  Lock ALL entry points into the interpreter!
1327         (3511733).
1328
1329         Reviewed by Ken.
1330
1331         * bindings/jni_jsobject.cpp:
1332         (Bindings::JSObject::call):
1333         (Bindings::JSObject::eval):
1334         (Bindings::JSObject::getMember):
1335         (Bindings::JSObject::setMember):
1336         (Bindings::JSObject::removeMember):
1337         (Bindings::JSObject::getSlot):
1338         (Bindings::JSObject::setSlot):
1339         (Bindings::JSObject::convertJObjectToValue):
1340
1341 2003-12-15  Richard Williamson   <rjw@apple.com>
1342
1343         Fixed a couple of snafus and removed some logging.
1344
1345         Reviewed by Maciej.
1346
1347         * bindings/jni_jsobject.cpp:
1348         (Bindings::performJavaScriptAccess):
1349         (Bindings::completedJavaScriptAccess):
1350         (Bindings::dispatchToJavaScriptThread):
1351         Removed some annoying JS_LOG clutter.
1352
1353         (Bindings::RootObject::removeAllJavaReferencesForRoot):
1354         Fixed allocation of key buffer that was called after it was needed.
1355
1356         (Bindings::JSObject::invoke):
1357         (Bindings::JSObject::JSObject):
1358         (Bindings::JSObject::getMember):
1359         (Bindings::JSObject::getSlot):
1360         Added additional interpreter locks around getMember and getSlot. 
1361         These functions may cause allocation of JS impls.  
1362
1363 2003-12-15  Richard Williamson   <rjw@apple.com>
1364
1365         args weren't passed to 'call' invocation.  d'oh.
1366         lock interpreter when we create instances of JS impls.  
1367
1368         Reviewed by Maciej.
1369
1370         * bindings/jni_jsobject.cpp:
1371         (Bindings::JSObject::call):
1372         (Bindings::JSObject::eval):
1373         (Bindings::JSObject::getMember):
1374         (Bindings::JSObject::setMember):
1375         (Bindings::JSObject::getSlot):
1376         (Bindings::JSObject::convertValueToJObject):
1377         (Bindings::JSObject::convertJObjectToValue):
1378         (Bindings::JSObject::listFromJArray):
1379         * bindings/jni_jsobject.h:
1380
1381 2003-12-15  Richard Williamson   <rjw@apple.com>
1382
1383         Last piece of LiveConnect!  This checkin adds implementation
1384         of the Java to JavaScript object conversion functions.
1385
1386         Reviewed by John.
1387
1388         * bindings/jni/jni_instance.cpp:
1389         (JavaInstance::invokeMethod):
1390         * bindings/jni/jni_utility.cpp:
1391         * bindings/jni/jni_utility.h:
1392         * bindings/jni_jsobject.cpp:
1393         (Bindings::JSObject::invoke):
1394         (Bindings::JSObject::call):
1395         (Bindings::JSObject::eval):
1396         (Bindings::JSObject::getMember):
1397         (Bindings::JSObject::setMember):
1398         (Bindings::JSObject::getSlot):
1399         (Bindings::JSObject::setSlot):
1400         (Bindings::JSObject::createNative):
1401         (Bindings::JSObject::convertValueToJObject):
1402         (Bindings::JSObject::convertJObjectToValue):
1403         (Bindings::JSObject::listFromJArray):
1404         * bindings/jni_jsobject.h:
1405         (Bindings::):
1406         * bindings/runtime_method.cpp:
1407         (RuntimeMethodImp::get):
1408         (RuntimeMethodImp::codeType):
1409         (RuntimeMethodImp::execute):
1410
1411 2003-12-12  Richard Williamson   <rjw@apple.com>
1412
1413         Added implementation of stubs in JSObject.  All that
1414         remains is a couple of simple conversion functions stubs and
1415         we're done with LiveConnect.  Also, changed string passing to
1416         JS to use uchars instead of chars.  
1417
1418         Reviewed by Maciej.
1419
1420         * bindings/jni/jni_runtime.h:
1421         (Bindings::JavaString::JavaString):
1422         (Bindings::JavaString::_commonInit):
1423         (Bindings::JavaString::_commonCopy):
1424         (Bindings::JavaString::_commonDelete):
1425         (Bindings::JavaString::~JavaString):
1426         (Bindings::JavaString::operator=):
1427         (Bindings::JavaString::uchars):
1428         (Bindings::JavaString::length):
1429         (Bindings::JavaString::ustring):
1430         * bindings/jni/jni_utility.cpp:
1431         (getUCharactersFromJStringInEnv):
1432         (releaseUCharactersForJStringInEnv):
1433         (convertValueToJObject):
1434         (convertJObjectToValue):
1435         * bindings/jni/jni_utility.h:
1436         * bindings/jni_jsobject.cpp:
1437         (Bindings::JSObject::invoke):
1438         (Bindings::JSObject::call):
1439         (Bindings::JSObject::eval):
1440         (Bindings::JSObject::getMember):
1441         (Bindings::JSObject::setMember):
1442         (Bindings::JSObject::removeMember):
1443         (Bindings::JSObject::getSlot):
1444         (Bindings::JSObject::setSlot):
1445         * bindings/jni_jsobject.h:
1446
1447 2003-12-12  Richard Williamson   <rjw@apple.com>
1448
1449         Ensure that all calls from Java into JavaScript are
1450         performed on a designated thread (the main thread).
1451
1452         Reviewed by Ken.
1453
1454         * bindings/jni_jsobject.cpp:
1455         (isJavaScriptThread):
1456         (rootForImp):
1457         (Bindings::performJavaScriptAccess):
1458         (Bindings::completedJavaScriptAccess):
1459         (Bindings::initializeJavaScriptAccessLock):
1460         (Bindings::lockJavaScriptAccess):
1461         (Bindings::unlockJavaScriptAccess):
1462         (Bindings::dispatchToJavaScriptThread):
1463         (Bindings::RootObject::setFindRootObjectForNativeHandleFunction):
1464         (Bindings::RootObject::removeAllJavaReferencesForRoot):
1465         (Bindings::JSObject::invoke):
1466         (Bindings::JSObject::JSObject):
1467         (Bindings::JSObject::call):
1468         (Bindings::JSObject::eval):
1469         (Bindings::JSObject::getMember):
1470         (Bindings::JSObject::setMember):
1471         (Bindings::JSObject::removeMember):
1472         (Bindings::JSObject::getSlot):
1473         (Bindings::JSObject::setSlot):
1474         (Bindings::JSObject::toString):
1475         (Bindings::JSObject::finalize):
1476         (Bindings::JSObject::getWindow):
1477         * bindings/jni_jsobject.h:
1478         (Bindings::RootObject::~RootObject):
1479         (Bindings::RootObject::findRootObjectForNativeHandleFunction):
1480         (Bindings::RootObject::runLoop):
1481         (Bindings::RootObject::performJavaScriptSource):
1482         (Bindings::):
1483
1484 2003-12-11  Richard Williamson   <rjw@apple.com>
1485
1486         Added support for calling a JavaScript function from
1487         Java.  Right now this only works for void func(void)
1488         functions, but the conversion of args and return values
1489         will come shortly.
1490
1491         Cleaned up and verified reference counting scheme, and
1492         dereferencing of vended JavaScript objects when applet is
1493         destroyed (actually when part is destroyed).
1494         
1495         Removed link hack for testkjs now that the Java folks think
1496         they have a solution for the 1.4.2 JavaVM link problem.  Although
1497         Greg B. thinks his solution may cause problems for the 1.3.1
1498         version of the VM!?!
1499
1500         Reviewed by Ken.
1501
1502         * Makefile.am:
1503         * bindings/jni/jni_runtime.h:
1504         (Bindings::JavaString::JavaString):
1505         * bindings/jni/jni_utility.cpp:
1506         (convertValueToJValue):
1507         (convertValueToJObject):
1508         (listFromJArray):
1509         * bindings/jni/jni_utility.h:
1510         * bindings/jni_jsobject.cpp:
1511         (KJS_setFindRootObjectForNativeHandleFunction):
1512         (KJS_findRootObjectForNativeHandleFunction):
1513         (getReferencesByRootDictionary):
1514         (getReferencesDictionary):
1515         (findReferenceDictionary):
1516         (rootForImp):
1517         (addJavaReference):
1518         (removeJavaReference):
1519         * bindings/jni_jsobject.h:
1520         (Bindings::RootObject::RootObject):
1521         (Bindings::RootObject::~RootObject):
1522         (Bindings::RootObject::setRootObjectImp):
1523         (Bindings::RootObject::rootObjectImp):
1524         (Bindings::RootObject::setInterpreter):
1525         (Bindings::RootObject::interpreter):
1526
1527 === Safari-117 ===
1528
1529 2003-12-10  Darin Adler  <darin@apple.com>
1530
1531         Reviewed by Maciej.
1532
1533         - fixed regression in JavaScript tests reported by the KDE guys
1534         - fixed 3506345: REGRESSION (115-116): VIP: chordfind.com no longer displays chords
1535
1536         * kjs/ustring.h: Add tolerateEmptyString parameter to toDouble and toULong.
1537         * kjs/ustring.cpp:
1538         (KJS::UString::toDouble): Separate the "tolerant" parameter into two separate ones:
1539         tolerateTrailingJunk and tolerateEmptyString. Add new overloads; better for code size
1540         and binary compatibility than default parameter values.
1541         (KJS::UString::toULong): Pass tolerateEmptyString down to toDouble. Add new overload.
1542
1543         * kjs/string_object.cpp: (StringProtoFuncImp::call): Pass false for the new
1544         "tolerate empty string" parameter.
1545
1546 2003-12-10  Richard Williamson   <rjw@apple.com>
1547
1548         Added code to manage reference counting of JavaScript
1549         objects passed to Java.   Also added implementation of
1550         KJS_JSCreateNativeJSObject.  This is the function that
1551         provides the root object to Java (KJS::Window).
1552
1553         Reviewed by Hyatt.
1554
1555         * JavaScriptCore.pbproj/project.pbxproj:
1556         * bindings/jni_jsobject.cpp:
1557         (KJS_setFindObjectForNativeHandleFunction):
1558         (KJS_findObjectForNativeHandleFunction):
1559         (getReferencesByOwnerDictionary):
1560         (getReferencesDictionary):
1561         (findReferenceDictionary):
1562         (addJavaReference):
1563         (removeJavaReference):
1564         (removeAllJavaReferencesForOwner):
1565         * bindings/jni_jsobject.h:
1566
1567 2003-12-09  Richard Williamson   <rjw@apple.com>
1568
1569         LiveConnect stubs that correspond to the native methods
1570         on JSObject.  These will be called from the new Java plugin
1571         when an instance of JSObject is instantiated and messaged.
1572         When these are implemented the Java will be able to originate
1573         calls into JavaScript.
1574
1575         Also a temporary work-around added to Makefile.am to solve
1576         a link problem.  The 1.4.2 JavaVM accidentally links against
1577         libobjc.  This call a failure linking testkjs.  Mike Hay is
1578         working with someone to fix the problem (3505587).
1579
1580         Reviewed by Chris.
1581
1582         * JavaScriptCore.pbproj/project.pbxproj:
1583         * Makefile.am:
1584         * bindings/jni_jsobject.cpp: Added.
1585         (KJS_JSCreateNativeJSObject):
1586         (KJS_JSObject_JSFinalize):
1587         (KJS_JSObject_JSObjectCall):
1588         (KJS_JSObject_JSObjectEval):
1589         (KJS_JSObject_JSObjectGetMember):
1590         (KJS_JSObject_JSObjectSetMember):
1591         (KJS_JSObject_JSObjectRemoveMember):
1592         (KJS_JSObject_JSObjectGetSlot):
1593         (KJS_JSObject_JSObjectSetSlot):
1594         (KJS_JSObject_JSObjectToString):
1595         * bindings/jni_jsobject.h: Added.
1596
1597 2003-12-09  Maciej Stachowiak  <mjs@apple.com>
1598
1599         Reviewed by John.
1600
1601         <rdar://problem/3505183>: JavaScriptCore should assert that interpreter is locked in collector
1602
1603         * kjs/collector.cpp:
1604         (KJS::Collector::allocate): Assert that interpreter lock count is not 0.
1605         (KJS::Collector::collect): likewise
1606
1607 2003-12-08  Richard Williamson   <rjw@apple.com>
1608
1609         LiveConnect:  The last piece of the JavaScript side of the
1610         LiveConnect implementation.  This change adds support for
1611         setting/getting values from Java arrays in JavaScript.
1612
1613         Reviewed by John.
1614
1615         * bindings/jni/jni_instance.h:
1616         * bindings/jni/jni_runtime.cpp:
1617         (JavaField::JavaField):
1618         (convertJObjectToArray):
1619         (JavaArray::JavaArray):
1620         (JavaArray::~JavaArray):
1621         (JavaArray::setValueAt):
1622         (JavaArray::valueAt):
1623         (JavaArray::getLength):
1624         * bindings/jni/jni_runtime.h:
1625         (Bindings::JavaArray::operator=):
1626         (Bindings::JavaArray::javaArray):
1627         * bindings/jni/jni_utility.cpp:
1628         (JNITypeFromPrimitiveType):
1629         (convertValueToJValue):
1630         * bindings/jni/jni_utility.h:
1631         * bindings/runtime.h:
1632         * bindings/runtime_array.cpp:
1633         (RuntimeArrayImp::RuntimeArrayImp):
1634         (RuntimeArrayImp::~RuntimeArrayImp):
1635         (RuntimeArrayImp::get):
1636         (RuntimeArrayImp::put):
1637         (RuntimeArrayImp::hasProperty):
1638         * bindings/runtime_array.h:
1639         (KJS::RuntimeArrayImp::getLength):
1640         (KJS::RuntimeArrayImp::getConcreteArray):
1641         * bindings/runtime_object.cpp:
1642         (RuntimeObjectImp::get):
1643         (RuntimeObjectImp::canPut):
1644         (RuntimeObjectImp::hasProperty):
1645
1646 2003-12-05  Richard Williamson   <rjw@apple.com>
1647
1648         LiveConnect:  Part 1 of supporting JS bindings to
1649         native language arrays.
1650
1651         Reviewed by Chris.
1652
1653         * JavaScriptCore.pbproj/project.pbxproj:
1654         * bindings/jni/jni_runtime.cpp:
1655         (JavaField::JavaField):
1656         (convertJObjectToArray):
1657         (JavaField::valueFromInstance):
1658         (JavaField::setValueToInstance):
1659         * bindings/jni/jni_runtime.h:
1660         * bindings/runtime.cpp:
1661         (Instance::setValueOfField):
1662         * bindings/runtime.h:
1663         (Bindings::Array::~Array):
1664
1665 2003-12-04  Richard Williamson   <rjw@apple.com>
1666
1667         LiveConnect:  Moved defaultValue into concrete implementation because
1668         more intelligent conversion can be perform with knowledge
1669         of the class of the original instance.
1670
1671         Reviewed by Chris.
1672
1673         * bindings/jni/jni_class.cpp:
1674         (JavaClass::isNumberClass):
1675         (JavaClass::isBooleanClass):
1676         (JavaClass::isStringClass):
1677         * bindings/jni/jni_class.h:
1678         * bindings/jni/jni_instance.cpp:
1679         (JavaInstance::defaultValue):
1680         (JavaInstance::valueOf):
1681         * bindings/jni/jni_instance.h:
1682         (Bindings::JavaInstance::javaInstance):
1683         * bindings/runtime.h:
1684         * bindings/runtime_object.cpp:
1685         (RuntimeObjectImp::defaultValue):
1686
1687 2003-12-04  Richard Williamson   <rjw@apple.com>
1688
1689         LiveConnect:  Added support for setting the value of Java
1690         fields.
1691
1692         Reviewed by Chris.
1693
1694         * bindings/jni/jni_instance.cpp:
1695         (JavaInstance::invokeMethod):
1696         * bindings/jni/jni_runtime.cpp:
1697         (JavaParameter::JavaParameter):
1698         (JavaField::JavaField):
1699         (JavaField::valueFromInstance):
1700         (JavaField::setValueToInstance):
1701         (JavaMethod::JavaMethod):
1702         * bindings/jni/jni_runtime.h:
1703         (Bindings::JavaField::getJNIType):
1704         * bindings/jni/jni_utility.cpp:
1705         (JNITypeFromClassName):
1706         (convertValueToJValue):
1707         * bindings/jni/jni_utility.h:
1708         * bindings/runtime.cpp:
1709         (Instance::setValueOfField):
1710         * bindings/runtime.h:
1711         * bindings/runtime_object.cpp:
1712         (RuntimeObjectImp::get):
1713         (RuntimeObjectImp::put):
1714         (RuntimeObjectImp::defaultValue):
1715
1716 2003-12-04  Richard Williamson   <rjw@apple.com>
1717
1718         Added support for string conversions.
1719         Changed various JavaString member variables to be inline.
1720         Implemented defaultValue for context relevant type coercion.
1721
1722         Reviewed by Chris.
1723
1724         * bindings/jni/jni_class.cpp:
1725         (JavaClass::JavaClass):
1726         (JavaClass::setClassName):
1727         (JavaClass::classForInstance):
1728         * bindings/jni/jni_class.h:
1729         * bindings/jni/jni_instance.cpp:
1730         (JavaInstance::stringValue):
1731         (JavaInstance::numberValue):
1732         (JavaInstance::booleanValue):
1733         (JavaInstance::invokeMethod):
1734         * bindings/jni/jni_instance.h:
1735         * bindings/jni/jni_runtime.cpp:
1736         (JavaParameter::JavaParameter):
1737         (JavaField::JavaField):
1738         (JavaMethod::JavaMethod):
1739         (appendClassName):
1740         (JavaMethod::signature):
1741         * bindings/jni/jni_runtime.h:
1742         (Bindings::JavaString::JavaString):
1743         (Bindings::JavaString::~JavaString):
1744         (Bindings::JavaString::operator=):
1745         (Bindings::JavaString::characters):
1746         (Bindings::JavaParameter::JavaParameter):
1747         (Bindings::JavaParameter::~JavaParameter):
1748         (Bindings::JavaParameter::operator=):
1749         (Bindings::JavaParameter::type):
1750         (Bindings::JavaField::JavaField):
1751         (Bindings::JavaField::~JavaField):
1752         (Bindings::JavaField::operator=):
1753         (Bindings::JavaField::name):
1754         (Bindings::JavaField::type):
1755         (Bindings::JavaMethod::JavaMethod):
1756         (Bindings::JavaMethod::_commonDelete):
1757         (Bindings::JavaMethod::name):
1758         (Bindings::JavaMethod::returnType):
1759         * bindings/jni/jni_utility.cpp:
1760         (convertValueToJValue):
1761         * bindings/runtime.h:
1762         (Bindings::Instance::valueOf):
1763         * bindings/runtime_method.cpp:
1764         (RuntimeMethodImp::call):
1765         * bindings/runtime_object.cpp:
1766         (RuntimeObjectImp::RuntimeObjectImp):
1767         (RuntimeObjectImp::get):
1768         (RuntimeObjectImp::defaultValue):
1769         * bindings/runtime_object.h:
1770         (KJS::RuntimeObjectImp::classInfo):
1771
1772 === Safari-116 ===
1773
1774 2003-12-03  Richard Williamson   <rjw@apple.com>
1775
1776         LiveConnect:  Added support for parameter passing to Java and conversion
1777         of return values.
1778
1779         Reviewed by Chris.
1780
1781         * bindings/jni/jni_instance.cpp:
1782         (JavaInstance::invokeMethod):
1783         * bindings/jni/jni_instance.h:
1784         * bindings/jni/jni_runtime.cpp:
1785         (JavaParameter::JavaParameter):
1786         (JavaMethod::JavaMethod):
1787         (JavaMethod::signature):
1788         * bindings/jni/jni_runtime.h:
1789         (Bindings::JavaParameter::JavaParameter):
1790         (Bindings::JavaParameter::operator=):
1791         (Bindings::JavaParameter::getJNIType):
1792         * bindings/jni/jni_utility.cpp:
1793         (callJNIBooleanMethodA):
1794         (convertValueToJValue):
1795         * bindings/jni/jni_utility.h:
1796         * bindings/runtime.h:
1797         * bindings/runtime_method.cpp:
1798         (RuntimeMethodImp::call):
1799         * bindings/runtime_object.cpp:
1800         (RuntimeObjectImp::get):
1801
1802 2003-12-02  Richard Williamson   <rjw@apple.com>
1803
1804         Added support for calling simple methods in Java from JavaScript.
1805         (void return and no parameters).  Yay, LiveConnect lives.
1806
1807         Still need write argument and return value conversion code.
1808
1809         Reviewed by Chris.
1810
1811         * JavaScriptCore.pbproj/project.pbxproj:
1812         * bindings/jni/jni_instance.cpp:
1813         (JavaInstance::getClass):
1814         (JavaInstance::invokeMethod):
1815         * bindings/jni/jni_instance.h:
1816         * bindings/jni/jni_runtime.cpp:
1817         (JavaMethod::JavaMethod):
1818         (JavaMethod::signature):
1819         (JavaMethod::JNIReturnType):
1820         * bindings/jni/jni_runtime.h:
1821         (Bindings::JavaMethod::_commonDelete):
1822         (Bindings::JavaMethod::_commonCopy):
1823         (Bindings::JavaMethod::name):
1824         * bindings/jni/jni_utility.cpp:
1825         (signatureFromPrimitiveType):
1826         * bindings/jni/jni_utility.h:
1827         * bindings/runtime.h:
1828         * bindings/runtime_method.cpp: Added.
1829         (RuntimeMethodImp::RuntimeMethodImp):
1830         (RuntimeMethodImp::~RuntimeMethodImp):
1831         (RuntimeMethodImp::get):
1832         (RuntimeMethodImp::implementsCall):
1833         (RuntimeMethodImp::call):
1834         (RuntimeMethodImp::codeType):
1835         (RuntimeMethodImp::execute):
1836         * bindings/runtime_method.h: Added.
1837         * bindings/runtime_object.cpp:
1838         (RuntimeObjectImp::RuntimeObjectImp):
1839         (RuntimeObjectImp::get):
1840         * bindings/runtime_object.h:
1841         * kjs/function.cpp:
1842         (FunctionImp::FunctionImp):
1843         * kjs/interpreter.h:
1844
1845 2003-12-01  Darin Adler  <darin@apple.com>
1846
1847         Reviewed by Maciej.
1848
1849         - fixed 3493799: JavaScript string.replace expands $ if it's the last character in replacement string
1850
1851         * kjs/ustring.cpp: (KJS::UString::toDouble): Fix backwards handling of the "tolerant" boolean.
1852         This indirectly caused the string.replace bug.
1853
1854 2003-12-02  Maciej Stachowiak  <mjs@apple.com>
1855
1856         Merged patches from Harri Porten and David Faure to fix:
1857
1858         <rdar://problem/3497643>: reproducible crash printing self-referential array
1859         
1860         * kjs/array_object.cpp:
1861         (ArrayProtoFuncImp::call): Break out of the loop if an exception was thrown.
1862         * kjs/nodes.cpp:
1863         (FunctionCallNode::evaluate): Move function call depth check from here...
1864         * kjs/object.cpp:
1865         (KJS::Object::call): ...to here.
1866         * kjs/object.h: Un-inline Object::call now that it does more.
1867
1868 2003-12-01  Richard Williamson   <rjw@apple.com>
1869
1870         Fixed mistake in method signatures used to get boolean and integer fields.
1871
1872         Reviewed by Chris.
1873
1874         * bindings/jni/jni_runtime.cpp:
1875         (JavaField::valueFromInstance):
1876
1877 2003-12-01  Richard Williamson   <rjw@apple.com>
1878
1879 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.
1880
1881 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.
1882
1883 Added support for getting at Java object fields.
1884
1885         Reviewed by Chris.
1886
1887         * JavaScriptCore.pbproj/project.pbxproj:
1888         * Makefile.am:
1889         * bindings/jni/jni_instance.cpp:
1890         (JObjectWrapper::JObjectWrapper):
1891         * bindings/jni/jni_instance.h:
1892         (Bindings::JObjectWrapper::~JObjectWrapper):
1893         * bindings/jni/jni_runtime.cpp:
1894         (JavaField::valueFromInstance):
1895         * bindings/runtime_object.cpp:
1896         (RuntimeObjectImp::~RuntimeObjectImp):
1897         (RuntimeObjectImp::RuntimeObjectImp):
1898         (RuntimeObjectImp::get):
1899         (RuntimeObjectImp::deleteProperty):
1900         * bindings/runtime_object.h:
1901
1902 === Safari-115 ===
1903
1904 2003-11-21  Maciej Stachowiak  <mjs@apple.com>
1905
1906         Patch from Harri Porten, reviewed by me.
1907
1908         - fixed 3491712 - String slice with negative arguments does not offset from end of string
1909         
1910         * kjs/string_object.cpp:
1911         (StringProtoFuncImp::call): Handle negative arguments as offsets from end by
1912         adding length and clamping to [0,length-1].
1913
1914 2003-11-21  Maciej Stachowiak  <mjs@apple.com>
1915
1916         Patch from Harri Porten, reviewed by me.
1917
1918         - fixed 3491709 - using Function.apply with a primitive type as the arg list causes crash
1919         
1920         * kjs/function_object.cpp:
1921         (FunctionProtoFuncImp::call): Nest parentheses properly.
1922
1923 2003-11-20  Richard Williamson   <rjw@apple.com>
1924
1925         More LiveConnect stuff.  Primitive Java fields are now
1926         accessible from JavaScript!  Yay!
1927
1928         Reviewed by Maciej.
1929
1930         * bindings/jni/jni_class.cpp:
1931         (JavaClass::methodNamed):
1932         (JavaClass::fieldNamed):
1933         * bindings/jni/jni_class.h:
1934         (Bindings::JavaClass::_commonDelete):
1935         * bindings/jni/jni_instance.cpp:
1936         (JavaInstance::JavaInstance):
1937         (JavaInstance::~JavaInstance):
1938         (JavaInstance::getClass):
1939         * bindings/jni/jni_instance.h:
1940         (Bindings::JavaInstance::javaInstance):
1941         * bindings/jni/jni_runtime.cpp:
1942         (JavaField::JavaField):
1943         (JavaField::valueFromInstance):
1944         * bindings/jni/jni_runtime.h:
1945         (Bindings::JavaField::JavaField):
1946         (Bindings::JavaField::~JavaField):
1947         (Bindings::JavaField::operator=):
1948         * bindings/jni/jni_utility.cpp:
1949         (callJNIMethod):
1950         (callJNIMethodA):
1951         (callJNIVoidMethod):
1952         (callJNIObjectMethod):
1953         (callJNIBooleanMethod):
1954         (callJNIByteMethod):
1955         (callJNICharMethod):
1956         (callJNIShortMethod):
1957         (callJNIIntMethod):
1958         (callJNILongMethod):
1959         (callJNIFloatMethod):
1960         (callJNIDoubleMethod):
1961         (callJNIVoidMethodA):
1962         (callJNIObjectMethodA):
1963         (callJNIByteMethodA):
1964         (callJNICharMethodA):
1965         (callJNIShortMethodA):
1966         (callJNIIntMethodA):
1967         (callJNILongMethodA):
1968         (callJNIFloatMethodA):
1969         (callJNIDoubleMethodA):
1970         (releaseCharactersForJStringInEnv):
1971         (primitiveTypeFromClassName):
1972         (getJNIField):
1973         * bindings/jni/jni_utility.h:
1974         * bindings/runtime.cpp:
1975         (Instance::createBindingForLanguageInstance):
1976         (Instance::getValueOfField):
1977         * bindings/runtime.h:
1978         * bindings/runtime_object.cpp:
1979         (RuntimeObjectImp::get):
1980
1981 2003-11-20  Richard Williamson   <rjw@apple.com>
1982
1983         More LiveConnect stuff.
1984
1985         Reviewed by Chris.
1986
1987         * bindings/jni/jni_class.cpp:
1988         (JavaClass::classForName):
1989         (JavaClass::classForInstance):
1990         * bindings/jni/jni_instance.cpp:
1991         (JavaInstance::getValueOfField):
1992         * bindings/jni/jni_instance.h:
1993         (Bindings::JObjectWrapper::JObjectWrapper):
1994         * bindings/jni/jni_runtime.h:
1995         (Bindings::JavaConstructor::~JavaConstructor):
1996         (Bindings::JavaConstructor::operator=):
1997         (Bindings::JavaMethod::JavaMethod):
1998         (Bindings::JavaMethod::_commonDelete):
1999         (Bindings::JavaMethod::signature):
2000         * bindings/jni/jni_utility.cpp:
2001         (getJNIEnv):
2002         (attachToJavaVM):
2003         * bindings/jni/jni_utility.h:
2004         * bindings/runtime.h:
2005         * bindings/runtime_object.cpp:
2006         (RuntimeObjectImp::~RuntimeObjectImp):
2007         (RuntimeObjectImp::get):
2008         * bindings/runtime_object.h:
2009
2010 2003-11-19  Richard Williamson   <rjw@apple.com>
2011
2012         More LiveConnect stuff.
2013
2014         Reviewed by Ken.
2015
2016         * JavaScriptCore.pbproj/project.pbxproj:
2017         * bindings/jni/jni_class.cpp: Added.
2018         (JavaClass::_commonInit):
2019         (JavaClass::JavaClass):
2020         (_createClassesByNameIfNecessary):
2021         (JavaClass::classForName):
2022         (JavaClass::classForInstance):
2023         (JavaClass::methodNamed):
2024         (JavaClass::fieldNamed):
2025         * bindings/jni/jni_class.h: Added.
2026         (Bindings::JavaClass::_commonDelete):
2027         (Bindings::JavaClass::~JavaClass):
2028         (Bindings::JavaClass::_commonCopy):
2029         (Bindings::JavaClass::JavaClass):
2030         (Bindings::JavaClass::operator=):
2031         (Bindings::JavaClass::name):
2032         (Bindings::JavaClass::constructorAt):
2033         (Bindings::JavaClass::numConstructors):
2034         * bindings/jni/jni_instance.cpp: Added.
2035         (JavaInstance::JavaInstance):
2036         (JavaInstance::~JavaInstance):
2037         * bindings/jni/jni_instance.h: Added.
2038         (Bindings::JObjectWrapper::JObjectWrapper):
2039         (Bindings::JObjectWrapper::~JObjectWrapper):
2040         (Bindings::JObjectWrapper::ref):
2041         (Bindings::JObjectWrapper::deref):
2042         (Bindings::JavaInstance::getClass):
2043         (Bindings::JavaInstance::operator=):
2044         * bindings/jni/jni_runtime.cpp:
2045         (JavaMethod::JavaMethod):
2046         * bindings/jni/jni_runtime.h:
2047         (Bindings::JavaString::JavaString):
2048         (Bindings::JavaString::~JavaString):
2049         (Bindings::JavaString::operator=):
2050         * bindings/jni/jni_utility.cpp:
2051         (getJavaVM):
2052         (getJNIEnv):
2053         (getCharactersFromJString):
2054         (releaseCharactersForJString):
2055         (getCharactersFromJStringInEnv):
2056         (releaseCharactersForJStringInEnv):
2057         * bindings/jni/jni_utility.h:
2058         * bindings/runtime.cpp:
2059         (Instance::createBindingForLanguageInstance):
2060         * bindings/runtime.h:
2061         (Bindings::Instance::):
2062
2063 2003-11-18  Richard Williamson   <rjw@apple.com>
2064
2065         More live connect stubs.  We're getting close.
2066
2067         Reviewed by Chris.
2068
2069         * JavaScriptCore.pbproj/project.pbxproj:
2070         * bindings/jni/jni_runtime.cpp:
2071         (JavaClass::JavaClass):
2072         (JavaInstance::JavaInstance):
2073         (JavaInstance::~JavaInstance):
2074         * bindings/jni/jni_runtime.h:
2075         (Bindings::JavaConstructor::value):
2076         (Bindings::JavaField::value):
2077         (Bindings::JavaMethod::value):
2078         (Bindings::JavaClass::_commonDelete):
2079         (Bindings::JavaClass::_commonCopy):
2080         (Bindings::JavaClass::methodNamed):
2081         (Bindings::JavaClass::fieldNamed):
2082         (Bindings::JavaInstance::getClass):
2083         * bindings/runtime.cpp: Added.
2084         * bindings/runtime.h:
2085         (Bindings::Instance::~Instance):
2086         * bindings/runtime_object.cpp: Added.
2087         (RuntimeObjectImp::classInfo):
2088         (RuntimeObjectImp::RuntimeObjectImp):
2089         (RuntimeObjectImp::get):
2090         (RuntimeObjectImp::put):
2091         (RuntimeObjectImp::canPut):
2092         (RuntimeObjectImp::hasProperty):
2093         (RuntimeObjectImp::deleteProperty):
2094         (RuntimeObjectImp::defaultValue):
2095         (RuntimeObjectImp::_initializeClassInfoFromInstance):
2096         * bindings/runtime_object.h: Added.
2097         (KJS::RuntimeObjectImp::setInternalInstance):
2098         (KJS::RuntimeObjectImp::getInternalInstance):
2099         * kjs/object.cpp:
2100         (KJS::ObjectImp::get):
2101         (KJS::ObjectImp::hasProperty):
2102         * kjs/value.h:
2103         (KJS::):
2104
2105 2003-11-17  Maciej Stachowiak  <mjs@apple.com>
2106
2107         Patch from Harri, reviewed by me.
2108
2109         - fixed 3487375 - backwards array slice causes infinite loop
2110         
2111         * kjs/array_object.cpp:
2112         (ArrayProtoFuncImp::call):
2113
2114 2003-11-17  Maciej Stachowiak  <mjs@apple.com>
2115
2116         Patch from Harri Porten reviewed by me.
2117
2118         - fixed 3487371 - operator precedence for bitwise or, xor and and is wrong
2119
2120         * kjs/grammar.y: Correct the precedence.
2121
2122 2003-11-16  Maciej Stachowiak  <mjs@apple.com>
2123
2124         Reviewed by John.
2125
2126         - fixed 3483829 - JavaScriptCore needs workaround to compile on Merlot
2127         
2128         * JavaScriptCore.pbproj/project.pbxproj: Add -Wno-long-double to
2129         warning flags.
2130
2131 === Safari-114 ===
2132
2133 2003-11-13  Richard Williamson   <rjw@apple.com>
2134
2135         Factored common code between copy constructor and assignment operator.
2136
2137         Reviewed by Chris.
2138
2139         * ChangeLog:
2140         * bindings/jni/jni_runtime.h:
2141         (Bindings::JavaConstructor::_commonCopy):
2142         (Bindings::JavaConstructor::JavaConstructor):
2143         (Bindings::JavaConstructor::operator=):
2144         (Bindings::JavaField::type):
2145         * bindings/runtime.h:
2146
2147 2003-11-13  Richard Williamson   <rjw@apple.com>
2148
2149         More LiveConnect stuff.  This checkin adds abstract classes to model
2150         language runtimes and a JNI based set of concrete implementations for
2151         Java.
2152
2153         Reviewed by Chris.
2154
2155         * JavaScriptCore.pbproj/project.pbxproj:
2156         * Makefile.am:
2157         * bindings/Makefile.am: Removed.
2158         * bindings/jni/Makefile.am: Removed.
2159         * bindings/jni/jni_runtime.cpp: Added.
2160         (JavaField::JavaField):
2161         (JavaConstructor::JavaConstructor):
2162         (JavaMethod::JavaMethod):
2163         (JavaClass::JavaClass):
2164         * bindings/jni/jni_runtime.h: Added.
2165         (Bindings::JavaString::JavaString):
2166         (Bindings::JavaString::~JavaString):
2167         (Bindings::JavaString::operator=):
2168         (Bindings::JavaString::characters):
2169         (Bindings::JavaParameter::JavaParameter):
2170         (Bindings::JavaParameter::~JavaParameter):
2171         (Bindings::JavaParameter::operator=):
2172         (Bindings::JavaParameter::type):
2173         (Bindings::JavaConstructor::JavaConstructor):
2174         (Bindings::JavaConstructor::~JavaConstructor):
2175         (Bindings::JavaConstructor::operator=):
2176         (Bindings::JavaConstructor::parameterAt):
2177         (Bindings::JavaConstructor::numParameters):
2178         (Bindings::JavaField::JavaField):
2179         (Bindings::JavaField::~JavaField):
2180         (Bindings::JavaField::operator=):
2181         (Bindings::JavaField::name):
2182         (Bindings::JavaField::type):
2183         (Bindings::JavaMethod::JavaMethod):
2184         (Bindings::JavaMethod::_commonDelete):
2185         (Bindings::JavaMethod::~JavaMethod):
2186         (Bindings::JavaMethod::_commonCopy):
2187         (Bindings::JavaMethod::operator=):
2188         (Bindings::JavaMethod::name):
2189         (Bindings::JavaMethod::returnType):
2190         (Bindings::JavaMethod::parameterAt):
2191         (Bindings::JavaMethod::numParameters):
2192         (Bindings::JavaClass::_commonDelete):
2193         (Bindings::JavaClass::~JavaClass):
2194         (Bindings::JavaClass::_commonCopy):
2195         (Bindings::JavaClass::JavaClass):
2196         (Bindings::JavaClass::operator=):
2197         (Bindings::JavaClass::name):
2198         (Bindings::JavaClass::methodAt):
2199         (Bindings::JavaClass::numMethods):
2200         (Bindings::JavaClass::constructorAt):
2201         (Bindings::JavaClass::numConstructors):
2202         (Bindings::JavaClass::fieldAt):
2203         (Bindings::JavaClass::numFields):
2204         * bindings/jni/jni_utility.cpp:
2205         (callJNIMethod):
2206         (callJNIMethodA):
2207         (callJNIObjectMethod):
2208         (callJNIByteMethod):
2209         (callJNICharMethod):
2210         (callJNIShortMethod):
2211         (callJNIIntMethod):
2212         (callJNILongMethod):
2213         (callJNIFloatMethod):
2214         (callJNIDoubleMethod):
2215         (callJNIVoidMethodA):
2216         (callJNIObjectMethodA):
2217         (callJNIByteMethodA):
2218         (callJNICharMethodA):
2219         (callJNIShortMethodA):
2220         (callJNIIntMethodA):
2221         (callJNILongMethodA):
2222         (callJNIFloatMethodA):
2223         (callJNIDoubleMethodA):
2224         (getCharactersFromJString):
2225         (releaseCharactersForJString):
2226         * bindings/jni/jni_utility.h:
2227         * bindings/objc/Makefile.am: Removed.
2228         * bindings/runtime.h: Added.
2229         (Bindings::Parameter::~Parameter):
2230         (Bindings::Constructor::~Constructor):
2231         (Bindings::Field::~Field):
2232         (Bindings::Method::~Method):
2233         (Bindings::Class::~Class):
2234
2235 2003-11-13  Maciej Stachowiak  <mjs@apple.com>
2236
2237         Reviewed by John.
2238
2239         - fixed 3472562 - Null or Undefined variables passed to IN operator cause javascript exceptions
2240         
2241         * kjs/nodes.cpp:
2242         (ForInNode::execute): If the in value is null or undefined, bail
2243         out early, since attempting to iterate its properties will throw
2244         an exception.
2245
2246 2003-11-12  Darin Adler  <darin@apple.com>
2247
2248         - fixed the build
2249
2250         * Makefile.am: Fix the build by removing the bindings directory from SUBDIRS.
2251         Later, we can either add this back and add the Makefile.am files to the top
2252         level configure.in or leave it out and remove the Makefile.am files.
2253
2254 2003-11-12  Richard Williamson   <rjw@apple.com>
2255
2256         Added utility functions for calling JNI methods.
2257
2258         Reviewed by Chris.
2259
2260         * JavaScriptCore.pbproj/project.pbxproj:
2261         * Makefile.am:
2262         * bindings/Makefile.am: Added.
2263         * bindings/jni/Makefile.am: Added.
2264         * bindings/jni/jni_utility.cpp: Added.
2265         (attachToJavaVM):
2266         (callJNIMethod):
2267         (callJNIVoidMethod):
2268         (callJNIObjectMethod):
2269         (callJNIByteMethod):
2270         (callJNICharMethod):
2271         (callJNIShortMethod):
2272         (callJNIIntMethod):
2273         (callJNILongMethod):
2274         (callJNIFloatMethod):
2275         (callJNIDoubleMethod):
2276         * bindings/jni/jni_utility.h: Added.
2277         * bindings/objc/Makefile.am: Added.
2278
2279 2003-11-08  Darin Adler  <darin@apple.com>
2280
2281         Reviewed by John.
2282
2283         - fixed 3477528 -- array.sort(function) fails if the function returns a non-zero value that rounds to zero
2284
2285         * kjs/array_object.cpp:
2286         (compareByStringForQSort): Added checks for undefined values to match what the specification calls for.
2287         (compareWithCompareFunctionForQSort): Added checks for undefined values as above, and also changed the
2288         code that looks at the compare function result to look at the number returned without rounding to an integer.
2289         (ArrayProtoFuncImp::call): Changed the code that looks at the compare function result to look at the number
2290         returned without rounding to an integer.
2291
2292 === Safari-113 ===
2293
2294 2003-11-03  Vicki Murley <vicki@apple.com>
2295
2296         Reviewed by kocienda.
2297
2298         - fixed <rdar://problem/3471096>: non-B&I builds should not use order files, because they cause false "regressions" in perf.
2299
2300         * JavaScriptCore.pbproj/project.pbxproj: added empty SECTORDER_FLAGS variables to the Development and Deployment build styles
2301
2302 2003-11-02  Darin Adler  <darin@apple.com>
2303
2304         Reviewed by Maciej.
2305
2306         - changed list manipulation to use Harri Porten's idea of a circular
2307           linked list that is built from head to tail rather than building the
2308           list backwards and reversing the list when done
2309
2310         * kjs/grammar.y: Handle CatchNode and FinallyNode in a type-safe way.
2311         Change many places that passed 0L to pass nothing at all, or to pass 0.
2312
2313         * kjs/nodes.h:
2314         (KJS::ElementNode::ElementNode): Build a circular list instead of a 0-terminated
2315         backwards list.
2316         (KJS::ArrayNode::ArrayNode): Break the circular list instead of reversing the list.
2317         (KJS::PropertyValueNode::PropertyValueNode): Moved before ObjectLiteralNode so the
2318         inline code in ObjectLiteralNode works. Build a circular list instead of a 0-terminated
2319         backwards list. Made the case for the first node separate so we don't need a nil check.
2320         (KJS::ObjectLiteralNode::ObjectLiteralNode): Break the circular list instead of
2321         reversing the list.
2322         (KJS::ArgumentListNode::ArgumentListNode): Build a circular list instead of a 0-terminated
2323         backwards list. Also, made the constructors inline (moved here from .cpp file).
2324         (KJS::ArgumentsNode::ArgumentsNode): Break the circular list instead of
2325         reversing the list.
2326         (KJS::NewExprNode::NewExprNode): Changed a 0L to 0.
2327         (KJS::StatListNode::StatListNode): Make this constructor no longer inline (moved into
2328         .cpp file). The one in the .cpp file builds a circular list instead of a 0-terminated
2329         backwards list.
2330         (KJS::VarDeclListNode::VarDeclListNode): Build a circular list instead of a 0-terminated
2331         backwards list.
2332         (KJS::VarStatementNode::VarStatementNode): Break the circular list instead of reversing
2333         the list.
2334         (KJS::BlockNode::BlockNode): Make this constructor no longer inline (moved into .cpp file).
2335         The one in the .cpp file breaks the list instead of reversing it.
2336         (KJS::ForNode::ForNode): Break the circular list instead of reversing the list.
2337         (KJS::CaseClauseNode::CaseClauseNode): Break the circular list instead of reversing the
2338         list.
2339         (KJS::ClauseListNode::ClauseListNode): Build a circular list instead of a 0-terminated
2340         backwards list.
2341         (KJS::CaseBlockNode::CaseBlockNode): Make this constructor no longer inline (moved into
2342         .cpp file). The one in the .cpp file breaks the list instead of reversing it.
2343         (KJS::TryNode::TryNode): Changed constructor to take typed parameters for the catch and
2344         finally nodes rather than just Node.
2345         (KJS::ParameterNode::ParameterNode): Build a circular list instead of a 0-terminated
2346         backwards list.
2347         (KJS::FuncDeclNode::FuncDeclNode): Break the circular list instead of reversing the
2348         list.
2349         (KJS::FuncExprNode::FuncExprNode): Break the circular list instead of reversing the
2350         list.
2351
2352         * kjs/nodes.cpp:
2353         (StatListNode::StatListNode): Moved this constructor here, no longer inline.
2354         Did the "break circular list" thing instead of the "reverse list" thing.
2355         Added setLoc calls to match KJS in the KDE tree; since we don't currently
2356         use the JavaScript debugging support, it's unclear whether there's any benefit, but
2357         later we might be using it and it's good to be as close as possible.
2358         (BlockNode::BlockNode): Moved this constructor here, no longer inline.
2359         Did the "break circular list" thing instead of the "reverse list" thing.
2360         Added setLoc calls.
2361         (CaseBlockNode::CaseBlockNode): Moved this constructor here, no longer inline.
2362         Did the "break circular list" thing instead of the "reverse list" thing.
2363         (SourceElementsNode::SourceElementsNode): Moved this constructor here, no longer inline.
2364         Did the "break circular list" thing instead of the "reverse list" thing.
2365         Added setLoc calls.
2366
2367         * kjs/grammar.cpp: Regenerated.
2368         * kjs/grammar.cpp.h: Regenerated.
2369         * kjs/grammar.h: Regenerated.
2370
2371 === Safari-112 ===
2372
2373 2003-10-30  Maciej Stachowiak  <mjs@apple.com>
2374
2375         Reviewed by Ken.
2376
2377         - fixed 3427069 - browsing mp3.com causes leaks (KJS)
2378         
2379         * kjs/string_object.cpp:
2380         (StringProtoFuncImp::call): Don't do an early return, since that
2381         could leak a temporary regexp.
2382
2383 2003-10-29  Maciej Stachowiak  <mjs@apple.com>
2384
2385         Reviewed by Darin.
2386
2387         - fixed 3426076 - Leak of JS lexer data visiting http://www.ebay.com
2388         
2389         * kjs/grammar.cpp:
2390         (yyerror): Updated the commented code.
2391         * kjs/grammar.y: Don't delete string and identifier tokens when done
2392         with them any more, they'll get cleaned up by the lexer now.
2393         * kjs/internal.cpp:
2394         (Parser::parse): Tell lexer when done parsing.
2395         * kjs/lexer.cpp:
2396         (Lexer::Lexer): Initialize new data members.
2397         (Lexer::lex): Use new methods to make strings and identifiers, and
2398         save them.
2399         (Lexer::makeIdentifier): Make a new Identifier and save it in an
2400         auto-growing array.
2401         (Lexer::makeUString): Likewise for UStrings.
2402         (Lexer::doneParsing): Clean up arrays of Ifentifiers and UStrings.
2403         * kjs/lexer.h:
2404
2405 2003-10-28  Maciej Stachowiak  <mjs@apple.com>
2406
2407         Reviewed by Ken.
2408
2409         - fixed 3413962 -  malicious web pages can kill all future JavaScript execution by breaking recursion limit check
2410         
2411         * kjs/nodes.cpp:
2412         (FunctionCallNode::evaluate): If we're going to return early due
2413         to breaking the recursion limit, make sure to lower it again, or
2414         it will creep up by one each time it's exceeded.
2415
2416 2003-10-26  Darin Adler  <darin@apple.com>
2417
2418         * JavaScriptCorePrefix.h: Added a C case to the NULL definition since we use C as well
2419         as C++ in this project.
2420
2421 2003-10-26  Darin Adler  <darin@apple.com>
2422
2423         - rolled in some CString changes Harri Porten did on the KDE side
2424
2425         * kjs/ustring.cpp:
2426         (KJS::CString::CString): Use memcpy instead of strcpy for speed. Fix an off by one error
2427         in the copy constructor.
2428         (KJS::CString::operator=): Use memcpy instead of strcpy for speed.
2429
2430         * JavaScriptCorePrefix.h: Add a definition of NULL here that takes advantage of the GNU
2431         __null feature even if the system C library doesn't.
2432
2433 == Rolled over to ChangeLog-2003-10-25 ==