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