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