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