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