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