Reviewed by John.
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2003-12-09  Maciej Stachowiak  <mjs@apple.com>
2
3         Reviewed by John.
4
5         <rdar://problem/3505183>: JavaScriptCore should assert that interpreter is locked in collector
6
7         * kjs/collector.cpp:
8         (KJS::Collector::allocate): Assert that interpreter lock count is not 0.
9         (KJS::Collector::collect): likewise
10
11 2003-12-08  Richard Williamson   <rjw@apple.com>
12
13         LiveConnect:  The last piece of the JavaScript side of the
14         LiveConnect implementation.  This change adds support for
15         setting/getting values from Java arrays in JavaScript.
16
17         Reviewed by John.
18
19         * bindings/jni/jni_instance.h:
20         * bindings/jni/jni_runtime.cpp:
21         (JavaField::JavaField):
22         (convertJObjectToArray):
23         (JavaArray::JavaArray):
24         (JavaArray::~JavaArray):
25         (JavaArray::setValueAt):
26         (JavaArray::valueAt):
27         (JavaArray::getLength):
28         * bindings/jni/jni_runtime.h:
29         (Bindings::JavaArray::operator=):
30         (Bindings::JavaArray::javaArray):
31         * bindings/jni/jni_utility.cpp:
32         (JNITypeFromPrimitiveType):
33         (convertValueToJValue):
34         * bindings/jni/jni_utility.h:
35         * bindings/runtime.h:
36         * bindings/runtime_array.cpp:
37         (RuntimeArrayImp::RuntimeArrayImp):
38         (RuntimeArrayImp::~RuntimeArrayImp):
39         (RuntimeArrayImp::get):
40         (RuntimeArrayImp::put):
41         (RuntimeArrayImp::hasProperty):
42         * bindings/runtime_array.h:
43         (KJS::RuntimeArrayImp::getLength):
44         (KJS::RuntimeArrayImp::getConcreteArray):
45         * bindings/runtime_object.cpp:
46         (RuntimeObjectImp::get):
47         (RuntimeObjectImp::canPut):
48         (RuntimeObjectImp::hasProperty):
49
50 2003-12-05  Richard Williamson   <rjw@apple.com>
51
52         LiveConnect:  Part 1 of supporting JS bindings to
53         native language arrays.
54
55         Reviewed by Chris.
56
57         * JavaScriptCore.pbproj/project.pbxproj:
58         * bindings/jni/jni_runtime.cpp:
59         (JavaField::JavaField):
60         (convertJObjectToArray):
61         (JavaField::valueFromInstance):
62         (JavaField::setValueToInstance):
63         * bindings/jni/jni_runtime.h:
64         * bindings/runtime.cpp:
65         (Instance::setValueOfField):
66         * bindings/runtime.h:
67         (Bindings::Array::~Array):
68
69 2003-12-04  Richard Williamson   <rjw@apple.com>
70
71         LiveConnect:  Moved defaultValue into concrete implementation because
72         more intelligent conversion can be perform with knowledge
73         of the class of the original instance.
74
75         Reviewed by Chris.
76
77         * bindings/jni/jni_class.cpp:
78         (JavaClass::isNumberClass):
79         (JavaClass::isBooleanClass):
80         (JavaClass::isStringClass):
81         * bindings/jni/jni_class.h:
82         * bindings/jni/jni_instance.cpp:
83         (JavaInstance::defaultValue):
84         (JavaInstance::valueOf):
85         * bindings/jni/jni_instance.h:
86         (Bindings::JavaInstance::javaInstance):
87         * bindings/runtime.h:
88         * bindings/runtime_object.cpp:
89         (RuntimeObjectImp::defaultValue):
90
91 2003-12-04  Richard Williamson   <rjw@apple.com>
92
93         LiveConnect:  Added support for setting the value of Java
94         fields.
95
96         Reviewed by Chris.
97
98         * bindings/jni/jni_instance.cpp:
99         (JavaInstance::invokeMethod):
100         * bindings/jni/jni_runtime.cpp:
101         (JavaParameter::JavaParameter):
102         (JavaField::JavaField):
103         (JavaField::valueFromInstance):
104         (JavaField::setValueToInstance):
105         (JavaMethod::JavaMethod):
106         * bindings/jni/jni_runtime.h:
107         (Bindings::JavaField::getJNIType):
108         * bindings/jni/jni_utility.cpp:
109         (JNITypeFromClassName):
110         (convertValueToJValue):
111         * bindings/jni/jni_utility.h:
112         * bindings/runtime.cpp:
113         (Instance::setValueOfField):
114         * bindings/runtime.h:
115         * bindings/runtime_object.cpp:
116         (RuntimeObjectImp::get):
117         (RuntimeObjectImp::put):
118         (RuntimeObjectImp::defaultValue):
119
120 2003-12-04  Richard Williamson   <rjw@apple.com>
121
122         Added support for string conversions.
123         Changed various JavaString member variables to be inline.
124         Implemented defaultValue for context relevant type coercion.
125
126         Reviewed by Chris.
127
128         * bindings/jni/jni_class.cpp:
129         (JavaClass::JavaClass):
130         (JavaClass::setClassName):
131         (JavaClass::classForInstance):
132         * bindings/jni/jni_class.h:
133         * bindings/jni/jni_instance.cpp:
134         (JavaInstance::stringValue):
135         (JavaInstance::numberValue):
136         (JavaInstance::booleanValue):
137         (JavaInstance::invokeMethod):
138         * bindings/jni/jni_instance.h:
139         * bindings/jni/jni_runtime.cpp:
140         (JavaParameter::JavaParameter):
141         (JavaField::JavaField):
142         (JavaMethod::JavaMethod):
143         (appendClassName):
144         (JavaMethod::signature):
145         * bindings/jni/jni_runtime.h:
146         (Bindings::JavaString::JavaString):
147         (Bindings::JavaString::~JavaString):
148         (Bindings::JavaString::operator=):
149         (Bindings::JavaString::characters):
150         (Bindings::JavaParameter::JavaParameter):
151         (Bindings::JavaParameter::~JavaParameter):
152         (Bindings::JavaParameter::operator=):
153         (Bindings::JavaParameter::type):
154         (Bindings::JavaField::JavaField):
155         (Bindings::JavaField::~JavaField):
156         (Bindings::JavaField::operator=):
157         (Bindings::JavaField::name):
158         (Bindings::JavaField::type):
159         (Bindings::JavaMethod::JavaMethod):
160         (Bindings::JavaMethod::_commonDelete):
161         (Bindings::JavaMethod::name):
162         (Bindings::JavaMethod::returnType):
163         * bindings/jni/jni_utility.cpp:
164         (convertValueToJValue):
165         * bindings/runtime.h:
166         (Bindings::Instance::valueOf):
167         * bindings/runtime_method.cpp:
168         (RuntimeMethodImp::call):
169         * bindings/runtime_object.cpp:
170         (RuntimeObjectImp::RuntimeObjectImp):
171         (RuntimeObjectImp::get):
172         (RuntimeObjectImp::defaultValue):
173         * bindings/runtime_object.h:
174         (KJS::RuntimeObjectImp::classInfo):
175
176 === Safari-116 ===
177
178 2003-12-03  Richard Williamson   <rjw@apple.com>
179
180         LiveConnect:  Added support for parameter passing to Java and conversion
181         of return values.
182
183         Reviewed by Chris.
184
185         * bindings/jni/jni_instance.cpp:
186         (JavaInstance::invokeMethod):
187         * bindings/jni/jni_instance.h:
188         * bindings/jni/jni_runtime.cpp:
189         (JavaParameter::JavaParameter):
190         (JavaMethod::JavaMethod):
191         (JavaMethod::signature):
192         * bindings/jni/jni_runtime.h:
193         (Bindings::JavaParameter::JavaParameter):
194         (Bindings::JavaParameter::operator=):
195         (Bindings::JavaParameter::getJNIType):
196         * bindings/jni/jni_utility.cpp:
197         (callJNIBooleanMethodA):
198         (convertValueToJValue):
199         * bindings/jni/jni_utility.h:
200         * bindings/runtime.h:
201         * bindings/runtime_method.cpp:
202         (RuntimeMethodImp::call):
203         * bindings/runtime_object.cpp:
204         (RuntimeObjectImp::get):
205
206 2003-12-02  Richard Williamson   <rjw@apple.com>
207
208         Added support for calling simple methods in Java from JavaScript.
209         (void return and no parameters).  Yay, LiveConnect lives.
210
211         Still need write argument and return value conversion code.
212
213         Reviewed by Chris.
214
215         * JavaScriptCore.pbproj/project.pbxproj:
216         * bindings/jni/jni_instance.cpp:
217         (JavaInstance::getClass):
218         (JavaInstance::invokeMethod):
219         * bindings/jni/jni_instance.h:
220         * bindings/jni/jni_runtime.cpp:
221         (JavaMethod::JavaMethod):
222         (JavaMethod::signature):
223         (JavaMethod::JNIReturnType):
224         * bindings/jni/jni_runtime.h:
225         (Bindings::JavaMethod::_commonDelete):
226         (Bindings::JavaMethod::_commonCopy):
227         (Bindings::JavaMethod::name):
228         * bindings/jni/jni_utility.cpp:
229         (signatureFromPrimitiveType):
230         * bindings/jni/jni_utility.h:
231         * bindings/runtime.h:
232         * bindings/runtime_method.cpp: Added.
233         (RuntimeMethodImp::RuntimeMethodImp):
234         (RuntimeMethodImp::~RuntimeMethodImp):
235         (RuntimeMethodImp::get):
236         (RuntimeMethodImp::implementsCall):
237         (RuntimeMethodImp::call):
238         (RuntimeMethodImp::codeType):
239         (RuntimeMethodImp::execute):
240         * bindings/runtime_method.h: Added.
241         * bindings/runtime_object.cpp:
242         (RuntimeObjectImp::RuntimeObjectImp):
243         (RuntimeObjectImp::get):
244         * bindings/runtime_object.h:
245         * kjs/function.cpp:
246         (FunctionImp::FunctionImp):
247         * kjs/interpreter.h:
248
249 2003-12-01  Darin Adler  <darin@apple.com>
250
251         Reviewed by Maciej.
252
253         - fixed 3493799: JavaScript string.replace expands $ if it's the last character in replacement string
254
255         * kjs/ustring.cpp: (KJS::UString::toDouble): Fix backwards handling of the "tolerant" boolean.
256         This indirectly caused the string.replace bug.
257
258 2003-12-02  Maciej Stachowiak  <mjs@apple.com>
259
260         Merged patches from Harri Porten and David Faure to fix:
261
262         <rdar://problem/3497643>: reproducible crash printing self-referential array
263         
264         * kjs/array_object.cpp:
265         (ArrayProtoFuncImp::call): Break out of the loop if an exception was thrown.
266         * kjs/nodes.cpp:
267         (FunctionCallNode::evaluate): Move function call depth check from here...
268         * kjs/object.cpp:
269         (KJS::Object::call): ...to here.
270         * kjs/object.h: Un-inline Object::call now that it does more.
271
272 2003-12-01  Richard Williamson   <rjw@apple.com>
273
274         Fixed mistake in method signatures used to get boolean and integer fields.
275
276         Reviewed by Chris.
277
278         * bindings/jni/jni_runtime.cpp:
279         (JavaField::valueFromInstance):
280
281 2003-12-01  Richard Williamson   <rjw@apple.com>
282
283 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.
284
285 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.
286
287 Added support for getting at Java object fields.
288
289         Reviewed by Chris.
290
291         * JavaScriptCore.pbproj/project.pbxproj:
292         * Makefile.am:
293         * bindings/jni/jni_instance.cpp:
294         (JObjectWrapper::JObjectWrapper):
295         * bindings/jni/jni_instance.h:
296         (Bindings::JObjectWrapper::~JObjectWrapper):
297         * bindings/jni/jni_runtime.cpp:
298         (JavaField::valueFromInstance):
299         * bindings/runtime_object.cpp:
300         (RuntimeObjectImp::~RuntimeObjectImp):
301         (RuntimeObjectImp::RuntimeObjectImp):
302         (RuntimeObjectImp::get):
303         (RuntimeObjectImp::deleteProperty):
304         * bindings/runtime_object.h:
305
306 === Safari-115 ===
307
308 2003-11-21  Maciej Stachowiak  <mjs@apple.com>
309
310         Patch from Harri Porten, reviewed by me.
311
312         - fixed 3491712 - String slice with negative arguments does not offset from end of string
313         
314         * kjs/string_object.cpp:
315         (StringProtoFuncImp::call): Handle negative arguments as offsets from end by
316         adding length and clamping to [0,length-1].
317
318 2003-11-21  Maciej Stachowiak  <mjs@apple.com>
319
320         Patch from Harri Porten, reviewed by me.
321
322         - fixed 3491709 - using Function.apply with a primitive type as the arg list causes crash
323         
324         * kjs/function_object.cpp:
325         (FunctionProtoFuncImp::call): Nest parentheses properly.
326
327 2003-11-20  Richard Williamson   <rjw@apple.com>
328
329         More LiveConnect stuff.  Primitive Java fields are now
330         accessible from JavaScript!  Yay!
331
332         Reviewed by Maciej.
333
334         * bindings/jni/jni_class.cpp:
335         (JavaClass::methodNamed):
336         (JavaClass::fieldNamed):
337         * bindings/jni/jni_class.h:
338         (Bindings::JavaClass::_commonDelete):
339         * bindings/jni/jni_instance.cpp:
340         (JavaInstance::JavaInstance):
341         (JavaInstance::~JavaInstance):
342         (JavaInstance::getClass):
343         * bindings/jni/jni_instance.h:
344         (Bindings::JavaInstance::javaInstance):
345         * bindings/jni/jni_runtime.cpp:
346         (JavaField::JavaField):
347         (JavaField::valueFromInstance):
348         * bindings/jni/jni_runtime.h:
349         (Bindings::JavaField::JavaField):
350         (Bindings::JavaField::~JavaField):
351         (Bindings::JavaField::operator=):
352         * bindings/jni/jni_utility.cpp:
353         (callJNIMethod):
354         (callJNIMethodA):
355         (callJNIVoidMethod):
356         (callJNIObjectMethod):
357         (callJNIBooleanMethod):
358         (callJNIByteMethod):
359         (callJNICharMethod):
360         (callJNIShortMethod):
361         (callJNIIntMethod):
362         (callJNILongMethod):
363         (callJNIFloatMethod):
364         (callJNIDoubleMethod):
365         (callJNIVoidMethodA):
366         (callJNIObjectMethodA):
367         (callJNIByteMethodA):
368         (callJNICharMethodA):
369         (callJNIShortMethodA):
370         (callJNIIntMethodA):
371         (callJNILongMethodA):
372         (callJNIFloatMethodA):
373         (callJNIDoubleMethodA):
374         (releaseCharactersForJStringInEnv):
375         (primitiveTypeFromClassName):
376         (getJNIField):
377         * bindings/jni/jni_utility.h:
378         * bindings/runtime.cpp:
379         (Instance::createBindingForLanguageInstance):
380         (Instance::getValueOfField):
381         * bindings/runtime.h:
382         * bindings/runtime_object.cpp:
383         (RuntimeObjectImp::get):
384
385 2003-11-20  Richard Williamson   <rjw@apple.com>
386
387         More LiveConnect stuff.
388
389         Reviewed by Chris.
390
391         * bindings/jni/jni_class.cpp:
392         (JavaClass::classForName):
393         (JavaClass::classForInstance):
394         * bindings/jni/jni_instance.cpp:
395         (JavaInstance::getValueOfField):
396         * bindings/jni/jni_instance.h:
397         (Bindings::JObjectWrapper::JObjectWrapper):
398         * bindings/jni/jni_runtime.h:
399         (Bindings::JavaConstructor::~JavaConstructor):
400         (Bindings::JavaConstructor::operator=):
401         (Bindings::JavaMethod::JavaMethod):
402         (Bindings::JavaMethod::_commonDelete):
403         (Bindings::JavaMethod::signature):
404         * bindings/jni/jni_utility.cpp:
405         (getJNIEnv):
406         (attachToJavaVM):
407         * bindings/jni/jni_utility.h:
408         * bindings/runtime.h:
409         * bindings/runtime_object.cpp:
410         (RuntimeObjectImp::~RuntimeObjectImp):
411         (RuntimeObjectImp::get):
412         * bindings/runtime_object.h:
413
414 2003-11-19  Richard Williamson   <rjw@apple.com>
415
416         More LiveConnect stuff.
417
418         Reviewed by Ken.
419
420         * JavaScriptCore.pbproj/project.pbxproj:
421         * bindings/jni/jni_class.cpp: Added.
422         (JavaClass::_commonInit):
423         (JavaClass::JavaClass):
424         (_createClassesByNameIfNecessary):
425         (JavaClass::classForName):
426         (JavaClass::classForInstance):
427         (JavaClass::methodNamed):
428         (JavaClass::fieldNamed):
429         * bindings/jni/jni_class.h: Added.
430         (Bindings::JavaClass::_commonDelete):
431         (Bindings::JavaClass::~JavaClass):
432         (Bindings::JavaClass::_commonCopy):
433         (Bindings::JavaClass::JavaClass):
434         (Bindings::JavaClass::operator=):
435         (Bindings::JavaClass::name):
436         (Bindings::JavaClass::constructorAt):
437         (Bindings::JavaClass::numConstructors):
438         * bindings/jni/jni_instance.cpp: Added.
439         (JavaInstance::JavaInstance):
440         (JavaInstance::~JavaInstance):
441         * bindings/jni/jni_instance.h: Added.
442         (Bindings::JObjectWrapper::JObjectWrapper):
443         (Bindings::JObjectWrapper::~JObjectWrapper):
444         (Bindings::JObjectWrapper::ref):
445         (Bindings::JObjectWrapper::deref):
446         (Bindings::JavaInstance::getClass):
447         (Bindings::JavaInstance::operator=):
448         * bindings/jni/jni_runtime.cpp:
449         (JavaMethod::JavaMethod):
450         * bindings/jni/jni_runtime.h:
451         (Bindings::JavaString::JavaString):
452         (Bindings::JavaString::~JavaString):
453         (Bindings::JavaString::operator=):
454         * bindings/jni/jni_utility.cpp:
455         (getJavaVM):
456         (getJNIEnv):
457         (getCharactersFromJString):
458         (releaseCharactersForJString):
459         (getCharactersFromJStringInEnv):
460         (releaseCharactersForJStringInEnv):
461         * bindings/jni/jni_utility.h:
462         * bindings/runtime.cpp:
463         (Instance::createBindingForLanguageInstance):
464         * bindings/runtime.h:
465         (Bindings::Instance::):
466
467 2003-11-18  Richard Williamson   <rjw@apple.com>
468
469         More live connect stubs.  We're getting close.
470
471         Reviewed by Chris.
472
473         * JavaScriptCore.pbproj/project.pbxproj:
474         * bindings/jni/jni_runtime.cpp:
475         (JavaClass::JavaClass):
476         (JavaInstance::JavaInstance):
477         (JavaInstance::~JavaInstance):
478         * bindings/jni/jni_runtime.h:
479         (Bindings::JavaConstructor::value):
480         (Bindings::JavaField::value):
481         (Bindings::JavaMethod::value):
482         (Bindings::JavaClass::_commonDelete):
483         (Bindings::JavaClass::_commonCopy):
484         (Bindings::JavaClass::methodNamed):
485         (Bindings::JavaClass::fieldNamed):
486         (Bindings::JavaInstance::getClass):
487         * bindings/runtime.cpp: Added.
488         * bindings/runtime.h:
489         (Bindings::Instance::~Instance):
490         * bindings/runtime_object.cpp: Added.
491         (RuntimeObjectImp::classInfo):
492         (RuntimeObjectImp::RuntimeObjectImp):
493         (RuntimeObjectImp::get):
494         (RuntimeObjectImp::put):
495         (RuntimeObjectImp::canPut):
496         (RuntimeObjectImp::hasProperty):
497         (RuntimeObjectImp::deleteProperty):
498         (RuntimeObjectImp::defaultValue):
499         (RuntimeObjectImp::_initializeClassInfoFromInstance):
500         * bindings/runtime_object.h: Added.
501         (KJS::RuntimeObjectImp::setInternalInstance):
502         (KJS::RuntimeObjectImp::getInternalInstance):
503         * kjs/object.cpp:
504         (KJS::ObjectImp::get):
505         (KJS::ObjectImp::hasProperty):
506         * kjs/value.h:
507         (KJS::):
508
509 2003-11-17  Maciej Stachowiak  <mjs@apple.com>
510
511         Patch from Harri, reviewed by me.
512
513         - fixed 3487375 - backwards array slice causes infinite loop
514         
515         * kjs/array_object.cpp:
516         (ArrayProtoFuncImp::call):
517
518 2003-11-17  Maciej Stachowiak  <mjs@apple.com>
519
520         Patch from Harri Porten reviewed by me.
521
522         - fixed 3487371 - operator precedence for bitwise or, xor and and is wrong
523
524         * kjs/grammar.y: Correct the precedence.
525
526 2003-11-16  Maciej Stachowiak  <mjs@apple.com>
527
528         Reviewed by John.
529
530         - fixed 3483829 - JavaScriptCore needs workaround to compile on Merlot
531         
532         * JavaScriptCore.pbproj/project.pbxproj: Add -Wno-long-double to
533         warning flags.
534
535 === Safari-114 ===
536
537 2003-11-13  Richard Williamson   <rjw@apple.com>
538
539         Factored common code between copy constructor and assignment operator.
540
541         Reviewed by Chris.
542
543         * ChangeLog:
544         * bindings/jni/jni_runtime.h:
545         (Bindings::JavaConstructor::_commonCopy):
546         (Bindings::JavaConstructor::JavaConstructor):
547         (Bindings::JavaConstructor::operator=):
548         (Bindings::JavaField::type):
549         * bindings/runtime.h:
550
551 2003-11-13  Richard Williamson   <rjw@apple.com>
552
553         More LiveConnect stuff.  This checkin adds abstract classes to model
554         language runtimes and a JNI based set of concrete implementations for
555         Java.
556
557         Reviewed by Chris.
558
559         * JavaScriptCore.pbproj/project.pbxproj:
560         * Makefile.am:
561         * bindings/Makefile.am: Removed.
562         * bindings/jni/Makefile.am: Removed.
563         * bindings/jni/jni_runtime.cpp: Added.
564         (JavaField::JavaField):
565         (JavaConstructor::JavaConstructor):
566         (JavaMethod::JavaMethod):
567         (JavaClass::JavaClass):
568         * bindings/jni/jni_runtime.h: Added.
569         (Bindings::JavaString::JavaString):
570         (Bindings::JavaString::~JavaString):
571         (Bindings::JavaString::operator=):
572         (Bindings::JavaString::characters):
573         (Bindings::JavaParameter::JavaParameter):
574         (Bindings::JavaParameter::~JavaParameter):
575         (Bindings::JavaParameter::operator=):
576         (Bindings::JavaParameter::type):
577         (Bindings::JavaConstructor::JavaConstructor):
578         (Bindings::JavaConstructor::~JavaConstructor):
579         (Bindings::JavaConstructor::operator=):
580         (Bindings::JavaConstructor::parameterAt):
581         (Bindings::JavaConstructor::numParameters):
582         (Bindings::JavaField::JavaField):
583         (Bindings::JavaField::~JavaField):
584         (Bindings::JavaField::operator=):
585         (Bindings::JavaField::name):
586         (Bindings::JavaField::type):
587         (Bindings::JavaMethod::JavaMethod):
588         (Bindings::JavaMethod::_commonDelete):
589         (Bindings::JavaMethod::~JavaMethod):
590         (Bindings::JavaMethod::_commonCopy):
591         (Bindings::JavaMethod::operator=):
592         (Bindings::JavaMethod::name):
593         (Bindings::JavaMethod::returnType):
594         (Bindings::JavaMethod::parameterAt):
595         (Bindings::JavaMethod::numParameters):
596         (Bindings::JavaClass::_commonDelete):
597         (Bindings::JavaClass::~JavaClass):
598         (Bindings::JavaClass::_commonCopy):
599         (Bindings::JavaClass::JavaClass):
600         (Bindings::JavaClass::operator=):
601         (Bindings::JavaClass::name):
602         (Bindings::JavaClass::methodAt):
603         (Bindings::JavaClass::numMethods):
604         (Bindings::JavaClass::constructorAt):
605         (Bindings::JavaClass::numConstructors):
606         (Bindings::JavaClass::fieldAt):
607         (Bindings::JavaClass::numFields):
608         * bindings/jni/jni_utility.cpp:
609         (callJNIMethod):
610         (callJNIMethodA):
611         (callJNIObjectMethod):
612         (callJNIByteMethod):
613         (callJNICharMethod):
614         (callJNIShortMethod):
615         (callJNIIntMethod):
616         (callJNILongMethod):
617         (callJNIFloatMethod):
618         (callJNIDoubleMethod):
619         (callJNIVoidMethodA):
620         (callJNIObjectMethodA):
621         (callJNIByteMethodA):
622         (callJNICharMethodA):
623         (callJNIShortMethodA):
624         (callJNIIntMethodA):
625         (callJNILongMethodA):
626         (callJNIFloatMethodA):
627         (callJNIDoubleMethodA):
628         (getCharactersFromJString):
629         (releaseCharactersForJString):
630         * bindings/jni/jni_utility.h:
631         * bindings/objc/Makefile.am: Removed.
632         * bindings/runtime.h: Added.
633         (Bindings::Parameter::~Parameter):
634         (Bindings::Constructor::~Constructor):
635         (Bindings::Field::~Field):
636         (Bindings::Method::~Method):
637         (Bindings::Class::~Class):
638
639 2003-11-13  Maciej Stachowiak  <mjs@apple.com>
640
641         Reviewed by John.
642
643         - fixed 3472562 - Null or Undefined variables passed to IN operator cause javascript exceptions
644         
645         * kjs/nodes.cpp:
646         (ForInNode::execute): If the in value is null or undefined, bail
647         out early, since attempting to iterate its properties will throw
648         an exception.
649
650 2003-11-12  Darin Adler  <darin@apple.com>
651
652         - fixed the build
653
654         * Makefile.am: Fix the build by removing the bindings directory from SUBDIRS.
655         Later, we can either add this back and add the Makefile.am files to the top
656         level configure.in or leave it out and remove the Makefile.am files.
657
658 2003-11-12  Richard Williamson   <rjw@apple.com>
659
660         Added utility functions for calling JNI methods.
661
662         Reviewed by Chris.
663
664         * JavaScriptCore.pbproj/project.pbxproj:
665         * Makefile.am:
666         * bindings/Makefile.am: Added.
667         * bindings/jni/Makefile.am: Added.
668         * bindings/jni/jni_utility.cpp: Added.
669         (attachToJavaVM):
670         (callJNIMethod):
671         (callJNIVoidMethod):
672         (callJNIObjectMethod):
673         (callJNIByteMethod):
674         (callJNICharMethod):
675         (callJNIShortMethod):
676         (callJNIIntMethod):
677         (callJNILongMethod):
678         (callJNIFloatMethod):
679         (callJNIDoubleMethod):
680         * bindings/jni/jni_utility.h: Added.
681         * bindings/objc/Makefile.am: Added.
682
683 2003-11-08  Darin Adler  <darin@apple.com>
684
685         Reviewed by John.
686
687         - fixed 3477528 -- array.sort(function) fails if the function returns a non-zero value that rounds to zero
688
689         * kjs/array_object.cpp:
690         (compareByStringForQSort): Added checks for undefined values to match what the specification calls for.
691         (compareWithCompareFunctionForQSort): Added checks for undefined values as above, and also changed the
692         code that looks at the compare function result to look at the number returned without rounding to an integer.
693         (ArrayProtoFuncImp::call): Changed the code that looks at the compare function result to look at the number
694         returned without rounding to an integer.
695
696 === Safari-113 ===
697
698 2003-11-03  Vicki Murley <vicki@apple.com>
699
700         Reviewed by kocienda.
701
702         - fixed <rdar://problem/3471096>: non-B&I builds should not use order files, because they cause false "regressions" in perf.
703
704         * JavaScriptCore.pbproj/project.pbxproj: added empty SECTORDER_FLAGS variables to the Development and Deployment build styles
705
706 2003-11-02  Darin Adler  <darin@apple.com>
707
708         Reviewed by Maciej.
709
710         - changed list manipulation to use Harri Porten's idea of a circular
711           linked list that is built from head to tail rather than building the
712           list backwards and reversing the list when done
713
714         * kjs/grammar.y: Handle CatchNode and FinallyNode in a type-safe way.
715         Change many places that passed 0L to pass nothing at all, or to pass 0.
716
717         * kjs/nodes.h:
718         (KJS::ElementNode::ElementNode): Build a circular list instead of a 0-terminated
719         backwards list.
720         (KJS::ArrayNode::ArrayNode): Break the circular list instead of reversing the list.
721         (KJS::PropertyValueNode::PropertyValueNode): Moved before ObjectLiteralNode so the
722         inline code in ObjectLiteralNode works. Build a circular list instead of a 0-terminated
723         backwards list. Made the case for the first node separate so we don't need a nil check.
724         (KJS::ObjectLiteralNode::ObjectLiteralNode): Break the circular list instead of
725         reversing the list.
726         (KJS::ArgumentListNode::ArgumentListNode): Build a circular list instead of a 0-terminated
727         backwards list. Also, made the constructors inline (moved here from .cpp file).
728         (KJS::ArgumentsNode::ArgumentsNode): Break the circular list instead of
729         reversing the list.
730         (KJS::NewExprNode::NewExprNode): Changed a 0L to 0.
731         (KJS::StatListNode::StatListNode): Make this constructor no longer inline (moved into
732         .cpp file). The one in the .cpp file builds a circular list instead of a 0-terminated
733         backwards list.
734         (KJS::VarDeclListNode::VarDeclListNode): Build a circular list instead of a 0-terminated
735         backwards list.
736         (KJS::VarStatementNode::VarStatementNode): Break the circular list instead of reversing
737         the list.
738         (KJS::BlockNode::BlockNode): Make this constructor no longer inline (moved into .cpp file).
739         The one in the .cpp file breaks the list instead of reversing it.
740         (KJS::ForNode::ForNode): Break the circular list instead of reversing the list.
741         (KJS::CaseClauseNode::CaseClauseNode): Break the circular list instead of reversing the
742         list.
743         (KJS::ClauseListNode::ClauseListNode): Build a circular list instead of a 0-terminated
744         backwards list.
745         (KJS::CaseBlockNode::CaseBlockNode): Make this constructor no longer inline (moved into
746         .cpp file). The one in the .cpp file breaks the list instead of reversing it.
747         (KJS::TryNode::TryNode): Changed constructor to take typed parameters for the catch and
748         finally nodes rather than just Node.
749         (KJS::ParameterNode::ParameterNode): Build a circular list instead of a 0-terminated
750         backwards list.
751         (KJS::FuncDeclNode::FuncDeclNode): Break the circular list instead of reversing the
752         list.
753         (KJS::FuncExprNode::FuncExprNode): Break the circular list instead of reversing the
754         list.
755
756         * kjs/nodes.cpp:
757         (StatListNode::StatListNode): Moved this constructor here, no longer inline.
758         Did the "break circular list" thing instead of the "reverse list" thing.
759         Added setLoc calls to match KJS in the KDE tree; since we don't currently
760         use the JavaScript debugging support, it's unclear whether there's any benefit, but
761         later we might be using it and it's good to be as close as possible.
762         (BlockNode::BlockNode): Moved this constructor here, no longer inline.
763         Did the "break circular list" thing instead of the "reverse list" thing.
764         Added setLoc calls.
765         (CaseBlockNode::CaseBlockNode): Moved this constructor here, no longer inline.
766         Did the "break circular list" thing instead of the "reverse list" thing.
767         (SourceElementsNode::SourceElementsNode): Moved this constructor here, no longer inline.
768         Did the "break circular list" thing instead of the "reverse list" thing.
769         Added setLoc calls.
770
771         * kjs/grammar.cpp: Regenerated.
772         * kjs/grammar.cpp.h: Regenerated.
773         * kjs/grammar.h: Regenerated.
774
775 === Safari-112 ===
776
777 2003-10-30  Maciej Stachowiak  <mjs@apple.com>
778
779         Reviewed by Ken.
780
781         - fixed 3427069 - browsing mp3.com causes leaks (KJS)
782         
783         * kjs/string_object.cpp:
784         (StringProtoFuncImp::call): Don't do an early return, since that
785         could leak a temporary regexp.
786
787 2003-10-29  Maciej Stachowiak  <mjs@apple.com>
788
789         Reviewed by Darin.
790
791         - fixed 3426076 - Leak of JS lexer data visiting http://www.ebay.com
792         
793         * kjs/grammar.cpp:
794         (yyerror): Updated the commented code.
795         * kjs/grammar.y: Don't delete string and identifier tokens when done
796         with them any more, they'll get cleaned up by the lexer now.
797         * kjs/internal.cpp:
798         (Parser::parse): Tell lexer when done parsing.
799         * kjs/lexer.cpp:
800         (Lexer::Lexer): Initialize new data members.
801         (Lexer::lex): Use new methods to make strings and identifiers, and
802         save them.
803         (Lexer::makeIdentifier): Make a new Identifier and save it in an
804         auto-growing array.
805         (Lexer::makeUString): Likewise for UStrings.
806         (Lexer::doneParsing): Clean up arrays of Ifentifiers and UStrings.
807         * kjs/lexer.h:
808
809 2003-10-28  Maciej Stachowiak  <mjs@apple.com>
810
811         Reviewed by Ken.
812
813         - fixed 3413962 -  malicious web pages can kill all future JavaScript execution by breaking recursion limit check
814         
815         * kjs/nodes.cpp:
816         (FunctionCallNode::evaluate): If we're going to return early due
817         to breaking the recursion limit, make sure to lower it again, or
818         it will creep up by one each time it's exceeded.
819
820 2003-10-26  Darin Adler  <darin@apple.com>
821
822         * JavaScriptCorePrefix.h: Added a C case to the NULL definition since we use C as well
823         as C++ in this project.
824
825 2003-10-26  Darin Adler  <darin@apple.com>
826
827         - rolled in some CString changes Harri Porten did on the KDE side
828
829         * kjs/ustring.cpp:
830         (KJS::CString::CString): Use memcpy instead of strcpy for speed. Fix an off by one error
831         in the copy constructor.
832         (KJS::CString::operator=): Use memcpy instead of strcpy for speed.
833
834         * JavaScriptCorePrefix.h: Add a definition of NULL here that takes advantage of the GNU
835         __null feature even if the system C library doesn't.
836
837 == Rolled over to ChangeLog-2003-10-25 ==