JavaScriptCore:
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2005-04-26  Maciej Stachowiak  <mjs@apple.com>
2
3         Reviewed by Chris.
4
5         <rdar://problem/4092136> reproducible crash in KJS::kjs_fast_realloc loading maps.google.com
6         
7         * kjs/string_object.cpp:
8         (StringObjectFuncImp::call): Allocate adopted ustring buffer properly.
9
10 2005-04-22  Darin Adler  <darin@apple.com>
11
12         Reviewed by Maciej.
13
14         * kjs/ustring.cpp: (KJS::UString::UTF8String): Fix off-by-one error in surrogate pair logic.
15
16 2005-04-22  Darin Adler  <darin@apple.com>
17
18         Reviewed by John.
19
20         - fixed <rdar://problem/4090046> JavaScript throw statement causes parse error when no semicolon is present
21
22         * kjs/grammar.y: Added an additional rule for throw like the ones we have for all the other semicolon rules.
23         Not sure why we missed this one earlier.
24
25         * kjs/grammar.cpp: Regenerated.
26
27 === JavaScriptCore-412.1 ===
28
29 2005-04-20  Darin Adler  <darin@apple.com>
30
31         Reviewed by Maciej.
32
33         - speedups, total 12% on JavaScript iBench
34
35         I ran the benchmark under Shark and followed its advice a lot, mainly.
36
37         * kjs/collector.cpp:
38         (KJS::Collector::allocate): Take out special case for 0; costing speed but unexercised.
39         Use numLiveObjectsAtLastCollect instead of numAllocationsSinceLastCollect so we don't
40         have to bump it each time we call allocate. Put numLiveObjects into a local variable to
41         cut down on global variable accesses. Make "next" cell pointer be a byte offset rather
42         than a pointer so we don't need a special case for NULL. Allow freeList to point to some
43         bogus item when the entire block is full rather than going out of our way to make it
44         point to NULL.
45         (KJS::Collector::markProtectedObjects): Get table size and pointer into locals outside
46         the loop to avoid re-loading them over and over again.
47         (KJS::Collector::collect): Put numLiveObjects into a local variable to cut down on global
48         variable accesses. Make "next" cell pointer be a byte offset as above. Put numLiveObjects
49         into a local variable to cut down on global variable accesses. Set numLiveObjectsAtLastCollect
50         rather than numAllocationsSinceLastCollect.
51         (KJS::Collector::numReferencedObjects): Get table size and pointer into locals outside
52         the loop to avoid re-loading them over and over again.
53         (KJS::Collector::rootObjectClasses): Ditto.
54
55         * kjs/internal.h: Make Value be a friend of NumberImp so it can construct number objects
56         directly, avoiding the conversion from Number to Value.
57
58         * kjs/internal.cpp: (StringImp::toObject): Don't use Object::dynamicCast, because we know
59         the thing is an object and we don't want to do all the extra work; just cast directly.
60
61         * kjs/list.cpp: (KJS::List::List): Construct valueRefCount in a way that avoids the need for
62         a branch -- in the hot case this just meant avoiding checking a variable we just set to false.
63
64         * kjs/lookup.cpp: (keysMatch): Marked this inline.
65
66         * kjs/nodes.cpp: Disabled KJS_BREAKPOINT, to avoid calling hitStatement all the time.
67         (BooleanNode::evaluate): Make a Value directly, rather than making a Boolean which is converted
68         into a Value.
69         (NumberNode::evaluate): Ditto.
70         (StringNode::evaluate): Ditto.
71         (ArrayNode::evaluate): Ditto.
72         (FunctionCallNode::evaluate): Use new inline baseIfMutable to avoid unnecessary getBase function.
73         Also just use a pointer for func, rather than an Object.
74         (PostfixNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
75         passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
76         integer and back.
77         (DeleteNode::evaluate): Make a Value directly.
78         (TypeOfNode::evaluate): Use new inline baseIfMutable and make Value directly.
79         (PrefixNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
80         passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
81         integer and back.
82         (UnaryPlusNode::evaluate): Make a Value directly.
83         (NegateNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
84         passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
85         integer and back.
86         (BitwiseNotNode::evaluate): Make a Value directly.
87         (LogicalNotNode::evaluate): Ditto.
88         (ShiftNode::evaluate): Don't convert to a double before making a Value.
89         (RelationalNode::evaluate): Make a Value directly.
90         (EqualNode::evaluate): Ditto.
91         (BitOperNode::evaluate): Ditto.
92         (AssignNode::evaluate): Make a Value directly. Change code so that it passes a "known to be integer"
93         boolean in, often avoiding a conversion from floating point to integer and back.
94         (VarDeclNode::evaluate): Make a Value directly.
95         (ForNode::execute): Remove unused local variable.
96
97         * kjs/operations.h:
98         (KJS::isNaN): Inlined.
99         (KJS::isInf): Ditto.
100         (KJS::isPosInf): Ditto.
101         (KJS::isNegInf): Ditto.
102
103         * kjs/operations.cpp: Change isNaN, isInf, isPosInf, and isNegInf to be inlines.
104         (KJS::equal): Rewrite to avoid creating values and recursing back into the function.
105         (KJS::relation): Rearranged code so that we don't need explicit isNaN checks.
106         (KJS::add): Changed code to make Value directly, and so that it passes a "known to be integer"
107         boolean in, often avoiding a conversion from floating point to integer and back.
108         (KJS::mult): Ditto.
109
110         * kjs/property_map.cpp:
111         (KJS::PropertyMap::~PropertyMap): Get size and entries pointer outside loop to avoid
112         re-getting them inside the loop.
113         (KJS::PropertyMap::clear): Ditto. Clear value pointer in addition to key, so we can just
114         look at the value pointer in the mark function.
115         (KJS::PropertyMap::get): Get sizeMask and entries pointer outside loop to avoid
116         re-getting them inside the loop.
117         (KJS::PropertyMap::put): Ditto.
118         (KJS::PropertyMap::insert): Ditto.
119         (KJS::PropertyMap::remove): Ditto.
120         (KJS::PropertyMap::mark): Get size and entries pointer outside loop to avoid
121         re-getting them inside the loop. Don't bother checking key for 0, since we already have
122         to check value for 0. (Also had to change clear() to set value to 0.)
123         (KJS::PropertyMap::addEnumerablesToReferenceList): Get size and entries pointer outside
124         loop to avoid re-getting them inside the loop.
125         (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): Ditto.
126         (KJS::PropertyMap::save): Ditto.
127
128         - other changes
129
130         * kjs/protected_values.h: Remove unneeded class name qualifiers.
131
132         * kjs/reference.h:
133         (KJS::Reference::baseIfMutable): New inline function: replaces isMutable().
134         (KJS::Reference::Reference): Inlined.
135         * kjs/reference.cpp:
136         (KJS::Reference::getValue): Rewrite to not use getBase.
137         (KJS::Reference::putValue): Ditto.
138         (KJS::Reference::deleteValue): Dittol
139
140         * kjs/simple_number.h:
141         (KJS::SimpleNumber::integerFits): Added. For use when the parameter is known to be integral.
142
143         * kjs/string_object.cpp: (StringProtoFuncImp::call): Create the number without first converting
144         to double in various cases that involve integers.
145
146         * kjs/ustring.h:
147         (KJS::UString::attach): Inlined.
148         (KJS::UString::release): Inlined.
149         * kjs/ustring.cpp:
150         (KJS::UString::find): Get first character outside the loop instead of re-fetching it each time.
151
152         * kjs/value.cpp:
153         (Value::Value): Added overloads for all the various specific types of values, so you don't have
154         to convert from, say, Number to Value, just to create one.
155         (Number::Number): Added an overload that takes a boolean to indicate the number is already
156         known to be an integer.
157
158         * kjs/value.h: Added more Value constructors, added a version of toNumber that returns
159         a boolean to indicate if the number is known to be an integer (because it was a "simple number").
160         (KJS::ValueImp::marked): Inlined.
161         (KJS::ValueImp::dispatchType): Inlined.
162         (KJS::ValueImp::dispatchToPrimitive): Inlined.
163         (KJS::ValueImp::dispatchToBoolean): Inlined.
164         (KJS::ValueImp::dispatchToNumber): Inlined.
165         (KJS::ValueImp::dispatchToString): Inlined.
166         (KJS::ValueImp::dispatchToUInt32): Inlined.
167
168 2005-04-14  Maciej Stachowiak  <mjs@apple.com>
169
170         - make fast_malloc.h a private header, not project
171
172         * JavaScriptCore.pbproj/project.pbxproj:
173
174 2005-04-12  Maciej Stachowiak  <mjs@apple.com>
175
176         Reviewed by Richard.
177
178         <rdar://problem/4089734> JavaScript iBench can be sped up ~10% with custom allocator
179
180         - use custom single-threaded malloc for all non-GC JavaScriptCore
181         allocations, for a 9.1% speedup on JavaScript iBench
182         
183         * JavaScriptCore.pbproj/project.pbxproj:
184         * kjs/collector.cpp:
185         (KJS::Collector::allocate): Use dlmalloc to allocate the collector blocks.
186         (KJS::Collector::collect): And dlfree to free it.
187         * kjs/fast_malloc.cpp: Added, just the standard dlmalloc here.
188         * kjs/fast_malloc.h: Added. Declarations for the functions. Also added a handy
189         macro to give a class custom operator new/delete
190         * kjs/identifier.cpp:
191         (KJS::Identifier::add): Use dlmalloc/dlfree.
192         * kjs/nodes.h: make nodes KJS_FAST_ALLOCATED.
193         * kjs/property_map.cpp:
194         (KJS::PropertyMap::~PropertyMap): Use dlmalloc/dlfree.
195         (KJS::PropertyMap::rehash): ditto
196         * kjs/scope_chain.h:
197         * kjs/ustring.cpp:
198         (KJS::UString::Rep::createCopying): New named constructor that copies a passed-in
199         buffer, to hide allocation details from webcore.
200         (KJS::UString::UString): use createCopying when appropriate.
201         (KJS::UString::Rep::destroy): Use dlmalloc/dlfree.
202         (KJS::UString::expandedSize): likewise
203         (KJS::UString::expandCapacity): likewise
204         (KJS::UString::expandPreCapacity): likewise
205         (KJS::UString::spliceSubstringsWithSeparators): likewise
206         (KJS::UString::append): likewise
207         (KJS::UString::operator=): likewise
208         (KJS::UString::detach): likewise
209         * kjs/ustring.h: make UString and UString::Rep KJS_FAST_ALLOCATED.
210
211 2005-04-11  Maciej Stachowiak  <mjs@apple.com>
212
213         Reviewed by John.
214
215         <rdar://problem/4086819> Avoid using protect count hash table so much for 5.6% JS iBench speedup
216
217         - Avoid using protected values hash for the two most common cases
218         - Bump up ListImp high water mark, new testing shows 508 ListImps are
219         created during JS iBench.
220
221         Net result is a 5.6% speedup on JavaScript iBench
222         
223         * kjs/collector.cpp:
224         (KJS::Collector::collect): mark protected lists as appropriate.
225         * kjs/context.h:
226         * kjs/list.cpp:
227         (KJS::ListImp::markValues): Moved implementation from List::markValues
228         (KJS::List::markProtectedLists): Implemented - scan pool and overflow
229         list.
230         (KJS::allocateListImp): link lists outside the pool into a separate
231         doubly linked list to be able to mark protected lists
232         (KJS::deallocateListImp): do the corresponding delinking
233         (KJS::List::derefValues): do nothing in conservative GC mode
234         (KJS::List::refValues): do nothing in conservative GC mode
235         (KJS::List::markValues): call ListImp version
236         (KJS::List::append):
237         * kjs/list.h:
238
239 === Safari-412 ===
240
241 === Safari-411 ===
242
243 === Safari-410 ===
244
245 === Safari-409 ===
246
247 === Safari-408 ===
248
249 === Safari-407 ===
250
251 2005-03-16  Jens Alfke  <jens@apple.com>
252
253         Reviewed by Kevin.
254
255         Fix for <rdar://problem/4025212> "REGRESSION (163-164): search not performed correctly; united.com"
256         JavaScript unescape("") was returning a messed-up String object that appeared identical to an empty string, but would in some cases act as 'null' when passed to native functions, in this case the Option() constructor.
257         In the implementation of unescape, the UString holding the result was not initialized to "", so it started out as a null string. If nothing was appended to it, it remained null, resulting in a JavaScript String object with some bad behaviors (namely, converting it to a DOMStringImpl results in a NULL pointer.)
258         Darin says this regression occurred when we replaced our own implementation of unescape() with code from KJS.
259
260         * kjs/function.cpp:
261         (KJS::GlobalFuncImp::call):
262
263 2005-03-15  Richard Williamson   <rjw@apple.com>
264
265         Fixed <rdar://problem/4053276> WebScripting protocol in WebKit cannot convert Boolean in Javascript to BOOL in Objective-C
266
267         Added JavaScript boolean to type that can be converted to
268         ObjC scalar parameters.
269
270         Reviewed by Ken Kocienda.
271
272         * bindings/objc/objc_utility.mm:
273         (KJS::Bindings::convertValueToObjcValue):
274
275 === Safari-406 ===
276
277 === Safari-405 ===
278
279 === Safari-403 ===
280
281 === Safari-402 ===
282
283 === Safari-401 ===
284
285 === Safari-400 ===
286
287 === Safari-188 ===
288
289 2005-02-21  Darin Adler  <darin@apple.com>
290
291         * kjs/date_object.cpp: (timetUsingCF): Fixed indenting.
292
293 2005-02-17  Richard Williamson   <rjw@apple.com>
294
295         Fixed <rdar://problem/4003251> Safari crashed at www.icelandair.com in LiveConnect code converting a Java object to a string
296
297         Added nil check.
298
299         Reviewed by John Sullivan.
300
301         * bindings/jni/jni_runtime.cpp:
302         (JavaField::valueFromInstance):
303
304 === Safari-187 ===
305
306 2005-02-11  Richard Williamson   <rjw@apple.com>
307
308         Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls
309
310         Re-factored how 'native' wrappers for JS objects are created.  The interpreter now
311         creates these wrappers.  The WebCore subclass of the interpreter now overrides
312         createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects.
313
314         Reviewed by Ken.
315
316         * bindings/c/c_utility.cpp:
317         (convertValueToNPVariant):
318         * bindings/jni/jni_instance.cpp:
319         (JavaInstance::invokeMethod):
320         * bindings/jni/jni_objc.mm:
321         (KJS::Bindings::dispatchJNICall):
322         * bindings/jni/jni_runtime.cpp:
323         (JavaField::valueFromInstance):
324         (JavaArray::valueAt):
325         * bindings/objc/WebScriptObject.mm:
326         (-[WebScriptObject _setExecutionContext:KJS::Bindings::]):
327         (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
328         * bindings/objc/WebScriptObjectPrivate.h:
329         * bindings/objc/objc_utility.h:
330         * bindings/objc/objc_utility.mm:
331         (KJS::Bindings::convertObjcValueToValue):
332         (KJS::Bindings::createObjcInstanceForValue):
333         * bindings/runtime.cpp:
334         (Instance::createBindingForLanguageInstance):
335         (Instance::createRuntimeObject):
336         (Instance::createLanguageInstanceForValue):
337         * bindings/runtime.h:
338         * kjs/interpreter.cpp:
339         (Interpreter::createLanguageInstanceForValue):
340         * kjs/interpreter.h:
341
342 === Safari-186 ===
343
344 2005-02-10  Darin Adler  <darin@apple.com>
345
346         "Reviewed" by Richard (he told me the file was obsolete).
347
348         - got rid of an obsolete file
349
350         * bindings/npsap.h: Removed.
351
352 === Safari-185 ===
353
354 === Safari-183 ===
355
356 2005-02-03  Richard Williamson   <rjw@apple.com>
357
358         Fixed <rdar://problem/3972905> CrashTracer: ...36 crashes at com.apple.WebCore: khtml::CSSStyleSelector::applyDeclarations + 120
359
360         Revert to old (and correct) behavior of returning runtime object
361         when passed as a parameter, rather than it's corresponding DOM
362         object.
363
364         Reviewed by Chris.
365
366         * bindings/objc/WebScriptObject.mm:
367         (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
368
369 === Safari-182 ===
370
371 2005-01-28  Richard Williamson   <rjw@apple.com>
372
373         Fixed <rdar://problem/3980389> JavaScript bindings access incorrect runtime object
374
375         Only use special 'back door' property to get the runtime object if thisObj isn't
376         already a runtime object.
377
378         <gratuitous> Cleaned up a couple of strcmp on ClassInfo name.  Used == on
379         ClassInfo pointer instead.
380
381         Reviewed by Chris.
382
383         * bindings/c/c_utility.cpp:
384         (convertValueToNPVariant):
385         * bindings/objc/WebScriptObject.mm:
386         (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
387         * bindings/runtime_method.cpp:
388         (RuntimeMethodImp::call):
389
390 === Safari-181 ===
391
392 2005-01-26  Richard Williamson   <rjw@apple.com>
393
394         Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test
395
396         I added a member variable to ObjectImp.  This changed it's size and consequently
397         hampered the optimizations built into the garbage collector.  Objects no longer
398         fit within the allocators cell size, and thus allocation fell back to a slower
399         allocator.
400
401         As a result of this fix I also dramatically cleaned up how runtime objects are
402         accessed.  The path mostly *removes* code.
403         
404         Reviewed by Chris.
405
406         * bindings/runtime_method.cpp:
407         (RuntimeMethodImp::call):
408         * bindings/runtime_object.cpp:
409         (RuntimeObjectImp::get):
410         (RuntimeObjectImp::put):
411         (RuntimeObjectImp::canPut):
412         (RuntimeObjectImp::hasProperty):
413         (RuntimeObjectImp::defaultValue):
414         * bindings/runtime_object.h:
415         * kjs/object.cpp:
416         (KJS::ObjectImp::ObjectImp):
417         * kjs/object.h:
418
419 2005-01-20  Darin Adler  <darin@apple.com>
420
421         Reviewed by me, changes by Han Ming Ong.
422
423         - <rdar://problem/3964302> SWB: A few files need to be updated to be compilable under GCC 4.0
424
425         * bindings/objc/WebScriptObjectPrivate.h: Make members public.
426         * kjs/lookup.h: Change "value.h" to "object.h" because we need KJS::Object to compile a template.
427
428 2005-01-20  Richard Williamson   <rjw@apple.com>
429
430         Fixed <rdar://problem/3964634> undefined property value from binding seems to evaluate to true in an if statement
431
432         The comprehensive fix for this problem requires new API, as described in 3965326.  However,
433         given that we can't add new API at this point, the 'ObjcFallbackObjectImp' will behave
434         like and Undefined object if  invokeUndefinedMethodFromWebScript:withArguments: isn't
435         implemented on the bound object.
436
437         Reviewed by Chris.
438
439         * bindings/objc/objc_runtime.h:
440         * bindings/objc/objc_runtime.mm:
441         (ObjcFallbackObjectImp::type):
442         (ObjcFallbackObjectImp::implementsCall):
443         (ObjcFallbackObjectImp::toBoolean):
444         * bindings/testbindings.mm:
445         (+[MyFirstInterface isSelectorExcludedFromWebScript:]):
446         (+[MyFirstInterface isKeyExcludedFromWebScript:]):
447
448 === Safari-180 ===
449
450 2005-01-19  Richard Williamson   <rjw@apple.com>
451
452         Fixed <rdar://problem/3853676> Browser Crash when accessing CCWeb Progress Page - KJS::Bindings::convertValueToJValue
453
454         Fixed the following problems with LiveConnect that are demonstrated by the application
455         described in 3853676.
456
457         1.  If a nil object is passed in an array from Java to JavaScript we will crash.
458         2.  We sometimes will incorrectly attempt to access a generic JavaScript as a Java runtime object wrapper.
459         3.  We will sometimes fail to find the correct static method ID.
460
461         Reviewed by Maciej.
462
463         * bindings/jni/jni_jsobject.cpp:
464         (JSObject::convertJObjectToValue):
465         (JSObject::listFromJArray):
466         * bindings/jni/jni_runtime.cpp:
467         (JavaField::valueFromInstance):
468         (JavaField::setValueToInstance):
469         * bindings/jni/jni_utility.cpp:
470         (KJS::Bindings::getMethodID):
471         (KJS::Bindings::convertValueToJValue):
472         * bindings/runtime_array.h:
473
474 2005-01-18  Richard Williamson   <rjw@apple.com>
475
476         Fixed several issues all arising from analysis of plugin detection code at ifilm.com:
477
478         Fixed <rdar://problem/3958592> can't script plug-ins if plug-in is invoked with <object> element instead of <embed>
479         Fixed <rdar://problem/3958597> <object> elements with IDs do not show up as named properties of the document
480         Fixed <rdar://problem/3960973> DOM objects for plugin elements are not accessible
481         Fixed <rdar://problem/3958601> need an additional class ID in WebCore for the Real plug-in
482
483         We now support accessing scriptable plugin objects that are specified with <applet>, <embed>, or <object>
484         tags.  Also, if any of these elements are named they can be accessed from the document or window objects.
485         Finally, DOM methods are properties will be forwarded appropriately for the plugin's root scriptable object.
486
487         Reviewed by Chris.
488
489         * bindings/objc/objc_instance.h:
490         * bindings/objc/objc_instance.mm:
491         (ObjcInstance::supportsSetValueOfUndefinedField):
492         * bindings/runtime.h:
493         (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
494         * bindings/runtime_object.cpp:
495         (RuntimeObjectImp::RuntimeObjectImp):
496         (RuntimeObjectImp::get):
497         (RuntimeObjectImp::put):
498         (RuntimeObjectImp::canPut):
499         (RuntimeObjectImp::hasProperty):
500         (RuntimeObjectImp::defaultValue):
501         * bindings/runtime_object.h:
502         (KJS::RuntimeObjectImp::fallbackObject):
503         * kjs/object.cpp:
504         (KJS::ObjectImp::ObjectImp):
505         * kjs/object.h:
506         (KJS::ObjectImp::forwardingScriptMessage):
507         (KJS::ObjectImp::setForwardingScriptMessage):
508
509 2005-01-18  Richard Williamson   <rjw@apple.com>
510
511         Back out a change that was incorrectly committed yesterday.
512
513         Reviewed by Chris.
514
515         * bindings/objc/objc_utility.mm:
516         (KJS::Bindings::convertValueToObjcValue):
517
518 2005-01-17  Richard Williamson   <rjw@apple.com>
519
520         Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)
521
522         Keep track of originating execution context and target execution
523         context for native JS object wrappers, and perform appropriate
524         security checks.
525
526         Reviewed by David Harrison.
527
528         * bindings/NP_jsobject.cpp:
529         (_isSafeScript):
530         (_NPN_CreateScriptObject):
531         (_NPN_Invoke):
532         (_NPN_Evaluate):
533         (_NPN_GetProperty):
534         (_NPN_SetProperty):
535         (_NPN_RemoveProperty):
536         (_NPN_HasProperty):
537         (_NPN_HasMethod):
538         (_NPN_SetException):
539         * bindings/NP_jsobject.h:
540         * bindings/c/c_instance.cpp:
541         (CInstance::CInstance):
542         (CInstance::stringValue):
543         * bindings/c/c_instance.h:
544         * bindings/c/c_utility.cpp:
545         (convertValueToNPVariant):
546         * bindings/jni/jni_instance.cpp:
547         (JavaInstance::JavaInstance):
548         (JavaInstance::valueOf):
549         * bindings/jni/jni_instance.h:
550         * bindings/objc/WebScriptObject.mm:
551         (-[WebScriptObject _initializeWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
552         (-[WebScriptObject _initWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
553         (-[WebScriptObject KJS::Bindings::]):
554         (-[WebScriptObject _setOriginExecutionContext:KJS::Bindings::]):
555         (-[WebScriptObject _isSafeScript]):
556         (-[WebScriptObject callWebScriptMethod:withArguments:]):
557         (-[WebScriptObject evaluateWebScript:]):
558         (-[WebScriptObject setValue:forKey:]):
559         (-[WebScriptObject valueForKey:]):
560         (-[WebScriptObject removeWebScriptKey:]):
561         (-[WebScriptObject stringRepresentation]):
562         (-[WebScriptObject webScriptValueAtIndex:]):
563         (-[WebScriptObject setWebScriptValueAtIndex:value:]):
564         (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
565         * bindings/objc/WebScriptObjectPrivate.h:
566         * bindings/objc/objc_instance.h:
567         * bindings/objc/objc_runtime.mm:
568         (convertValueToObjcObject):
569         * bindings/objc/objc_utility.mm:
570         (KJS::Bindings::convertValueToObjcValue):
571         * bindings/runtime.cpp:
572         (Instance::Instance):
573         (Instance::operator=):
574         * bindings/runtime.h:
575         (KJS::Bindings::Instance::Instance):
576         (KJS::Bindings::Instance::setExecutionContext):
577         (KJS::Bindings::Instance::executionContext):
578         * bindings/runtime_root.cpp:
579         (RootObject::setInterpreter):
580         * bindings/runtime_root.h:
581         * kjs/interpreter.h:
582         (KJS::Interpreter::isGlobalObject):
583         (KJS::Interpreter::interpreterForGlobalObject):
584         (KJS::Interpreter::isSafeScript):
585
586 === Safari-179 ===
587
588 2005-01-13  Vicki Murley <vicki@apple.com>
589
590         Reviewed by Adele.
591
592         - fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005
593  
594         * JavaScriptCore.pbproj/project.pbxproj: bump "2004" to "2005"
595
596 2005-01-12  Richard Williamson   <rjw@apple.com>
597
598         Avoid additional work on dealloc by adding early out to
599         removeNativeReference().  (This will save time on dealloc
600         for all ObjC DOM objects.)
601
602         Reviewed by Darin.
603
604         * bindings/runtime_root.cpp:
605         (KJS::Bindings::removeNativeReference):
606
607 2005-01-12  Richard Williamson   <rjw@apple.com>
608
609         Fixed <rdar://problem/3923356> REGRESSION: Java/JavaScript security checks working incorrectly
610
611         We were always returning the first "root" object for all runtime
612         objects.  Changed 0 in loop to i, the index.
613
614         Reviewed by David Harrison.
615
616         * bindings/runtime_root.cpp:
617         (KJS::Bindings::rootForImp):
618
619 2005-01-11  Richard Williamson   <rjw@apple.com>
620
621         Fixed <rdar://problem/3887930> Must use new Java plug-in API to get/set fields so exception handling works (fixes many LiveConnect crashes)
622
623         Use the new dispatching API to invoke JNI, rather than calling JNI
624         directly.
625
626         Reviewed by David Harrison.
627
628         * bindings/jni/jni_instance.cpp:
629         (JavaInstance::invokeMethod):
630         * bindings/jni/jni_runtime.cpp:
631         (JavaField::dispatchValueFromInstance):
632         (JavaField::valueFromInstance):
633         (JavaField::dispatchSetValueToInstance):
634         (JavaField::setValueToInstance):
635         * bindings/jni/jni_runtime.h:
636         * bindings/jni/jni_utility.cpp:
637         (KJS::Bindings::convertValueToJValue):
638
639 === Safari-178 ===
640
641 === Safari-177 ===
642
643 === Safari-176 ===
644
645 2004-12-17  Maciej Stachowiak  <mjs@apple.com>
646
647         Reviewed by Kevin.
648
649         <rdar://problem/3926869> Opening caches window after running PLT causes crash
650         
651         * kjs/protected_values.cpp:
652         (KJS::ProtectedValues::getProtectCount): Don't include simple numbers in
653         the protected value table.
654         (KJS::ProtectedValues::increaseProtectCount): Ditto.
655         (KJS::ProtectedValues::decreaseProtectCount): Ditto.
656
657 2004-12-16  Darin Adler  <darin@apple.com>
658
659         Reviewed by Maciej.
660
661         - fixed <rdar://problem/3920764> Unimplemented String methods toLocaleLowerCase and toLocaleUpperCase
662
663         * kjs/string_object.h: Added toLocaleLowerCase and toLocaleUpperCase.
664         * kjs/string_object.cpp: (StringProtoFuncImp::call): Made locale versions be synonmyms for the
665         non-locale-specific versions.
666         * kjs/string_object.lut.h: Regenerated.
667
668 2004-12-14  Richard Williamson   <rjw@apple.com>
669
670         Pass URL of plugin view when call into JNI.
671
672         Reviewed by Chris.
673
674         * bindings/jni/jni_objc.mm:
675         (KJS::Bindings::dispatchJNICall):
676
677 2004-12-13  Richard Williamson   <rjw@apple.com>
678
679         Fixed <rdar://problem/3827799> repro. crash with IBM Rational ClearCase Web under Safari (Java/LiveConnect-related)
680
681         Add support for calling static Java methods from JavaScript.
682
683         Reviewed by Maciej.
684
685         * bindings/jni/jni_instance.cpp:
686         (JavaInstance::invokeMethod):
687         * bindings/jni/jni_runtime.cpp:
688         (JavaMethod::JavaMethod):
689         * bindings/jni/jni_runtime.h:
690         (KJS::Bindings::JavaMethod::isStatic):
691         * bindings/jni/jni_utility.cpp:
692         (callJNIStaticMethod):
693         (KJS::Bindings::callJNIBooleanMethod):
694         (KJS::Bindings::callJNIStaticBooleanMethod):
695         * bindings/jni/jni_utility.h:
696
697 2004-12-13  Richard Williamson   <rjw@apple.com>
698
699         Fixed <rdar://problem/3887767> LiveConnect doesn't propagate Java exceptions back to JavaScript (prevents security suite from running)
700
701         Reviewed by John.
702
703         * bindings/jni/jni_instance.cpp:
704         (JavaInstance::invokeMethod):
705         * bindings/jni/jni_objc.mm:
706         (KJS::Bindings::dispatchJNICall):
707         * bindings/jni/jni_runtime.h:
708         * bindings/jni/jni_utility.h:
709
710 === Safari-175 ===
711
712 2004-12-07  Maciej Stachowiak  <mjs@apple.com>
713
714         Reviewed by Darin.
715
716         <rdar://problem/3908017> REGRESSION (172-173): assertion in ObjectImp::construct trying to create JS error (24hourfitness.com)
717
718         The fix was to implement copy constructor and assignment operator,
719         the ones that worked on the base class did not replace the
720         defaults apparently!
721         
722         * kjs/protect.h:
723         (KJS::ProtectedValue::ProtectedValue):
724         (KJS::ProtectedValue::operator=):
725         (KJS::ProtectedObject::ProtectedObject):
726         (KJS::ProtectedObject::operator=):
727         
728         Also fixed a bug in the GC test mode that compares the results of
729         the old collector and the new collector.
730
731         * kjs/value.cpp:
732         (ValueImp::mark):
733
734 === Safari-173 ===
735
736 2004-11-23  Richard Williamson   <rjw@apple.com>
737
738         Fixed <rdar://problem/3890385> field and method cache incorrectly capped (c bindings)
739
740         Reviewed by Ken.
741
742         * bindings/c/c_class.cpp:
743         (CClass::_commonInit):
744
745 2004-11-21  Maciej Stachowiak  <mjs@apple.com>
746
747         Reviewed by Ken.
748
749         <rdar://problem/3889696> Enable conservative garbage collection for JavaScript
750         
751         * kjs/collector.cpp:
752         (KJS::Collector::Thread::Thread):
753         (KJS::destroyRegisteredThread):
754         (KJS::initializeRegisteredThreadKey):
755         (KJS::Collector::registerThread):
756         (KJS::Collector::markStackObjectsConservatively):
757         (KJS::Collector::markCurrentThreadConservatively):
758         (KJS::Collector::markOtherThreadConservatively):
759         * kjs/collector.h:
760         * kjs/internal.cpp:
761         (lockInterpreter):
762         * kjs/value.h:
763
764 === Safari-172 ===
765
766 2004-11-15  Richard Williamson   <rjw@apple.com>
767
768         Fixed <rdar://problem/3880561> Default string value of ObjC object in JS should be [obj description].
769
770         Reviewed by Hyatt.
771
772         * bindings/objc/objc_instance.mm:
773         (ObjcInstance::stringValue):
774         * bindings/objc/objc_utility.h:
775         * bindings/objc/objc_utility.mm:
776         (KJS::Bindings::convertNSStringToString):
777         (KJS::Bindings::convertObjcValueToValue):
778
779 === Safari-171 ===
780
781 2004-11-09  Chris Blumenberg  <cblu@apple.com>
782
783         Fixed: <rdar://problem/3872724> soft link against JavaVM to save ~2MB RSHRD
784
785         Reviewed by rjw.
786
787         * ChangeLog:
788         * JavaScriptCore.pbproj/project.pbxproj: don't link against JavaVM
789         * bindings/softlinking.c: Added.
790         (loadFramework): new
791         (getFunctionPointer): new
792         (JNI_GetCreatedJavaVMs): load JavaVM if not already loaded, get _JNI_GetCreatedJavaVMs symbol if we don't already have it, call JNI_GetCreatedJavaVMs
793
794 === Safari-170 ===
795
796 2004-11-04  Darin Adler  <darin@apple.com>
797
798         Reviewed by Ken.
799
800         - fixed <rdar://problem/3865365> since -[WebScriptObject dealloc] does not call [super dealloc], the build will fail due to a warning
801         - fixed behavior so that [[WebScriptObject alloc] initWithCoder:] doesn't leak WebUndefined instances
802           and incidentally so that [[WebScriptObject alloc] init] returns the single shared instance rather
803           than allocating a new one
804
805         * bindings/objc/WebScriptObject.mm: Removed some stray semicolons.
806         (+[WebUndefined allocWithZone:]): Made this the common bottleneck that returns the single instance
807         of WebUndefined, since it's the single method that normally allocates new instances. Calls super to
808         actually allocate only the very first time it's called.
809         (-[WebUndefined initWithCoder:]): Simplified to just return self (no reason to re-lookup the single
810         shared instance since there can be only one).
811         (-[WebUndefined copyWithZone:]): Ditto.
812         (-[WebUndefined retain]): Ditto.
813         (-[WebUndefined retainCount]): Use UINT_MAX constant here (matches usage in NSObject.m for retain count
814         of class).
815         (-[WebUndefined autorelease]): Simplified to just return self (see above).
816         (-[WebUndefined copy]): No need to override this since it just turns around and calls copyWithZone:.
817         (-[WebUndefined dealloc]): Added an assertion since this method should never be called. Also added
818         a call to [super dealloc] after return; to make the new -Wdealloc-check compiler happy (fixing the
819         bug mentioned above).
820         (+[WebUndefined undefined]): Reimplemented; calls allocWithZone:NULL to get to the shared instance.
821         No need to call init, since that's a no-op for this class.
822
823 2004-11-03  David Harrison  <harrison@apple.com>
824
825         Reviewed by Darin.
826         
827         Eliminate the use of a marker file to determine how to build.
828
829         * .cvsignore:
830         * Makefile.am:
831
832 2004-11-01  Richard Williamson   <rjw@apple.com>
833
834         Fixed <rdar://problem/3861469> Latest Real player crashes Safari on some sites.
835
836         Reviewed by Ken.
837
838         * bindings/c/c_instance.cpp:
839         (CInstance::invokeMethod):
840         (CInstance::invokeDefaultMethod):
841         Initialize out parameters to void type.
842
843         * bindings/c/c_runtime.cpp:
844         (CField::valueFromInstance):
845         (CField::setValueToInstance):
846         Initialize out parameters to void type.
847         Also added additional checks to protect against classes that 
848         don't implement all functions.
849
850 2004-11-01  Richard Williamson   <rjw@apple.com>
851
852         Fixed <rdar://problem/3861257> WebUndefined should be returned for undefined values
853
854         Reviewed by John.
855
856         * ChangeLog:
857         * bindings/objc/WebScriptObject.mm:
858         (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
859         Added additional conversion Undefined -> WebUndefined.
860         * bindings/objc/objc_utility.mm:
861         (KJS::Bindings::convertObjcValueToValue):
862         Added additional conversion WebUndefined -> Undefined.
863
864 2004-11-01  Darin Adler  <darin@apple.com>
865
866         - fixed <rdar://problem/3855573> Remove reference to "WebScriptMethods" from WebScriptObject.h comments
867
868         * bindings/objc/WebScriptObject.h: Removed unneeded #ifdef protection for multiple includes (since
869         this is an Objective-C header and we use #import for those). Fixed comments as requested in the bug
870         report to match the contents of the file.
871
872 === Safari-169 ===
873
874 === Safari-168 ===
875
876 2004-10-22  Ken Kocienda  <kocienda@apple.com>
877
878         Reviewed by me
879
880         * JavaScriptCore.pbproj/project.pbxproj:  
881         Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
882
883 === Safari-167 ===
884
885 2004-10-13  Richard Williamson   <rjw@apple.com>
886
887         Moved boolean checks prior to NSNumber checks.  booleans are
888         NSNumbers.
889
890         Follow on to <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number.
891
892         Reviewed by John.
893
894         * bindings/objc/objc_utility.mm:
895         (KJS::Bindings::convertObjcValueToValue):
896
897 2004-10-12  Richard Williamson   <rjw@apple.com>
898
899         Fixed access to DOM object via WebScriptObject API.
900         The execution context for DOM objects wasn't being found.       
901         <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
902
903         Reviewed by Chris.
904
905         * bindings/objc/WebScriptObject.mm:
906         (_didExecute):
907         (-[WebScriptObject KJS::Bindings::]):
908         (-[WebScriptObject callWebScriptMethod:withArguments:]):
909         (-[WebScriptObject evaluateWebScript:]):
910         (-[WebScriptObject setValue:forKey:]):
911         (-[WebScriptObject valueForKey:]):
912         (-[WebScriptObject stringRepresentation]):
913         * bindings/objc/WebScriptObjectPrivate.h:
914
915 2004-10-09  Darin Adler  <darin@apple.com>
916
917         Reviewed by Kevin.
918
919         - fixed <rdar://problem/3804661> REGRESSION: JavaScriptCore framework now has two init routines
920
921         * bindings/NP_jsobject.cpp: Fixed unnecessarily-complex globals set up that was
922         creating an init routine.
923
924         * kjs/ustring.cpp: Changed around the UString::Rep::empty construction to not
925         require a global constructor that creates an init routine.
926
927 2004-10-09  Darin Adler  <darin@apple.com>
928
929         Reviewed by Kevin.
930
931         - fixed <rdar://problem/3822618> REGRESSION (164-165): expedia.com's popup help doesn't work
932
933         * kjs/reference.cpp: (Reference::putValue): Change so that references not found in any object
934         work with the window object of the page the function is in, not the page of the caller. This
935         is what all other browsers do. This code was hidden before by the "everything is defined on
936         window object" hack in WebCore.
937
938 2004-10-07  Richard Williamson   <rjw@apple.com>
939
940         Added simple JavaScript call tracing.  Very useful for
941         debugging complex pages.
942
943         Tracing is only available in development builds and is
944         enabled by:
945
946         (gdb) set traceJavaScript = 1
947
948         or programatically
949
950         setTraceJavaScript(true)
951
952         Function, args, and return values are printed to console.  Very
953         verbose.
954
955         Reviewed by Ken.
956
957         * kjs/function_object.cpp:
958         (FunctionProtoFuncImp::call):
959         * kjs/object.cpp:
960         (KJS::Object::call):
961
962 === Safari-166 ===
963
964 2004-10-05  Richard Williamson   <rjw@apple.com>
965
966         Fixed <rdar://problem/3819234> NPN_SetException (and throwException:) isn't implemented
967
968         Reviewed by Chris.
969
970         * bindings/NP_jsobject.cpp:
971         (_NPN_SetException):
972         * bindings/npruntime.cpp:
973         (_NPN_SetExceptionWithUTF8):
974         * bindings/objc/WebScriptObject.mm:
975         (+[WebScriptObject throwException:]):
976         * kjs/internal.h:
977         (KJS::InterpreterImp::context):
978
979 2004-10-05  Richard Williamson   <rjw@apple.com>
980
981         Fixed <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number
982
983         Reviewed by Ken.
984
985         * bindings/objc/objc_utility.mm:
986         (KJS::Bindings::convertObjcValueToValue):
987
988 2004-10-04  Darin Adler  <darin@apple.com>
989
990         Reviewed by Ken.
991
992         - rolled in a fix the KDE folks did for the operations that generate HTML fragments
993
994         * kjs/string_object.cpp: (StringProtoFuncImp::call): Added quote marks to generated HTML.
995
996         - rolled out an old workaround we don't need any more
997
998         * JavaScriptCore.pbproj/project.pbxproj: Remove -Wno-long-double because the <math.h> issue that
999         required it is no longer there.
1000
1001 2004-09-30  Richard Williamson  <rjw@apple.com>
1002
1003         Fixed <rdar://problem/3821215> NPN hasMethod and hasProperty functions should take NPObjects, not NPClass
1004
1005         Reviewed by Chris.
1006
1007         * bindings/NP_jsobject.cpp:
1008         (_NPN_GetProperty):
1009         (_NPN_HasProperty):
1010         (_NPN_HasMethod):
1011         * bindings/c/c_class.cpp:
1012         (CClass::methodsNamed):
1013         (CClass::fieldNamed):
1014         * bindings/c/c_class.h:
1015         * bindings/c/c_instance.cpp:
1016         (CInstance::invokeMethod):
1017         * bindings/jni/jni_class.cpp:
1018         (JavaClass::methodsNamed):
1019         * bindings/jni/jni_class.h:
1020         * bindings/npruntime.h:
1021         * bindings/objc/objc_class.h:
1022         * bindings/objc/objc_class.mm:
1023         (ObjcClass::methodsNamed):
1024         * bindings/runtime.h:
1025         * bindings/runtime_object.cpp:
1026         (RuntimeObjectImp::get):
1027         (RuntimeObjectImp::hasProperty):
1028
1029 2004-09-29  Chris Blumenberg  <cblu@apple.com>
1030
1031         Prepended underscores to NPN methods so that when the QT plug-in loads these symbols, it uses the non-underscore versions in WebKit. Without this, the QT plug-in was failing to load when launching Safari from the command-line.
1032
1033         Reviewed by rjw.
1034
1035         * JavaScriptCore.pbproj/project.pbxproj:
1036         * bindings/NP_jsobject.cpp:
1037         (_NPN_CreateScriptObject):
1038         (_NPN_InvokeDefault):
1039         (_NPN_Invoke):
1040         (_NPN_Evaluate):
1041         (_NPN_GetProperty):
1042         (_NPN_SetProperty):
1043         (_NPN_RemoveProperty):
1044         (_NPN_HasProperty):
1045         (_NPN_HasMethod):
1046         * bindings/c/c_class.cpp:
1047         (CClass::methodsNamed):
1048         (CClass::fieldNamed):
1049         * bindings/c/c_instance.cpp:
1050         (CInstance::CInstance):
1051         (CInstance::~CInstance):
1052         (CInstance::operator=):
1053         (CInstance::invokeMethod):
1054         (CInstance::invokeDefaultMethod):
1055         * bindings/c/c_runtime.cpp:
1056         * bindings/c/c_runtime.h:
1057         (KJS::Bindings::CField::name):
1058         (KJS::Bindings::CMethod::name):
1059         * bindings/npruntime.cpp:
1060         (_NPN_GetStringIdentifier):
1061         (_NPN_GetStringIdentifiers):
1062         (_NPN_GetIntIdentifier):
1063         (_NPN_IdentifierIsString):
1064         (_NPN_UTF8FromIdentifier):
1065         (_NPN_IntFromIdentifier):
1066         (NPN_InitializeVariantWithObject):
1067         (_NPN_ReleaseVariantValue):
1068         (_NPN_CreateObject):
1069         (_NPN_RetainObject):
1070         (_NPN_ReleaseObject):
1071         (_NPN_SetExceptionWithUTF8):
1072         (_NPN_SetException):
1073
1074 2004-09-26  Darin Adler  <darin@apple.com>
1075
1076         * kjs/string_object.cpp: (StringProtoFuncImp::call): Remove strange use of high() and
1077         low() to get Unicode value of character, and just use unicode().
1078
1079 2004-09-26  Darin Adler  <darin@apple.com>
1080
1081         - refine charAt/charCodeAt fix slightly
1082
1083         * kjs/string_object.cpp: (StringProtoFuncImp::call): Treat undefined the same was as an
1084         omitted parameter, as we do everywhere else, and as other browsers do here.
1085
1086 2004-09-26  Darin Adler  <darin@apple.com>
1087
1088         Reviewed by Kevin.
1089
1090         - fixed <rdar://problem/3816097> REGRESSION: mailblocks, and presumably many other pages, failing because variable not found
1091
1092         * kjs/internal.cpp: (InterpreterImp::evaluate): Process variable declarations before executing
1093         the program. We were doing this properly for functions, but not entire programs.
1094
1095         - fixed <rdar://problem/3814706> REGRESSION: text fields in mailblocks wizards do not accept keystrokes due to use of charCodeAt()
1096
1097         * kjs/string_object.cpp: (StringProtoFuncImp::call): Changed the implementation of charAt
1098         and charCodeAt to treat a missing parameter as an index of 0, rather than an invalid index.
1099
1100         * tests/mozilla/expected.html: Update for two tests that now pass with these changes.
1101
1102 === Safari-165 ===
1103
1104 === Safari-164 ===
1105
1106 2004-09-14  Richard Williamson   <rjw@apple.com>
1107
1108         1.  Add class parameter to object allocation function.  This is somewhat redundant, given that
1109         the allocation function is in the class function vector, but people wanted to use the same
1110         allocation function for different classes.
1111         
1112         2.  Renamed NPN_Class to NPN_Invoke to match the name in the function vector.
1113         
1114         3.  Add support for a default function on an object.  This is a feature that ActiveX supports,
1115         and will allow JavaScript code to be written that will look exactly the same for both ActiveX
1116         plugins and Netscape or WebKit plugins.  There are implementations included for the 'C' and
1117         'Objective-C' bindings.
1118         
1119         There bugs are covered by
1120         
1121         <rdar://problem/3776343> Support for default functions in the JavaScript bindings
1122         <rdar://problem/3779186> NPN_Call needs to be renamed to NPN_Invoke
1123         <rdar://problem/3674754> Need to implement latest npruntime.h
1124
1125         Reviewed by John.
1126
1127         * bindings/NP_jsobject.cpp:
1128         (jsAllocate):
1129         (NPN_InvokeDefault):
1130         (NPN_Invoke):
1131         * bindings/c/c_class.cpp:
1132         * bindings/c/c_instance.cpp:
1133         (CInstance::CInstance):
1134         (CInstance::operator=):
1135         (CInstance::invokeMethod):
1136         (CInstance::invokeDefaultMethod):
1137         * bindings/c/c_instance.h:
1138         * bindings/c/c_runtime.cpp:
1139         * bindings/c/c_runtime.h:
1140         * bindings/jni/jni_instance.cpp:
1141         (JavaInstance::invokeDefaultMethod):
1142         * bindings/jni/jni_instance.h:
1143         * bindings/npruntime.cpp:
1144         (NPN_CreateObject):
1145         * bindings/npruntime.h:
1146         * bindings/objc/WebScriptObject.h:
1147         * bindings/objc/objc_class.mm:
1148         (ObjcClass::fallbackObject):
1149         * bindings/objc/objc_instance.h:
1150         * bindings/objc/objc_instance.mm:
1151         (ObjcInstance::invokeDefaultMethod):
1152         * bindings/objc/objc_runtime.h:
1153         * bindings/objc/objc_runtime.mm:
1154         (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
1155         (ObjcFallbackObjectImp::get):
1156         (ObjcFallbackObjectImp::put):
1157         (ObjcFallbackObjectImp::canPut):
1158         (ObjcFallbackObjectImp::implementsCall):
1159         (ObjcFallbackObjectImp::call):
1160         (ObjcFallbackObjectImp::hasProperty):
1161         (ObjcFallbackObjectImp::deleteProperty):
1162         (ObjcFallbackObjectImp::defaultValue):
1163         * bindings/runtime.h:
1164         (KJS::Bindings::Class::fallbackObject):
1165         (KJS::Bindings::Instance::getValueOfUndefinedField):
1166         (KJS::Bindings::Instance::setValueOfUndefinedField):
1167         (KJS::Bindings::Instance::valueOf):
1168         * bindings/runtime_object.cpp:
1169         (RuntimeObjectImp::implementsCall):
1170         (RuntimeObjectImp::call):
1171         * bindings/runtime_object.h:
1172
1173 2004-09-13  Maciej Stachowiak  <mjs@apple.com>
1174
1175         Reviewed by Darin.
1176
1177         <rdar://problem/3794735> Gmail- sending a very long message with Safari is so slow it seems like a hang
1178         
1179         * kjs/string_object.cpp:
1180         (StringProtoFuncImp::call): Replaced implementation of replace()
1181         method with function below...
1182         (replace): In order to avoid excessive allocation and copying,
1183         figure out the ranges of the original string and replacement
1184         strings to be assembled, instead of constantly creating new
1185         strings at each substitution. The old behavior is basically O(N^2)
1186         for a global replace on a pattern that matches many places in the
1187         string.
1188         (regExpIsGlobal): Helper function for the above.
1189         (expandSourceRanges): ditto
1190         (pushSourceRange): ditto
1191         (expandReplacements): ditto
1192         (pushReplacement): ditto
1193         * kjs/ustring.cpp:
1194         (KJS::UString::spliceSubstringsWithSeparators): New method that
1195         pieces together substring ranges of this string together with
1196         specified separators, all at one go.
1197         * kjs/ustring.h:
1198         (KJS::UString::Range::Range): Added new helper class to represent
1199         substring choices.
1200
1201 2004-09-14  Maciej Stachowiak  <mjs@apple.com>
1202
1203         Reviewed by Darin.
1204
1205         - fixed <rdar://problem/3800315> encode-URI-test layout test is failing
1206         
1207         * kjs/function.cpp:
1208         (KJS::GlobalFuncImp::call): Make sure to escape null
1209         characters. This is a bug in the new code that made part of the
1210         test fail.
1211
1212 2004-09-13  Darin Adler  <darin@apple.com>
1213
1214         Reviewed by Kevin and Maciej.
1215
1216         - new function to support fix for DIG bug in WebCore
1217
1218         * kjs/scope_chain.h: Added new push function that pushes another entire scope chain.
1219         * kjs/scope_chain.cpp: (KJS::ScopeChain::push): Ditto.
1220
1221 2004-09-12  Darin Adler  <darin@apple.com>
1222
1223         * tests/mozilla/expected.html: Updated test results for 3 more tests that pass with the new version
1224         of escape and unescape.
1225
1226 2004-09-12  Darin Adler  <darin@apple.com>
1227
1228         Reviewed by Maciej.
1229
1230         - fixed <rdar://problem/3798209> any non-ASCII characters are garbled in the result of toLocaleString
1231
1232         * kjs/date_object.cpp:
1233         (formatLocaleDate): Replaced two old functions that used LongDateTime with this one new function that
1234         uses CFDateFormatter.
1235         (DateProtoFuncImp::call): Call the new formatLocaleDate instead of both formatLocaleDate and formatLocaleTime.
1236
1237 2004-09-09  Maciej Stachowiak  <mjs@apple.com>
1238
1239         Reviewed by Richard.
1240
1241         <rdar://problem/3493140> REGRESSION (85-100): cedille displays %-escaped in JavaScript message at hotmail.com
1242
1243         * kjs/function.cpp:
1244         (KJS::GlobalFuncImp::call): Replace our escape() and unescape() implementations with
1245         ones from KDE KJS, which have the proper latin-1 behavior to match Win IE.
1246         * kjs/lexer.cpp:
1247         (Lexer::isHexDigit): Made static and non-const.
1248         * kjs/lexer.h:
1249
1250 === Safari-163 ===
1251
1252 2004-09-06  Darin Adler  <darin@apple.com>
1253
1254         * JavaScriptCore.pbproj/project.pbxproj: Bump MACOSX_DEPLOYMENT_TARGET to 10.3.
1255
1256 === Safari-162 ===
1257
1258 2004-09-01  Richard Williamson   <rjw@apple.com>
1259
1260         Add pid to exception messages (to help debug dashboard clients).
1261
1262         Reviewed by Chris.
1263
1264         * kjs/interpreter.cpp:
1265         (Interpreter::evaluate):
1266
1267 === Safari-161 ===
1268
1269 2004-08-20  Richard Williamson   <rjw@apple.com>
1270
1271         Implemented new JNI abstraction.  We no longer invoke Java methods
1272         directly with JNI, rather we call into the plugin.  This allows the
1273         plugin to dispatch the call to the appropriate VM thread.  This
1274         change should (will?) fix a whole class of threading related problems with
1275         the Java VM.
1276
1277         Reviewed by Hyatt.
1278
1279         * JavaScriptCore.pbproj/project.pbxproj:
1280         * bindings/c/c_instance.h:
1281         (KJS::Bindings::CInstance::setExecutionContext):
1282         (KJS::Bindings::CInstance::executionContext):
1283         * bindings/jni/jni_instance.cpp:
1284         (JavaInstance::JavaInstance):
1285         (JavaInstance::invokeMethod):
1286         (JavaInstance::setExecutionContext):
1287         (JavaInstance::executionContext):
1288         * bindings/jni/jni_instance.h:
1289         * bindings/jni/jni_jsobject.cpp:
1290         (JSObject::convertJObjectToValue):
1291         * bindings/jni/jni_runtime.cpp:
1292         (JavaField::JavaField):
1293         (JavaArray::convertJObjectToArray):
1294         (JavaField::valueFromInstance):
1295         (JavaArray::JavaArray):
1296         (JavaArray::valueAt):
1297         * bindings/jni/jni_runtime.h:
1298         (KJS::Bindings::JavaArray::operator=):
1299         (KJS::Bindings::JavaArray::executionContext):
1300         * bindings/jni/jni_utility.h:
1301         * bindings/objc/objc_instance.h:
1302         (KJS::Bindings::ObjcInstance::setExecutionContext):
1303         (KJS::Bindings::ObjcInstance::executionContext):
1304         * bindings/runtime.cpp:
1305         (Instance::createBindingForLanguageInstance):
1306         * bindings/runtime.h:
1307         * bindings/runtime_root.h:
1308         (KJS::Bindings::RootObject::nativeHandle):
1309
1310 === Safari-158 ===
1311
1312 2004-08-19  Vicki Murley  <vicki@apple.com>
1313
1314         Reviewed by John.
1315
1316         * kjs/property_map.cpp:
1317         (KJS::PropertyMap::put): initialize deletedElementIndex to zero, to make the compiler happy
1318
1319 2004-08-17  Darin Adler  <darin@apple.com>
1320
1321         Reviewed by Adele.
1322
1323         - fixed <rdar://problem/3746676> SAP WebDynpro app hangs inside JavaScript property map hash table code (deleted sentinel problem)
1324
1325         * kjs/property_map.h: Added some private functions.
1326         * kjs/property_map.cpp:
1327         (KJS::PropertyMap::clear): Set sentinelCount to 0.
1328         (KJS::PropertyMap::put): Complete search for the element before choosing to use the deleted-element sentinel.
1329         Also keep sentinel count up to date when we destroy a sentinel by overwriting with a new added element.
1330         (KJS::PropertyMap::expand): Added. Calls rehash with a size 2x the old size, or 16.
1331         (KJS::PropertyMap::rehash): Added. Refactored the rehash code into a separate function.
1332         (KJS::PropertyMap::remove): Add one to sentinelCount, and rehash if 1/4 or more of the elements are
1333         deleted-element sentinels.
1334         (KJS::PropertyMap::checkConsistency): Check the sentinelCount.
1335
1336 2004-08-16  Maciej Stachowiak  <mjs@apple.com>
1337
1338         Code change by Eric Albert, reviewd by me.
1339
1340         <rdar://problem/3571960> washingtonpost.com claims I don't have cookies enabled and won't let me read articles
1341
1342         * kjs/date_object.cpp:
1343         (timetUsingCF): Clamp time to LONG_MAX (getting rid of time_t
1344         entirely would be even better, but is not required to fix this bug.
1345
1346 === Safari-157 ===
1347
1348 2004-08-16  Richard Williamson   <rjw@apple.com>
1349
1350         Fixed <rdar://problem/3581092> cash in KJS::Bindings::JSObject::eval at tcvetantcvetkov.com
1351
1352         Adds bullet proofing to protect against evaluation of bogus JS in all the flavors of bindings (Java, C, and ObjC).
1353
1354         Reviewed by Chris.
1355
1356         * bindings/NP_jsobject.cpp:
1357         (NPN_Evaluate):
1358         * bindings/jni/jni_jsobject.cpp:
1359         (JSObject::eval):
1360         * bindings/objc/WebScriptObject.mm:
1361         (-[WebScriptObject evaluateWebScript:]):
1362
1363 2004-08-15  Richard Williamson   <rjw@apple.com>
1364
1365         More updates to np headers.  Implemented new NPN functions.
1366
1367         Reviewed by Darin.
1368
1369         * bindings/NP_jsobject.cpp:
1370         (NPN_HasProperty):
1371         (NPN_HasMethod):
1372         * bindings/npapi.h:
1373         * bindings/npruntime.h:
1374
1375 2004-08-13  Darin Adler  <darin@apple.com>
1376
1377         - fix build so we can compile again
1378
1379         * bindings/npapi.h: Added. Richard forgot to check this in. The one I'm checking in here
1380         is good enough so that we can compile, but it's only a stopgap measure, because I think
1381         Richard has a newer one he wants to check in.
1382
1383 2004-08-12  Richard Williamson   <rjw@apple.com>
1384
1385         Bring npruntime.h and friends closer to compliance with
1386         latest spec.
1387
1388         Reviewed by Maciej.
1389
1390         * JavaScriptCore.pbproj/project.pbxproj:
1391         * bindings/NP_jsobject.cpp:
1392         (jsAllocate):
1393         (_NPN_CreateScriptObject):
1394         (NPN_Call):
1395         (NPN_Evaluate):
1396         (NPN_GetProperty):
1397         (NPN_SetProperty):
1398         (NPN_RemoveProperty):
1399         * bindings/NP_jsobject.h:
1400         * bindings/c/c_instance.cpp:
1401         (CInstance::invokeMethod):
1402         * bindings/c/c_utility.cpp:
1403         (convertNPVariantToValue):
1404         * bindings/npruntime.cpp:
1405         (NPN_IdentifierIsString):
1406         (NPN_VariantIsVoid):
1407         (NPN_VariantIsNull):
1408         (NPN_VariantIsUndefined):
1409         (NPN_VariantIsBool):
1410         (NPN_VariantIsInt32):
1411         (NPN_VariantIsDouble):
1412         (NPN_VariantIsString):
1413         (NPN_VariantIsObject):
1414         (NPN_VariantToBool):
1415         (NPN_VariantToString):
1416         (NPN_VariantToInt32):
1417         (NPN_VariantToDouble):
1418         (NPN_VariantToObject):
1419         (NPN_InitializeVariantAsVoid):
1420         (NPN_InitializeVariantAsNull):
1421         (NPN_InitializeVariantAsUndefined):
1422         (NPN_InitializeVariantWithBool):
1423         (NPN_InitializeVariantWithInt32):
1424         (NPN_InitializeVariantWithDouble):
1425         (NPN_InitializeVariantWithString):
1426         (NPN_InitializeVariantWithStringCopy):
1427         (NPN_InitializeVariantWithObject):
1428         (NPN_InitializeVariantWithVariant):
1429         (NPN_ReleaseVariantValue):
1430         (NPN_CreateObject):
1431         * bindings/npruntime.h:
1432         (_NPString::):
1433         (_NPString::_NPVariant::):
1434         * bindings/npruntime_priv.h: Added.
1435
1436 2004-08-12  Darin Adler  <darin@apple.com>
1437
1438         Reviewed by Adele.
1439
1440         - fixed 3 problems with parse functions that I just wrote, fixing 3 more Mozilla JavaScript tests
1441
1442         * kjs/function.cpp:
1443         (KJS::parseDigit): Fix typo, 'Z' instead of 'z', that prevented lowercase hex digits from working.
1444         (KJS::parseInt): Add octal support. Specification says it's optional, but I guess not.
1445         (KJS::parseFloat): Fix check for "0x" in parseFloat to return 0 rather than NaN. Also add code
1446         to skip leading "+" or "-".
1447
1448 === Safari-156 ===
1449
1450 2004-08-12  Darin Adler  <darin@apple.com>
1451
1452         Reviewed by Ken.
1453
1454         - fixed 43 Mozilla JavaScript tests
1455
1456         * kjs/date_object.h: Change parseDate and timeClip to take and return doubles.
1457         * kjs/date_object.cpp:
1458         (DateObjectImp::construct): Change to use a timeClip function that takes and returns a double rather
1459         than constructing a number object to pass to it.
1460         (DateObjectFuncImp::call): Change to use a parseDate function that returns a double.
1461         (KJS::parseDate): Change to return a double instead of creating the Number object here.
1462         (KJS::timeClip): Implement this as specified in the language standard.
1463
1464         * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set the DontDelete, ReadOnly, and DontEnum
1465         flags on the prototype property.
1466
1467         * kjs/function.cpp:
1468         (KJS::FunctionImp::get): Return null rather than undefined for arguments when the function is not
1469         currently in scope.
1470         (KJS::isStrWhiteSpace): Added. Matches specification for StrWhiteSpace. Could move it to some utility
1471         file later.
1472         (KJS::parseDigit): Added. Helper function for parseInt.
1473         (KJS::parseInt): Added. Integer parser that puts result in a double so we're not limited to what
1474         strtoll can handle. Also matches standard more closely.
1475         (KJS::parseFloat): Added. Handles "0x" properly and passes flag to make empty string turn into NaN
1476         instead of 0.
1477         (KJS::GlobalFuncImp::call): Use the new parseInt and parseFloat.
1478
1479         * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Add a length property.
1480
1481         * kjs/lexer.h: Added error flag and sawError() function for detecting errors.
1482         * kjs/lexer.cpp:
1483         (Lexer::setCode): Clear error state.
1484         (Lexer::lex): Set error state if the lexer encounters an error
1485
1486         * kjs/internal.cpp:
1487         (NumberImp::toString): Roll in change from KDE version to special case 0 so we handle -0 correctly.
1488         (Parser::parse): Use new lexer error method so those errors are treated like parser errors.
1489
1490         * kjs/math_object.cpp: (MathFuncImp::call): Change min and max to treat -0 as less than +0.
1491         Change round to round values between -0.5 and -0 to -0 instead of +0.
1492
1493         * kjs/nodes.h: Add evaluateReference function to GroupNode.
1494         * kjs/nodes.cpp: (GroupNode::evaluateReference): Pass references through groups (parenthesized
1495         expressions) properly so that expressions like "delete (x.y)" work. Before, the parentheses
1496         would change x.y into a value that can't be deleted as a side effect.
1497
1498         * kjs/string_object.cpp: Change parameter count for indexOf and lastIndexOf from 2 to 1 to match
1499         the specification.
1500
1501         * kjs/testkjs.cpp: Rolled in changes from KDE to add a "quit" function to the test tool and
1502         get rid of the fixed size limit for code.
1503
1504         * kjs/ustring.cpp: (KJS::UString::substr): Added optimized case for substr(0, length) so it just
1505         returns the string without creating a new Rep, since I'm using substr in a place where it will
1506         often be passed a 0.
1507
1508         * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed one wrong entry in the Unicode table I added to
1509         the other day that was making a couple tests fail.
1510         * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
1511         * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
1512         * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
1513         * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
1514         * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
1515
1516         * kjs/string_object.lut.h: Regenerated.
1517
1518 2004-08-11  Darin Adler  <darin@apple.com>
1519
1520         - fixed a tiny problem with the UTF-16 PCRE check-in
1521
1522         * pcre/maketables.c: (pcre_maketables): Fix mistake in table-generating code that sometimes caused
1523         the ctype_meta flag to get set in items that should not have it.
1524
1525         * pcre/chartables.c: Regenerated.
1526
1527 2004-08-10  Richard Williamson   <rjw@apple.com>
1528
1529         Fixed <rdar://problem/3674747> Need to implement invokeUndefinedMethodFromWebScript:withArguments:
1530
1531         The following WebScripting methods are now supported on bound
1532         objects:
1533
1534         - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args;
1535         - (void)setValue:(id)value forUndefinedKey:(NSString *)key
1536         - (id)valueForUndefinedKey:(NSString *)key
1537
1538         Reviewed by Chris.
1539
1540         * bindings/c/c_class.cpp:
1541         (CClass::fieldNamed):
1542         * bindings/c/c_class.h:
1543         * bindings/jni/jni_class.cpp:
1544         (JavaClass::fieldNamed):
1545         * bindings/jni/jni_class.h:
1546         * bindings/objc/objc_class.h:
1547         (KJS::Bindings::ObjcClass::isa):
1548         * bindings/objc/objc_class.mm:
1549         (ObjcClass::methodsNamed):
1550         (ObjcClass::fieldNamed):
1551         (ObjcClass::fallbackObject):
1552         * bindings/objc/objc_instance.h:
1553         * bindings/objc/objc_instance.mm:
1554         (ObjcInstance::invokeMethod):
1555         (ObjcInstance::setValueOfField):
1556         (ObjcInstance::setValueOfUndefinedField):
1557         (ObjcInstance::getValueOfField):
1558         (ObjcInstance::getValueOfUndefinedField):
1559         * bindings/objc/objc_runtime.h:
1560         (KJS::Bindings::ObjcField::~ObjcField):
1561         (KJS::Bindings::ObjcField::ObjcField):
1562         (KJS::Bindings::ObjcField::operator=):
1563         (KJS::Bindings::FallbackObjectImp::classInfo):
1564         * bindings/objc/objc_runtime.mm:
1565         (ObjcField::ObjcField):
1566         (ObjcField::name):
1567         (ObjcField::type):
1568         (ObjcField::valueFromInstance):
1569         (ObjcField::setValueToInstance):
1570         (FallbackObjectImp::FallbackObjectImp):
1571         (FallbackObjectImp::get):
1572         (FallbackObjectImp::put):
1573         (FallbackObjectImp::canPut):
1574         (FallbackObjectImp::implementsCall):
1575         (FallbackObjectImp::call):
1576         (FallbackObjectImp::hasProperty):
1577         (FallbackObjectImp::deleteProperty):
1578         (FallbackObjectImp::defaultValue):
1579         * bindings/runtime.h:
1580         (KJS::Bindings::Class::fallbackObject):
1581         (KJS::Bindings::Instance::getValueOfUndefinedField):
1582         (KJS::Bindings::Instance::setValueOfUndefinedField):
1583         * bindings/runtime_object.cpp:
1584         (RuntimeObjectImp::get):
1585         (RuntimeObjectImp::put):
1586         (RuntimeObjectImp::canPut):
1587         (RuntimeObjectImp::hasProperty):
1588         * bindings/testbindings.mm:
1589         (-[MyFirstInterface valueForUndefinedKey:]):
1590         (-[MyFirstInterface setValue:forUndefinedKey:]):
1591
1592 2004-08-10  Darin Adler  <darin@apple.com>
1593
1594         Reviewed by Dave.
1595
1596         - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
1597
1598         * pcre/pcre.h: Added PCRE_UTF16 switch, set to 1. Added pcre_char typedef, which is char
1599         or uint16_t depending on the mode, and used appropriate in the 7 public functions
1600         that need to use it.
1601         * pcre/pcre.c: Add UTF-16 support to all functions.
1602         * pcre/study.c: Ditto.
1603
1604         * pcre/internal.h: Added ichar typedef, which is unsigned char or uint16_t depending on
1605         the mode. Changed declarations to use symbolic constants and typedefs so we size
1606         things to ichar when needed.
1607
1608         * pcre/maketables.c: (pcre_maketables): Change code to make tables that are
1609         sized to 16-bit characters instead of 8-bit.
1610
1611         * pcre/get.c:
1612         (pcre_copy_substring): Use pcre_char instead of char.
1613         (pcre_get_substring_list): Ditto.
1614         (pcre_free_substring_list): Ditto.
1615         (pcre_get_substring): Ditto.
1616         (pcre_free_substring): Ditto.
1617
1618         * pcre/dftables.c: (main): Used a bit more const, and use ICHAR sizes instead
1619         of hard-coding 8-bit table sizes.
1620
1621         * pcre/chartables.c: Regenerated.
1622
1623         * kjs/ustring.h: Remove functions that convert UTF-16 to/from UTF-8 offsets.
1624         * kjs/ustring.cpp: Change the shared empty string to have a unicode pointer that
1625         is not null. The null string still has a null pointer. This prevents us from
1626         passing a null through to the regular expression engine (which results in a null
1627         error even when the string length is 0).
1628
1629         * kjs/regexp.cpp:
1630         (KJS::RegExp::RegExp): Null-terminate the pattern and pass it.
1631         (KJS::RegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
1632
1633 2004-08-09  Darin Adler  <darin@apple.com>
1634
1635         Reviewed by Maciej.
1636
1637         - fixed 28 Mozilla JavaScript tests
1638
1639         * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Check for undefined rather than
1640         checking the number of arguments for the join method.
1641
1642         * kjs/lexer.cpp: (Lexer::lex): Parse hexadecimal and octal constants in doubles rather
1643         than integers, so we aren't limited to 32 bits.
1644
1645         * kjs/math_object.cpp: (MathFuncImp::call): Get rid of many unneeded special cases in
1646         the implementation of the pow operation. Also simplied a case that was handling positive
1647         and negative infinity separately.
1648
1649         * kjs/nodes.cpp: (ShiftNode::evaluate): Keep the result of shifts in a double instead of
1650         putting them in a long, so that unsigned shift will work properly.
1651
1652         * kjs/number_object.cpp: Add the DontDelete and ReadOnly flags to the numeric constants.
1653
1654         * kjs/operations.cpp:
1655         (KJS::isPosInf): Added an implementation inside APPLE_CHANGES that does not depend on the
1656         sign of isinf; our isinf function returns +1 even for negative infinity.
1657         (KJS::isNegInf): And again.
1658         (KJS::relation): Put in a nice simple implementation of comparison inside APPLE_CHANGES.
1659         Our floating point already handles the various infinity cases correctly.
1660
1661         * kjs/regexp_object.cpp:
1662         (RegExpProtoFuncImp::call): Add missing return before Null() in Exec method.
1663         (RegExpObjectImp::arrayOfMatches): Put undefined rather than an empty string into the
1664         array in cases where we did not match.
1665         (RegExpObjectImp::construct): Set the DontDelete, ReadOnly, and DontEnum flags for
1666         "global", "ignoreCase", "multiline", and "source".
1667
1668         * kjs/string_object.cpp: (StringProtoFuncImp::call): For the match method, turn a null
1669         string into undefined rather than an empty string. For the slice method, handle an
1670         undefined parameter for the limit properly as decribed in the specification, and add
1671         the limit to one case that didn't have the limit at all. For the methods that generate
1672         HTML strings, use lowercase tags instead of uppercase.
1673
1674         * kjs/ustring.cpp:
1675         (KJS::UChar::toLower): Use u_tolower from the ICU library.
1676         (KJS::UChar::toUpper): Use u_toupper from the ICU library.
1677         (KJS::UString::append): Fix some math that caused a buffer overflow.
1678         (KJS::convertUTF16OffsetsToUTF8Offsets): Ignore negative numbers (-1 is used as a special
1679         flag) rather than converting them all to 0.
1680         (KJS::convertUTF8OffsetsToUTF16Offsets): Ditto.
1681
1682         * tests/mozilla/jsDriver.pl: Fixed the relative links to point to our actual test files.
1683
1684         * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed the Unicode table in this test to match
1685         the Unicode specification in a few cases where it was wrong before.
1686         * tests/mozilla/ecma/String/15.5.4.11-2.js: Ditto.
1687         * tests/mozilla/ecma/String/15.5.4.11-3.js: Ditto.
1688         * tests/mozilla/ecma/String/15.5.4.11-5.js: Ditto.
1689         * tests/mozilla/ecma/String/15.5.4.11-6.js: Ditto.
1690         * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
1691         * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
1692         * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
1693         * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
1694         * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
1695
1696         * JavaScriptCore.pbproj/project.pbxproj: Link to libicu.
1697
1698         * kjs/number_object.lut.h: Regenerated.
1699
1700 2004-08-09  Darin Adler  <darin@apple.com>
1701
1702         Reviewed by Maciej.
1703
1704         - fixed <rdar://problem/3753467> REGRESSION (137-138): reproducible buffer overrun in UString manipulation code
1705
1706         * kjs/ustring.cpp: (KJS::UString::append): Fix incorrect size computation. Without it
1707         we get a buffer overflow.
1708
1709 === Safari-155 ===
1710
1711 2004-08-05  Richard Williamson   <rjw@apple.com>
1712
1713         Fixed part of 3674747.  The QT guys need this for feature freeze.
1714
1715         This patch implements support for the
1716
1717         - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args
1718
1719         method of objects bound to JavaScript.
1720
1721         Reviewed by John.
1722
1723         * ChangeLog:
1724         * bindings/objc/objc_class.mm:
1725         (ObjcClass::methodsNamed):
1726         (ObjcClass::fieldNamed):
1727         * bindings/objc/objc_instance.mm:
1728         (ObjcInstance::invokeMethod):
1729         * bindings/objc/objc_runtime.h:
1730         (KJS::Bindings::ObjcMethod::~ObjcMethod):
1731         (KJS::Bindings::ObjcMethod::isFallbackMethod):
1732         (KJS::Bindings::ObjcMethod::javaScriptName):
1733         * bindings/objc/objc_runtime.mm:
1734         (ObjcMethod::ObjcMethod):
1735         (ObjcMethod::getMethodSignature):
1736         (ObjcMethod::setJavaScriptName):
1737         * bindings/testbindings.mm:
1738
1739 2004-08-04  Vicki Murley  <vicki@apple.com>
1740
1741         Reviewed by mjs.
1742  
1743         - fix <rdar://problem/3649789> SAP WebGUI has problems loading first page because of parse error        
1744
1745         * kjs/lexer.cpp:
1746         (Lexer::lex): if the current character is a '\' and the next character is a line terminator,
1747         go to the next line and continue parsing the string (instead of failing).  This matches 
1748         behavior in Mac IE and Mozilla.
1749
1750 2004-08-03  Kevin Decker  <kdecker@apple.com>
1751
1752         Reviewed by Darin.
1753
1754         Rolled in changes from the latest KJS sources that support additional 
1755         Number.prototype functions. 
1756
1757         Specifically this patch covers the follow parts of the ECMA 3 spec:
1758         15.7.4.5, 15.7.4.6, and 15.7.4.7 
1759         
1760         Fixes:
1761         <rdar://problem/3663716> missing Number.toFixed (and toPrecision, toExponential)
1762         <rdar://problem/3749492> missing Number.toPrecision prototype implementation
1763         <rdar://problem/3749591> missing Number.toExponential prototype implementation
1764
1765         * kjs/identifier.h: Added toFixed, toPrecision, and toExponential to the
1766         list of supported identifiers (a macro).
1767         * kjs/number_object.cpp: Implemented support for toFixed(), toPrecision(),
1768         and toExponential(). 
1769         (NumberPrototypeImp::NumberPrototypeImp):
1770         (NumberProtoFuncImp::call):
1771         * kjs/number_object.h: Added property names for toFixed, toPrecision,
1772         and toExponential. 
1773         (KJS::NumberProtoFuncImp::):
1774         * tests/mozilla/expected.html: Update results.
1775
1776 2004-08-03  Darin Adler  <darin@apple.com>
1777
1778         Reviewed by Ken.
1779
1780         - added support for copying RegExp objects so 7 more Mozilla regexp tests pass
1781
1782         * kjs/regexp_object.cpp: (RegExpObjectImp::construct): Check for case where
1783         we are supposed to just copy the regular expression object, and do so.
1784         Also tighten up arguments check to handle case where an actual "undefined"
1785         is passed rather than just omitting an argument.
1786
1787         * tests/mozilla/expected.html: Update results.
1788
1789 2004-08-02  Darin Adler  <darin@apple.com>
1790
1791         * tests/mozilla/.cvsignore: Added.
1792         * tests/mozilla/expected.html: Update results.
1793
1794 2004-08-02  Darin Adler  <darin@apple.com>
1795
1796         Reviewed by Ken.
1797
1798         - fixed RegExp.toString so 3 more Mozilla regexp tests pass
1799
1800         * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call):
1801         Append the flags here so more tests paseed.
1802
1803 2004-08-02  Darin Adler  <darin@apple.com>
1804
1805         Reviewed by Ken.
1806
1807         - fixed a couple things making 5 Mozilla regexp tests pass
1808
1809         * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call): Implement toString
1810         for the prototype.
1811         (RegExpObjectImp::construct): Fix bug where the string "undefined" would
1812         be used as the flags string when no parameter was passed.
1813
1814         * kjs/regexp_object.h: (KJS::RegExpPrototypeImp::classInfo):
1815         Added a class info object for RegExp prototype so it can return
1816         a string instead of raising an exception when converting to a string.
1817
1818         * tests/mozilla/expected.html: Update results.
1819
1820 2004-08-02  Darin Adler  <darin@apple.com>
1821
1822         Reviewed by Kevin.
1823
1824         - fix crashes in mozilla tests due to mishandling NaN
1825
1826         * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Rerranged range checks after
1827         calls to toInteger so that NaN will get turned into something that fits in an integer.
1828         These were the ones John already fixed, but his fix used isnan and the new fix is
1829         more efficient.
1830
1831         * kjs/number_object.cpp: (NumberProtoFuncImp::call): Rearranged radix range checks
1832         after a call to toInteger to handle NaN properly. Also removed separate check
1833         for undefined that's not needed.
1834
1835         * kjs/string_object.cpp: (StringProtoFuncImp::call): More of the same kinds of changes
1836         as in the above two files, but for a lot more functions. Also changed one place with
1837         an explicit check for undefined to instead just check isNaN.
1838
1839         * tests/mozilla/run-mozilla-tests: Changed to invoke jst using $SYMROOTS for people
1840         like me who don't keep $SYMROOTS in their $PATH.
1841
1842 === Safari-154 ===
1843
1844 === Safari-153 ===
1845
1846 2004-07-26  Kevin Decker  <kdecker@apple.com>
1847
1848         Changes done by Darin, reviewed by Kevin.
1849
1850         - changed testkjs to build in Xcode rather than from Makefile
1851
1852         * .cvsignore: Removed obsolete files from this list.
1853         * Makefile.am: Removed code to build testkjs; we do this in Xcode now.
1854         Changed to build target "All" rather than default target. This makes us
1855         build the testkjs test tool.
1856         * dummy.cpp: Removed.
1857         * kjs/.cvsignore: Removed obsolete files from this list, including
1858         the testkjs tool, which is now built in the symroots directory.
1859         * kjs/testkjs.cpp: Added copyright notice that was missing, since we have
1860         changed this file. Also this has the nice side effect of causing the tool
1861         to be rebuilt in the new location even if there are no other changes in
1862         your tree when you check this out.
1863         * tests/mozilla/run-mozilla-tests: Invoke perl explicitly so this works
1864         without setting the execute bit on jsDriver.pl.
1865
1866 2004-07-22  Kevin Decker  <kdecker@apple.com>
1867
1868         Reviewed by Darin
1869         
1870         Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions). 
1871
1872         * kjs/function_object.cpp:
1873         (FunctionObjectImp::construct):
1874         * kjs/function_object.h:
1875         * kjs/object.cpp:
1876         (KJS::ObjectImp::construct):
1877         * kjs/object.h:
1878         (KJS::Object::construct):
1879
1880 2004-07-21  Darin Adler  <darin@apple.com>
1881
1882         * bindings/npruntime.h: Fixed typo.
1883
1884 2004-07-19  John Sullivan  <sullivan@apple.com>
1885
1886         Reviewed by Maciej.
1887         
1888         - bulletproofed array.slice() against NAN arguments. Harri noticed this
1889         vulnerability in my patch for 3714644
1890
1891         * kjs/array_object.cpp:
1892         (ArrayProtoFuncImp::call):
1893         handle NAN parameters passed to slice() by clamping to 0 and length.
1894
1895 2004-07-19  Richard Williamson   <rjw@apple.com>
1896
1897         Fixed 3733349.  Prevent Java applet callbacks into JavaScript after applet
1898         has been destroyed.
1899
1900         Reviewed by John.
1901
1902         * bindings/jni/jni_jsobject.cpp:
1903         (JSObject::invoke):
1904         (JSObject::JSObject):
1905
1906 2004-07-16  John Sullivan  <sullivan@apple.com>
1907
1908         Reviewed by Maciej.
1909         
1910         - fixed <rdar://problem/3714644> REGRESSION (125.8-146): bugzilla submit link 
1911         hangs browser with javascript
1912
1913         * kjs/array_object.cpp:
1914         (ArrayProtoFuncImp::call):
1915         Check for undefined type for args[0] the same way we were already checking
1916         for args[1]. In this case, args was zero-length, but we were treating
1917         args[0] like an integer anyway. Resulted in some code looping from a NAN
1918         value to 4, taking approximately forever.
1919
1920         * JavaScriptCore.pbproj/project.pbxproj:
1921         version wars
1922         
1923 === Safari-152 ===
1924
1925 2004-07-14  Maciej Stachowiak  <mjs@apple.com>
1926
1927         Reviewed by John.
1928
1929         <rdar://problem/3711474>: (REGRESSION (125-146): JavaScript 'toString(16)' is broken)
1930         <rdar://problem/3644873>: (REGRESSION (125-140u): secondary list doesn't fill in at Southwest.com)
1931
1932         * kjs/number_object.cpp:
1933         (NumberProtoFuncImp::call): Initialize radix from dradix, not from itself!
1934
1935 2004-07-13  Kevin Decker  <kdecker@apple.com>
1936
1937         Reviewed by kocienda.
1938
1939         - made testkjs and JavaScriptCore a subtarget of 'All'
1940         - testkjs now builds in $SYMROOTS
1941
1942         * JavaScriptCore.pbproj/project.pbxproj:
1943
1944 === Safari-151 ===
1945
1946 2004-06-24  Chris Blumenberg  <cblu@apple.com>
1947
1948         Ignore .mode1 files in JavaScriptCore.pbproj
1949
1950         Reviewed by kocienda.
1951
1952         * JavaScriptCore.pbproj/.cvsignore:
1953
1954 2004-06-23  Richard Williamson   <rjw@apple.com>
1955
1956         Implemented changes for latest npruntime.h.
1957         
1958         Reviewed by Chris.
1959
1960         * JavaScriptCore.pbproj/project.pbxproj:
1961         * bindings/NP_jsobject.cpp:
1962         (listFromVariantArgs):
1963         (identiferFromNPIdentifier):
1964         (_NPN_CreateScriptObject):
1965         (NPN_Call):
1966         (NPN_Evaluate):
1967         (NPN_GetProperty):
1968         (NPN_SetProperty):
1969         (NPN_RemoveProperty):
1970         * bindings/NP_jsobject.h:
1971         * bindings/c/c_class.cpp:
1972         (CClass::methodsNamed):
1973         (CClass::fieldNamed):
1974         * bindings/c/c_instance.cpp:
1975         (CInstance::invokeMethod):
1976         * bindings/c/c_utility.cpp:
1977         (convertNPVariantToValue):
1978         * bindings/c/c_utility.h:
1979         * bindings/npruntime.cpp:
1980         (stringIdentifierEqual):
1981         (stringIdentifierHash):
1982         (getStringIdentifierDictionary):
1983         (intIdentifierEqual):
1984         (intIdentifierHash):
1985         (getIntIdentifierDictionary):
1986         (NPN_GetStringIdentifier):
1987         (NPN_GetStringIdentifiers):
1988         (NPN_GetIntIdentifier):
1989         (NPN_IdentifierIsString):
1990         (NPN_UTF8FromIdentifier):
1991         (NPN_VariantToInt32):
1992         (NPN_VariantToDouble):
1993         (NPN_SetException):
1994         * bindings/npruntime.h:
1995         * bindings/objc/WebScriptObject.mm:
1996         (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1997         * bindings/runtime_object.cpp:
1998         (RuntimeObjectImp::~RuntimeObjectImp):
1999         * bindings/runtime_root.cpp:
2000         (KJS::Bindings::rootForInterpreter):
2001         * bindings/testbindings.cpp:
2002         (initializeIdentifiers):
2003         (logMessage):
2004         (setDoubleValue):
2005         (setIntValue):
2006         (setBooleanValue):
2007
2008 === JavaScriptCore-146.1 ===
2009
2010 2004-06-16  Richard Williamson   <rjw@apple.com>
2011
2012         Fixed <rdar://problem/3702287> Crash returning nil from bound ObjC
2013
2014         This turned out to be a show stopper for Dashboard.  Accessing a nil
2015         ObjC property from JS caused a crash.  Similar to the problem
2016         3696112 fixed below.
2017         
2018         Reviewed by Trey.
2019
2020         * bindings/objc/objc_runtime.mm:
2021         (KJS::Bindings::ObjcField::valueFromInstance):
2022
2023 === Safari-146 ===
2024
2025 2004-06-16  Richard Williamson   <rjw@apple.com>
2026
2027         Fixed <rdar://problem/3696112>: nil from an Objective-C class seems to get wrapped as a JavaScript proxy that will not print.
2028
2029         This turned out to be a show stopper for Dashboard.  We now
2030         return Undefined() when nil is returned from a ObjC method
2031         that returns an object type.
2032         
2033         Reviewed by Maciej.
2034
2035         * bindings/objc/objc_utility.mm:
2036         (KJS::Bindings::convertObjcValueToValue):
2037
2038 === Safari-145 ===
2039
2040 2004-06-15  Richard Williamson   <rjw@apple.com>
2041
2042         Fixed <rdar://problem/3695875>: Objective-C instances that are exported to JavaScript are too promiscuous
2043
2044         No longer need to check respondsToSelector: for
2045         isSelectorExcludedFromWebScript: and isKeyExcludedFromWebScript:
2046         because these now have a default implementation on NSObject.
2047
2048         Reviewed by Trey.
2049
2050         * bindings/objc/objc_class.mm:
2051         (ObjcClass::methodsNamed):
2052         (ObjcClass::fieldNamed):
2053
2054 2004-06-14  Darin Adler  <darin@apple.com>
2055
2056         Reviewed by Maciej.
2057
2058         - fixed some things for GC that Patrick missed, or that happened after the branch
2059
2060         * bindings/objc/WebScriptObject.mm:
2061         (-[WebScriptObject dealloc]): Moved removeNativeReference call here from private object.
2062         (-[WebScriptObject finalize]): Added.
2063
2064         - added some missing nil checks
2065
2066         * bindings/objc/objc_instance.mm:
2067         (ObjcInstance::ObjcInstance): Check for nil.
2068         (ObjcInstance::~ObjcInstance): Check for nil.
2069         (ObjcInstance::operator=): Check for nil.
2070
2071 2004-06-14  Darin Adler  <darin@apple.com>
2072
2073         Reviewed by me, code changes by Patrick Beard.
2074
2075         - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
2076
2077         * bindings/objc/objc_instance.mm:
2078         (ObjcInstance::ObjcInstance): Use CFRetain instead of retain.
2079         (ObjcInstance::~ObjcInstance): Use CFRelease instead of release.
2080         (ObjcInstance::operator=): More of the same.
2081         (ObjcInstance::end): Use [pool drain] if compiling on Tiger.
2082
2083         * bindings/objc/objc_runtime.mm:
2084         (ObjcArray::ObjcArray): Use CFRetain instead of retain.
2085         (ObjcArray::~ObjcArray): Use CFRelease instead of release.
2086         (ObjcArray::operator=): More of the same.
2087
2088         * bindings/testbindings.mm: Fixed incorrect license.
2089         (main): Use [pool drain] if compiling on Tiger.
2090
2091 === Safari-144 ===
2092
2093 2004-06-10  Kevin Decker  <kdecker@apple.com>
2094
2095         Reviewed by John.
2096
2097         * kjs/lexer.cpp: 
2098         (Lexer::setCode):
2099             - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
2100         * kjs/lexer.h:
2101         (KJS::Lexer::lineNo):
2102             - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
2103
2104 === JavaScriptCore-143.2 ===
2105
2106 2004-06-07  Darin Adler  <darin@apple.com>
2107
2108         - fixed <rdar://problem/3682489>: (JavaScriptGlue no longer compiles because Interpreter::evaluate parameters changed)
2109
2110         * kjs/interpreter.h: Added an overload to make JavaScriptGlue compile.
2111         * kjs/interpreter.cpp: (KJS::Interpreter::evaluate): Implemented the overload.
2112
2113 === JavaScriptCore-143.1 ===
2114
2115 2004-06-04  Kevin Decker  <kdecker@apple.com>
2116
2117         Reviewed by Darin
2118         
2119         - fixed <rdar://problem/3680594>
2120
2121         * kjs/object.cpp:
2122         (KJS::Error::create):
2123
2124 === Safari-143 ===
2125
2126 2004-06-04  Darin Adler  <darin@apple.com>
2127
2128         * kjs/testkjs.cpp: (main): Fix build breakage by adding URL and line number parameters.
2129
2130 2004-06-04  Kevin Decker  <kdecker@apple.com>
2131
2132         Reviewed by Dave.
2133
2134         - ObjC bindings do not (yet) pass along sourceurl or line numbers
2135         - we don't have a way as of yet to accomidate line numbers and urls for dynamic javascript
2136         - changed the wording of an error message
2137         - the lexer, parser, and interpreter have been made "sourceURL aware"
2138         - stored the url into Error
2139          
2140         * bindings/NP_jsobject.cpp:
2141         (NPN_Evaluate):
2142         * bindings/jni/jni_jsobject.cpp:
2143         (JSObject::eval):
2144         * bindings/objc/WebScriptObject.mm:
2145         (-[WebScriptObject evaluateWebScript:]):
2146         * kjs/function.cpp:
2147         (GlobalFuncImp::call):
2148         * kjs/function_object.cpp:
2149         (FunctionObjectImp::construct):
2150         * kjs/internal.cpp:
2151         (Parser::parse):
2152         (InterpreterImp::checkSyntax):
2153         (InterpreterImp::evaluate):
2154         * kjs/internal.h:
2155         * kjs/interpreter.cpp:
2156         (Interpreter::evaluate):
2157         * kjs/interpreter.h:
2158         * kjs/lexer.cpp:
2159         (Lexer::setCode):
2160         * kjs/lexer.h:
2161         (KJS::Lexer::sourceURL):
2162         * kjs/nodes.cpp:
2163         (Node::Node):
2164         (Node::throwError):
2165         (FunctionCallNode::evaluate):
2166         * kjs/nodes.h:
2167         * kjs/object.cpp:
2168         (KJS::Error::create):
2169         * kjs/object.h:
2170
2171 2004-06-04  Richard Williamson   <rjw@apple.com>
2172
2173         Fixed crash when attempting to access properties on nil
2174         object.
2175         
2176         Reviewed by John.
2177
2178         * bindings/objc/objc_instance.mm:
2179         (ObjcInstance::getClass):
2180         * bindings/runtime_object.cpp:
2181         (RuntimeObjectImp::get):
2182         * bindings/testM.js:
2183         * bindings/testbindings.mm:
2184         (-[MyFirstInterface getString]):
2185
2186 2004-05-27  Kevin Decker  <kdecker@apple.com>
2187
2188         Reviewed by Ken.
2189
2190         -revised generated error message content
2191         
2192         * kjs/error_object.cpp:
2193         (ErrorProtoFuncImp::call):
2194         * kjs/internal.cpp:
2195         (Parser::parse):
2196         * kjs/object.cpp:
2197         (KJS::Error::create):
2198
2199 === Safari-142 ===
2200
2201 2004-05-27  Richard Williamson   <rjw@apple.com>
2202
2203         Renamed WebScriptMethods to WebScripting based on feedback from Nancy.
2204
2205         Reviewed by Chris.
2206
2207         * bindings/objc/WebScriptObject.h:
2208
2209 2004-05-27  Darin Adler  <darin@apple.com>
2210
2211         Reviewed by Maciej.
2212
2213         - moved to new symlink technique for embedding frameworks
2214
2215         * JavaScriptCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
2216         because we don't need it any more.
2217
2218 2004-05-24  Richard Williamson   <rjw@apple.com>
2219
2220         Changed RuntimeArrayImp to inherit from ArrayInstanceImp and
2221         fixed ClassInfo to correctly reflect inheritance.  This is required
2222         because of the runtime checks in JSC for arrays, i.e. in
2223         the Function objects apply method.
2224
2225         Reviewed by Ken.
2226
2227         * bindings/jni/jni_runtime.cpp:
2228         (JavaArray::convertJObjectToArray):
2229         * bindings/objc/objc_utility.mm:
2230         (KJS::Bindings::convertObjcValueToValue):
2231         * bindings/runtime_array.cpp:
2232         (RuntimeArrayImp::RuntimeArrayImp):
2233         * bindings/runtime_array.h:
2234         * bindings/testM.js: Added.
2235         * bindings/testbindings.mm:
2236         (+[MyFirstInterface webScriptNameForSelector:]):
2237         (-[MyFirstInterface logMessages:]):
2238         (-[MyFirstInterface logMessage:prefix:]):
2239         (-[MyFirstInterface callJSObject::]):
2240
2241 2004-05-22  Darin Adler  <darin@apple.com>
2242
2243         Reviewed by Maciej.
2244
2245         - fixed <rdar://problem/3664260>: (JS needs to listen to timezone change notifications)
2246
2247         * kjs/date_object.cpp: (CopyLocalTimeZone): As per Chris Kane and Jordan Hubbard, use <notify.h>
2248         with a hardcoded string of "com.apple.system.timezone", and do CFTimeZoneResetSystem since
2249         CoreFoundation doesn't do this itself. Turns out this affects the default time zone as long as
2250         it hasn't been set explicitly.
2251
2252 === Safari-141 ===
2253
2254 2004-05-20  Richard Williamson   <rjw@apple.com>
2255
2256         Implemented WebScriptObject/DOM wrapper voodoo.  DOM wrappers
2257         can now be referenced like any other WebScriptObject, meaning
2258         you can do JS operations on them.
2259
2260         All added implementation of finalizeForWebScript.
2261
2262         Reviewed by Ken.
2263
2264         * bindings/objc/WebScriptObject.h:
2265         * bindings/objc/WebScriptObject.mm:
2266         (-[WebScriptObject _initializeWithObjectImp:KJS::root:Bindings::]):
2267         (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
2268         (-[WebScriptObject KJS::]):
2269         (-[WebScriptObject dealloc]):
2270         (-[WebScriptObject callWebScriptMethod:withArguments:]):
2271         (-[WebScriptObject evaluateWebScript:]):
2272         (-[WebScriptObject setValue:forKey:]):
2273         (-[WebScriptObject valueForKey:]):
2274         (-[WebScriptObject stringRepresentation]):
2275         * bindings/objc/WebScriptObjectPrivate.h:
2276         * bindings/objc/objc_instance.mm:
2277         (ObjcInstance::~ObjcInstance):
2278
2279 2004-05-19  Richard Williamson   <rjw@apple.com>
2280
2281         Removed extraneous tabs that were added (by XCode?).
2282
2283         * bindings/objc/WebScriptObject.h:
2284
2285 2004-05-19  Darin Adler  <darin@apple.com>
2286
2287         - fixed headers with licenses mangled by Xcode auto-indenting
2288
2289         * bindings/jni/jni_jsobject.cpp:
2290         * bindings/jni/jni_jsobject.h:
2291         * bindings/runtime_array.h:
2292         * bindings/runtime_root.cpp:
2293         * bindings/runtime_root.h:
2294
2295 2004-05-18  Richard Williamson   <rjw@apple.com>
2296
2297         Added exception logging.  Also check for exception and
2298         set results as appropriate.
2299
2300         Reviewed by Maciej (partially reviewed).
2301
2302         * bindings/objc/WebScriptObject.mm:
2303         (-[WebScriptObject callWebScriptMethod:withArguments:]):
2304         (-[WebScriptObject evaluateWebScript:]):
2305         (-[WebScriptObject setValue:forKey:]):
2306         (-[WebScriptObject valueForKey:]):
2307
2308 2004-05-18  Richard Williamson   <rjw@apple.com>
2309
2310         Finsished implementing support for windowScriptObject.
2311         Had to make WebScriptObjectPrivate.h accessible from
2312         WebCore.
2313
2314         Reviewed by Maciej.
2315
2316         * JavaScriptCore.pbproj/project.pbxproj:
2317         * bindings/objc/WebScriptObjectPrivate.h:
2318
2319 2004-05-18  Richard Williamson   <rjw@apple.com>
2320
2321         Use KVC to set/get values instead of directly accessing
2322         ivars.
2323
2324         Reviewed by Maciej.
2325
2326         * bindings/objc/WebScriptObject.mm:
2327         (-[WebScriptObject callWebScriptMethod:withArguments:]):
2328         (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2329         * bindings/objc/objc_runtime.mm:
2330         (ObjcField::valueFromInstance):
2331         (convertValueToObjcObject):
2332         (ObjcField::setValueToInstance):
2333
2334 2004-05-17  Richard Williamson   <rjw@apple.com>
2335
2336         Implemented new API for WebScriptObject.
2337
2338         Fixed <rdar://problem/3657145>: (objc to javascript method calls do not cause updates.)
2339         Fixed <rdar://problem/3654887>: (Update to JSC to refer to new JSObject LiveConnect object)  (w/ help from Vicki)
2340
2341         Reviewed by Hyatt.
2342
2343         * JavaScriptCore.pbproj/project.pbxproj:
2344         * bindings/c/c_instance.cpp:
2345         (CInstance::invokeMethod):
2346         * bindings/jni/jni_instance.cpp:
2347         (JavaInstance::invokeMethod):
2348         * bindings/jni/jni_jsobject.cpp:
2349         (JSObject::convertValueToJObject):
2350         * bindings/jni/jni_utility.cpp:
2351         (KJS::Bindings::getJNIField):
2352         * bindings/objc/WebScriptObject.mm:
2353         (_didExecute):
2354         (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
2355         (-[WebScriptObject KJS::]):
2356         (-[WebScriptObject dealloc]):
2357         (+[WebScriptObject throwException:]):
2358         (listFromNSArray):
2359         (-[WebScriptObject callWebScriptMethod:withArguments:]):
2360         (-[WebScriptObject evaluateWebScript:]):
2361         (-[WebScriptObject setValue:forKey:]):
2362         (-[WebScriptObject valueForKey:]):
2363         (-[WebScriptObject stringRepresentation]):
2364         (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2365         (+[WebUndefined undefined]):
2366         (-[WebUndefined initWithCoder:]):
2367         (-[WebUndefined encodeWithCoder:]):
2368         (-[WebUndefined copyWithZone:]):
2369         (-[WebUndefined retain]):
2370         (-[WebUndefined release]):
2371         (-[WebUndefined retainCount]):
2372         (-[WebUndefined autorelease]):
2373         (-[WebUndefined dealloc]):
2374         (-[WebUndefined copy]):
2375         (-[WebUndefined replacementObjectForPortCoder:]):
2376         * bindings/objc/WebScriptObjectPrivate.h: Added.
2377         * bindings/objc/objc_class.mm:
2378         (ObjcClass::methodsNamed):
2379         (ObjcClass::fieldNamed):
2380         * bindings/objc/objc_instance.mm:
2381         (ObjcInstance::invokeMethod):
2382         * bindings/objc/objc_jsobject.h:
2383         * bindings/objc/objc_jsobject.mm:
2384         * bindings/objc/objc_runtime.mm:
2385         (ObjcField::valueFromInstance):
2386         * bindings/objc/objc_utility.mm:
2387         (KJS::Bindings::JSMethodNameToObjCMethodName):
2388         (KJS::Bindings::convertValueToObjcValue):
2389         (KJS::Bindings::convertObjcValueToValue):
2390         * bindings/runtime.cpp:
2391         (Instance::setDidExecuteFunction):
2392         (Instance::didExecuteFunction):
2393         (Instance::setValueOfField):
2394         * bindings/runtime.h:
2395         * bindings/testbindings.mm:
2396         (+[MyFirstInterface webScriptNameForSelector:]):
2397         (-[MyFirstInterface callJSObject::]):
2398
2399 2004-05-14  Vicki Murley  <vicki@apple.com>
2400
2401         Reviewed by mjs.
2402  
2403         <rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release
2404
2405         * JavaScriptCore.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0
2406
2407 === Safari-140 ===
2408
2409 2004-05-13  Richard Williamson   <rjw@apple.com>
2410
2411         Fixed indentation.
2412
2413         Reviewed by Chris.
2414
2415         * ChangeLog:
2416         * bindings/objc/WebScriptObject.h:
2417
2418 2004-05-13  Richard Williamson   <rjw@apple.com>
2419
2420         Approved API changes.  Currently unimplemented.
2421
2422         Reviewed by Chris.
2423
2424         * ChangeLog:
2425         * JavaScriptCore.pbproj/project.pbxproj:
2426         * bindings/objc/WebScriptObject.h: Added.
2427         * bindings/objc/WebScriptObject.mm: Added.
2428         (+[WebScriptObject throwException:]):
2429         (-[WebScriptObject callWebScriptMethod:withArguments:]):
2430         (-[WebScriptObject evaluateWebScript:]):
2431         (-[WebScriptObject stringRepresentation]):
2432         (+[WebUndefined undefined]):
2433         (-[WebUndefined initWithCoder:]):
2434         (-[WebUndefined encodeWithCoder:]):
2435         (-[WebUndefined copyWithZone:]):
2436
2437 2004-05-07  Vicki Murley  <vicki@apple.com>
2438
2439         Reviewed by darin.
2440
2441         Turn off GC since it uses ppc only instructions (which breaks 
2442         the B&I build).   
2443     
2444         * kjs/value.h: set USE_CONSERVATIVE_GC to 0
2445
2446 === Safari-139 ===
2447
2448 2004-05-07  Maciej Stachowiak  <mjs@apple.com>
2449
2450         Reviewed by Darin.
2451
2452         - add -funroll-loops=16 compiler option for approx .5% speedup on
2453         HTML iBench and .5-1% speedup on JS iBench.
2454         
2455         * JavaScriptCore.pbproj/project.pbxproj:
2456
2457 2004-04-25  Maciej Stachowiak  <mjs@apple.com>
2458
2459         Reviewed by Darin.
2460
2461         Enable full conservative GC mode in addition to test mode. When
2462         conservative GC is enabled, we now get an 11% speed improvement on
2463         the iBench. Also fix some spots I missed before.
2464
2465         Specific noteworth changes:
2466         
2467         * kjs/collector.cpp:
2468         (KJS::Collector::markStackObjectsConservatively): Check possible
2469         cell pointers for 8-byte aligment and verify they are not 0.
2470
2471         * kjs/protected_values.cpp:
2472         (KJS::ProtectedValues::increaseProtectCount): Move null-tolerance from here...
2473         (KJS::ProtectedValues::decreaseProtectCount): ...and here...
2474         * kjs/protect.h:
2475         (KJS::gcProtectNullTolerant): ...to here...
2476         (KJS::gcUnprotectNullTolerant): ...and here, because not all callers need the null
2477         tolerance, and doing the check is expensive.
2478
2479         * kjs/protected_values.cpp:
2480         (KJS::ProtectedValues::computeHash): Replace hash function with a much faster one
2481         that is still very good.
2482
2483         * kjs/protect.h:
2484         (KJS::gcProtect):
2485         (KJS::gcUnprotect):
2486         (KJS::ProtectedValue::ProtectedValue):
2487         (KJS::ProtectedValue::~ProtectedValue):
2488         (KJS::ProtectedValue::operator=):
2489         (KJS::ProtectedObject::ProtectedObject):
2490         (KJS::ProtectedObject::~ProtectedObject):
2491         (KJS::ProtectedObject::operator=):
2492         (KJS::ProtectedReference::ProtectedReference):
2493         (KJS::ProtectedReference::~ProtectedReference):
2494         (KJS::ProtectedReference::operator=):
2495         * kjs/protected_values.cpp:
2496         (KJS::ProtectedValues::getProtectCount):
2497         (KJS::ProtectedValues::increaseProtectCount):
2498         (KJS::ProtectedValues::decreaseProtectCount):
2499         (KJS::ProtectedValues::computeHash):
2500         * bindings/runtime_root.cpp:
2501         (KJS::Bindings::addNativeReference):
2502         (KJS::Bindings::removeNativeReference):
2503         (RootObject::removeAllNativeReferences):
2504         * bindings/runtime_root.h:
2505         (KJS::Bindings::RootObject::~RootObject):
2506         (KJS::Bindings::RootObject::setRootObjectImp):
2507         * kjs/collector.cpp:
2508         (KJS::Collector::allocate):
2509         (KJS::Collector::collect):
2510         * kjs/collector.h:
2511         * kjs/internal.cpp:
2512         (NumberImp::create):
2513         (InterpreterImp::globalInit):
2514         (InterpreterImp::globalClear):
2515         (InterpreterImp::mark):
2516         * kjs/list.cpp:
2517         (KJS::List::derefValues):
2518         (KJS::List::refValues):
2519         (KJS::List::append):
2520         * kjs/object.cpp:
2521         (KJS::ObjectImp::setInternalValue):
2522         (KJS::ObjectImp::putDirect):
2523         * kjs/value.cpp:
2524         (ValueImp::mark):
2525         (ValueImp::marked):
2526         * kjs/value.h:
2527         (KJS::ValueImp::ValueImp):
2528         (KJS::ValueImp::~ValueImp):
2529         (KJS::ValueImp::):
2530         (KJS::Value::Value):
2531         (KJS::Value::~Value):
2532         (KJS::Value::operator=):
2533
2534 2004-04-30  Richard Williamson   <rjw@apple.com>
2535
2536         Asking an NSInvocation for it's return value when return type
2537         is void throws an exception.  Added check for void return types
2538         to avoid this exception.
2539
2540         Reviewed by Ken.
2541
2542         * bindings/objc/objc_instance.mm:
2543         (ObjcInstance::invokeMethod):
2544
2545 2004-04-29  Richard Williamson   <rjw@apple.com>
2546
2547         Fixed several bad problems with the ObjC bindings.  In particular, conversion
2548         to/from JavaScriptObject (soon to be WebScriptObject) was completely broken.
2549
2550         Reviewed by Chris.
2551
2552         * bindings/objc/objc_jsobject.h:
2553         * bindings/objc/objc_jsobject.mm:
2554         (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
2555         (-[JavaScriptObject KJS::]):
2556         (+[JavaScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2557         (-[JavaScriptObject call:arguments:]):
2558         (-[JavaScriptObject evaluate:]):
2559         (-[JavaScriptObject getMember:]):
2560         (-[JavaScriptObject getSlot:]):
2561         * bindings/objc/objc_runtime.mm:
2562         (ObjcField::valueFromInstance):
2563         (ObjcField::setValueToInstance):
2564         * bindings/objc/objc_utility.mm:
2565         (KJS::Bindings::convertValueToObjcValue):
2566         (KJS::Bindings::convertObjcValueToValue):
2567         * bindings/runtime.h:
2568         * bindings/runtime_root.cpp:
2569         (KJS::Bindings::rootForInterpreter):
2570         (KJS::Bindings::addNativeReference):
2571         (KJS::Bindings::removeNativeReference):
2572         * bindings/runtime_root.h:
2573         * bindings/testbindings.mm:
2574         (-[MyFirstInterface logMessage:]):
2575         (-[MyFirstInterface setJSObject:]):
2576         (-[MyFirstInterface callJSObject::]):
2577
2578 2004-04-24  Darin Adler  <darin@apple.com>
2579
2580         Reviewed by Dave.
2581
2582         * kjs/ustring.cpp: (KJS::UString::append): Fix one case that was allocating a buffer
2583         that is 2x too big.
2584
2585 2004-04-23  Maciej Stachowiak  <mjs@apple.com>
2586
2587         Reviewed by Darin.
2588
2589         Implementation of conservative GC, based partly on code from
2590         Darin. It's turned off for now, so it shouldn't have any effect on
2591         the normal build.
2592         
2593         * JavaScriptCore.pbproj/project.pbxproj:
2594         * kjs/collector.cpp:
2595         (KJS::Collector::markStackObjectsConservatively):
2596         (KJS::Collector::markProtectedObjects):
2597         (KJS::Collector::collect):
2598         * kjs/collector.h:
2599         * kjs/protect.h:
2600         (KJS::gcProtect):
2601         (KJS::gcUnprotect):
2602         * kjs/protected_values.cpp: Added.
2603         (KJS::ProtectedValues::getProtectCount):
2604         (KJS::ProtectedValues::increaseProtectCount):
2605         (KJS::ProtectedValues::insert):
2606         (KJS::ProtectedValues::decreaseProtectCount):
2607         (KJS::ProtectedValues::expand):
2608         (KJS::ProtectedValues::shrink):
2609         (KJS::ProtectedValues::rehash):
2610         (KJS::ProtectedValues::computeHash):
2611         * kjs/protected_values.h: Added.
2612         * kjs/value.cpp:
2613         (ValueImp::useConservativeMark):
2614         (ValueImp::mark):
2615         (ValueImp::marked):
2616         * kjs/value.h:
2617         (KJS::ValueImp::):
2618
2619 === Safari-138 ===
2620
2621 2004-04-22  Richard Williamson   <rjw@apple.com>
2622
2623         Fixed build snafu (re-declaration of NPBool in npruntime.h and
2624         npapi.h).
2625
2626         * bindings/npruntime.h:
2627
2628 2004-04-22  Richard Williamson   <rjw@apple.com>
2629
2630         Updated plugin binding API to reflect latest revision from
2631         working group.
2632         
2633         Biggest change is the introduction of NPVariant used to represent
2634         value types.  NPVariant replaces the use of NPObject for the
2635         exchange of values between scripting environment and native code.
2636
2637         Reviewed by John.
2638
2639         * JavaScriptCore.pbproj/project.pbxproj:
2640         * bindings/NP_jsobject.cpp:
2641         (identiferFromNPIdentifier):
2642         (NPN_Call):
2643         (NPN_Evaluate):
2644         (NPN_GetProperty):
2645         (NPN_SetProperty):
2646         (NPN_ToString):
2647         (NPN_GetPropertyAtIndex):
2648         (NPN_SetPropertyAtIndex):
2649         * bindings/c/c_class.cpp:
2650         (CClass::methodsNamed):
2651         (CClass::fieldNamed):
2652         * bindings/c/c_instance.cpp:
2653         (CInstance::invokeMethod):
2654         (CInstance::defaultValue):
2655         * bindings/c/c_runtime.cpp:
2656         (CField::valueFromInstance):
2657         (CField::setValueToInstance):
2658         * bindings/c/c_utility.cpp:
2659         (convertNPStringToUTF16):
2660         (convertUTF8ToUTF16):
2661         (coerceValueToNPVariantStringType):
2662         (convertValueToNPVariant):
2663         (convertNPVariantToValue):
2664         * bindings/c/c_utility.h:
2665         * bindings/npruntime.cpp:
2666         (NPN_GetIdentifier):
2667         (NPN_GetIdentifiers):
2668         (NPN_UTF8FromIdentifier):
2669         (NPN_VariantIsVoid):
2670         (NPN_VariantIsNull):
2671         (NPN_VariantIsUndefined):
2672         (NPN_VariantIsBool):
2673         (NPN_VariantIsInt32):
2674         (NPN_VariantIsDouble):
2675         (NPN_VariantIsString):
2676         (NPN_VariantIsObject):
2677         (NPN_VariantToBool):
2678         (NPN_VariantToString):
2679         (NPN_VariantToInt32):
2680         (NPN_VariantToDouble):
2681         (NPN_VariantToObject):
2682         (NPN_InitializeVariantAsVoid):
2683         (NPN_InitializeVariantAsNull):
2684         (NPN_InitializeVariantAsUndefined):
2685         (NPN_InitializeVariantWithBool):
2686         (NPN_InitializeVariantWithInt32):
2687         (NPN_InitializeVariantWithDouble):
2688         (NPN_InitializeVariantWithString):
2689         (NPN_InitializeVariantWithStringCopy):
2690         (NPN_InitializeVariantWithObject):
2691         (NPN_InitializeVariantWithVariant):
2692         (NPN_ReleaseVariantValue):
2693         (NPN_CreateObject):
2694         (NPN_RetainObject):
2695         (NPN_ReleaseObject):
2696         (NPN_IsKindOfClass):
2697         (NPN_SetExceptionWithUTF8):
2698         (NPN_SetException):
2699         * bindings/npruntime.h:
2700         (_NPString::):
2701         (_NPString::_NPVariant::):
2702         * bindings/testbindings.cpp:
2703         (logMessage):
2704         (setDoubleValue):
2705         (setIntValue):
2706         (setStringValue):
2707         (setBooleanValue):
2708         (getDoubleValue):
2709         (getIntValue):
2710         (getStringValue):
2711         (getBooleanValue):
2712         (myGetProperty):
2713         (mySetProperty):
2714         (myInvoke):
2715         (myAllocate):
2716
2717 2004-04-22  Darin Adler  <darin@apple.com>
2718
2719         Reviewed by Maciej.
2720
2721         - fixed <rdar://problem/3627473>: "REGRESSION (125-137): memory trasher in UString::append, causing many different crashes"
2722
2723         * kjs/ustring.cpp:
2724         (KJS::UString::expandCapacity): Fix sizeof(UChar *) that should be sizeof(UChar).
2725         Was resulting in a buffer 2x the needed size.
2726         (KJS::UString::expandPreCapacity): Ditto.
2727         (KJS::UString::append): Fix malloc that is missing a sizeof(UChar).
2728
2729 2004-04-21  Maciej Stachowiak  <mjs@apple.com>
2730
2731         Reviewed by Darin.
2732
2733         Preliminary change for conservative GC. Create "protected"
2734         subclasses to GC-protect objects when on heap, since we will soon
2735         remove the built-in refcounting of the normal wrapper classes. Use
2736         them where needed.
2737         
2738         * JavaScriptCore.pbproj/project.pbxproj:
2739         * kjs/context.h:
2740         * kjs/internal.h:
2741         (KJS::InterpreterImp::globalObject):
2742         * kjs/interpreter.h:
2743         * kjs/property_map.cpp:
2744         * kjs/reference.h:
2745         * kjs/reference_list.cpp:
2746
2747 2004-04-19  Maciej Stachowiak  <mjs@apple.com>
2748
2749         Reviewed by Dave.
2750
2751         Optimize prepend using the shared substring optimization. Also,
2752         limit the applicability of shared append and shared prepend. If
2753         you overdo it, it does more harm than good, because you create a
2754         bunch of strings that are disqualified from future shared
2755         append/prepend, for not much immediate savings in allocate/copy
2756         expense.
2757         
2758         * kjs/ustring.cpp:
2759         (KJS::):
2760         (KJS::UString::Rep::create):
2761         (KJS::UString::expandedSize):
2762         (KJS::UString::usedPreCapacity):
2763         (KJS::UString::expandCapacity):
2764         (KJS::UString::expandPreCapacity):
2765         (KJS::UString::UString):
2766         (KJS::UString::append):
2767         (KJS::UString::operator=):
2768         * kjs/ustring.h:
2769         (KJS::UString::Rep::data):
2770
2771 2004-04-16  Maciej Stachowiak  <mjs@apple.com>
2772         Reviewed by Richard.
2773
2774         No more need for Completion or Reference to privately inherit from
2775         Value, none of the superclass functionality is used.
2776
2777         * kjs/completion.h:
2778         * kjs/reference.h:
2779
2780 === Safari-137 ===
2781
2782 2004-04-16  Richard Williamson   <rjw@apple.com>
2783
2784         Added interpreter lock protection around object creation.
2785
2786         Reviewed by Chris.
2787
2788         * bindings/runtime.cpp:
2789         (Instance::createRuntimeObject):
2790
2791 2004-04-16  Maciej Stachowiak  <mjs@apple.com>
2792
2793         Reviewed by Ken.
2794
2795         Another JavaScript speed improvement: use the mechanism from
2796         string append optimization to make taking a substring fast, again
2797         sharing the buffer.
2798
2799         A further 22% improvement on the 24fun string speed test.
2800         
2801         * kjs/ustring.cpp:
2802         (KJS::):
2803         (KJS::UString::Rep::create):
2804         (KJS::UString::UString):
2805         (KJS::UString::append):
2806         (KJS::UString::operator=):
2807         (KJS::UString::substr):
2808         * kjs/ustring.h:
2809         (KJS::UString::Rep::data):
2810
2811 2004-04-13  Maciej Stachowiak  <mjs@apple.com>
2812
2813         Reviewed by Darin.
2814
2815         - fixed <rdar://problem/3600695>: String manipulation in JavaScript 24fun test is very slow (slow)
2816         - fixed <rdar://problem/3600691>: Table generation test is really slow
2817         - fixed <rdar://problem/3600661>: 24fun date test is really slow
2818
2819         80% speedup on the string test, lesser speedups on the other two.
2820         
2821         Two different optimizations here:
2822
2823         1) Avoid large overhead of scanning strings to see if they are all
2824         ASCII before numeric conversion.
2825         
2826         * kjs/nodes.cpp:
2827         (AssignNode::evaluate): Don't convert to integer until we know for
2828         sure the operation will need it. Attempting to convert strings to
2829         numbers is a waste when they are being appended with +=.
2830
2831         2) Avoid huge cost of appending strings.
2832
2833         This is done by allowing multiple strings to share a buffer but
2834         actually use different ranges of it. The first time a string is
2835         appended to, we start leaving at least 10% extra space in the
2836         buffer, so doing N appends to the same string takes O(log N)
2837         mallocs instead of O(N).
2838         
2839         * kjs/identifier.cpp:
2840         (KJS::Identifier::equal):
2841         (KJS::Identifier::add):
2842         * kjs/ustring.cpp:
2843         (KJS::):
2844         (KJS::UCharReference::operator=):
2845         (KJS::UCharReference::ref):
2846         (KJS::UString::Rep::create):
2847         (KJS::UString::Rep::destroy):
2848         (KJS::UString::expandedSize):
2849         (KJS::UString::usedCapacity):
2850         (KJS::UString::expandCapacity):
2851         (KJS::UString::UString):
2852         (KJS::UString::null):
2853         (KJS::UString::append):
2854         (KJS::UString::operator=):
2855         (KJS::UString::toStrictUInt32):
2856         (KJS::UString::detach):
2857         (KJS::KJS::operator==):
2858         * kjs/ustring.h:
2859         (KJS::UString::Rep::data):
2860         (KJS::UString::Rep::hash):
2861
2862 2004-04-09  Maciej Stachowiak  <mjs@apple.com>
2863
2864         Reviewed by John.
2865
2866         - fix deployment build by avoiding deployment-only warning.
2867
2868         * kjs/scope_chain.cpp:
2869         (KJS::ScopeChain::bottom):
2870
2871 2004-04-09  Maciej Stachowiak  <mjs@apple.com>
2872
2873         Reviewed by John.
2874
2875         Changed things so that newly created objects get a prototype based
2876         on the scope chain of the current function, rather than the
2877         interpreter that started execution. This fixes the following bugs:
2878         
2879         <rdar://problem/3368523>: ARCH: wrong prototype used to create new objects (hang on lookup.atomica.com)
2880         <rdar://problem/3559173>: ARCH: Cannot scan using a HP Jetdirect product (JS object prototypes bind incorrectly)
2881
2882         * JavaScriptCore.pbproj/project.pbxproj:
2883         * kjs/array_object.cpp:
2884         (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
2885         (ArrayProtoFuncImp::ArrayProtoFuncImp):
2886         (ArrayProtoFuncImp::call):
2887         (ArrayObjectImp::construct):
2888         * kjs/bool_object.cpp:
2889         (BooleanObjectImp::construct):
2890         * kjs/date_object.cpp:
2891         (DateProtoFuncImp::DateProtoFuncImp):
2892         (DateProtoFuncImp::call):
2893         (DateObjectImp::construct):
2894         * kjs/error_object.cpp:
2895         (ErrorObjectImp::construct):
2896         * kjs/function.cpp:
2897         (FunctionImp::FunctionImp):
2898         (FunctionImp::call):
2899         (DeclaredFunctionImp::construct):
2900         (ArgumentsImp::ArgumentsImp):
2901         (GlobalFuncImp::call):
2902         * kjs/function_object.cpp:
2903         (FunctionProtoFuncImp::call):
2904         (FunctionObjectImp::construct):
2905         * kjs/internal.cpp:
2906         (BooleanImp::toObject):
2907         (StringImp::toObject):
2908         (NumberImp::toObject):
2909         (InterpreterImp::InterpreterImp):
2910         (InterpreterImp::clear):
2911         (InterpreterImp::interpreterWithGlobalObject):
2912         * kjs/internal.h:
2913         * kjs/interpreter.cpp:
2914         (ExecState::lexicalInterpreter):
2915         * kjs/interpreter.h:
2916         (KJS::ExecState::dynamicInterpreter):
2917         (KJS::ExecState::interpreter):
2918         * kjs/math_object.cpp:
2919         (MathFuncImp::MathFuncImp):
2920         * kjs/nodes.cpp:
2921         (StatementNode::hitStatement):
2922         (StatementNode::abortStatement):
2923         (RegExpNode::evaluate):
2924         (ElementNode::evaluate):
2925         (ArrayNode::evaluate):
2926         (ObjectLiteralNode::evaluate):
2927         (PropertyValueNode::evaluate):
2928         (FunctionCallNode::evaluate):
2929         (FuncDeclNode::processFuncDecl):
2930         (FuncExprNode::evaluate):
2931         * kjs/number_object.cpp:
2932         (NumberObjectImp::construct):
2933         * kjs/object.cpp:
2934         (KJS::ObjectImp::defaultValue):
2935         (KJS::Error::create):
2936         * kjs/object_object.cpp:
2937         (ObjectObjectImp::construct):
2938         * kjs/reference.cpp:
2939         (Reference::putValue):
2940         * kjs/regexp_object.cpp:
2941         (RegExpProtoFuncImp::call):
2942         (RegExpObjectImp::arrayOfMatches):
2943         (RegExpObjectImp::construct):
2944         * kjs/scope_chain.cpp:
2945         (KJS::ScopeChain::bottom):
2946         * kjs/scope_chain.h:
2947         * kjs/string_object.cpp:
2948         (StringProtoFuncImp::StringProtoFuncImp):
2949         (StringProtoFuncImp::call):
2950         (StringObjectImp::construct):
2951
2952 === Safari-136 ===
2953
2954 === Safari-135 ===
2955
2956 2004-03-31  Richard Williamson   <rjw@apple.com>
2957
2958         Tedious renames based on feedback from plugin-futures list.
2959         NP_ functions are renamed with NPN_ prefix.
2960         Types prefix renamed from NP_ to NP.
2961         NPN_CreateStringWithUTF8 and NPN_SetExceptionWithUTF8 now take a length, optionally -1 if string is null terminated. 
2962         
2963         No review because this was just a renaming patch.
2964
2965         * bindings/NP_jsobject.cpp:
2966         (listFromNPArray):
2967         (jsAllocate):
2968         (identiferFromNPIdentifier):
2969         (NPN_Call):
2970         (NPN_Evaluate):
2971         (NPN_GetProperty):
2972         (NPN_SetProperty):
2973         (NPN_RemoveProperty):
2974         (NPN_ToString):
2975         (NPN_GetPropertyAtIndex):
2976         (NPN_SetPropertyAtIndex):
2977         * bindings/NP_jsobject.h:
2978         * bindings/c/c_class.cpp:
2979         (CClass::_commonInit):
2980         (CClass::classForIsA):
2981         (CClass::CClass):
2982         (CClass::methodsNamed):
2983         (CClass::fieldNamed):
2984         * bindings/c/c_class.h:
2985         * bindings/c/c_instance.cpp:
2986         (CInstance::CInstance):
2987         (CInstance::~CInstance):
2988         (CInstance::operator=):
2989         (CInstance::invokeMethod):
2990         (CInstance::defaultValue):
2991         * bindings/c/c_instance.h:
2992         (KJS::Bindings::CInstance::getObject):
2993         * bindings/c/c_runtime.cpp:
2994         (CField::valueFromInstance):
2995         (CField::setValueToInstance):
2996         * bindings/c/c_runtime.h:
2997         (KJS::Bindings::CField::CField):
2998         (KJS::Bindings::CField::name):
2999         (KJS::Bindings::CMethod::CMethod):
3000         (KJS::Bindings::CMethod::name):
3001         * bindings/c/c_utility.cpp:
3002         (coerceValueToNPString):
3003         (convertValueToNPValueType):
3004         (convertNPValueTypeToValue):
3005         * bindings/c/c_utility.h:
3006         * bindings/npruntime.cpp:
3007         (NPN_IdentifierFromUTF8):
3008         (NPN_IsValidIdentifier):
3009         (NPN_GetIdentifiers):
3010         (NPN_UTF8FromIdentifier):
3011         (NPN_CreateObject):
3012         (NPN_RetainObject):
3013         (NPN_ReleaseObject):
3014         (NPN_IsKindOfClass):
3015         (NPN_SetExceptionWithUTF8):
3016         (NPN_SetException):
3017         (numberAllocate):
3018         (NPN_CreateNumberWithInt):
3019         (NPN_CreateNumberWithFloat):
3020         (NPN_CreateNumberWithDouble):
3021         (NPN_IntFromNumber):
3022         (NPN_FloatFromNumber):
3023         (NPN_DoubleFromNumber):
3024         (stringAllocate):
3025         (NPN_CreateStringWithUTF8):
3026         (NPN_CreateStringWithUTF16):
3027         (NPN_DeallocateUTF8):
3028         (NPN_UTF8FromString):
3029         (NPN_UTF16FromString):
3030         (NPN_StringLength):
3031         (booleanAllocate):
3032         (NPN_CreateBoolean):
3033         (NPN_BoolFromBoolean):
3034         (nullAllocate):
3035         (NPN_GetNull):
3036         (undefinedAllocate):
3037         (NPN_GetUndefined):
3038         (arrayAllocate):
3039         (arrayDeallocate):
3040         (NPN_CreateArray):
3041         (NPN_CreateArrayV):
3042         (NPN_ObjectAtIndex):
3043         * bindings/npruntime.h:
3044         * bindings/runtime.cpp:
3045         (Instance::createBindingForLanguageInstance):
3046         * bindings/testbindings.cpp:
3047         (initializeIdentifiers):
3048         (myHasProperty):
3049         (myHasMethod):
3050         (myGetProperty):
3051         (mySetProperty):
3052         (logMessage):
3053         (setDoubleValue):
3054         (setIntValue):
3055         (setStringValue):
3056         (setBooleanValue):
3057         (getDoubleValue):
3058         (getIntValue):
3059         (getStringValue):
3060         (getBooleanValue):
3061         (myInvoke):
3062         (myAllocate):
3063         (myInvalidate):
3064         (myDeallocate):
3065         (main):
3066
3067 2004-03-31  Richard Williamson   <rjw@apple.com>
3068
3069         Changed references to NP_runtime.h to npruntime.h
3070         
3071         * JavaScriptCore.pbproj/project.pbxproj:
3072         * bindings/NP_jsobject.h:
3073         * bindings/c/c_class.h:
3074         * bindings/c/c_instance.h:
3075         * bindings/c/c_runtime.h:
3076         * bindings/c/c_utility.h:
3077         * bindings/npruntime.cpp:
3078
3079 2004-03-31  Richard Williamson   <rjw@apple.com>
3080
3081         Renamed NP_runtime.h to npruntime.h to match Netscape SDK.
3082
3083         * JavaScriptCore.pbproj/project.pbxproj:
3084         * bindings/NP_jsobject.h:
3085         * bindings/npruntime.cpp:
3086
3087 === Safari-134 ===
3088
3089 2004-03-23  Richard Williamson   <rjw@apple.com>
3090
3091         Added implementation of KJS::Value <-> NP_Object conversion functions.
3092         Augmented test program for 'C' bindings.
3093         Added asserts and parameter checking to all public API.        
3094
3095         Reviewed by Ken.
3096
3097         * JavaScriptCore.pbproj/project.pbxproj:
3098         * bindings/NP_jsobject.cpp:
3099         (NP_ToString):
3100         * bindings/NP_jsobject.h: Added.
3101         * bindings/NP_runtime.cpp:
3102         (NP_IdentifierFromUTF8):
3103         (NP_IsValidIdentifier):
3104         (NP_GetIdentifiers):
3105         (NP_CreateObject):
3106         (NP_RetainObject):
3107         (NP_ReleaseObject):
3108         (NP_IsKindOfClass):
3109         (NP_SetExceptionWithUTF8):
3110         (NP_SetException):
3111         (NP_IntFromNumber):
3112         (NP_FloatFromNumber):
3113         (NP_DoubleFromNumber):
3114         (NP_CreateStringWithUTF8):
3115         (NP_CreateStringWithUTF16):
3116         (NP_DeallocateUTF8):
3117         (NP_UTF8FromString):
3118         (NP_UTF16FromString):
3119         (NP_StringLength):
3120         (NP_BoolFromBoolean):
3121         * bindings/NP_runtime.h:
3122         * bindings/c/c_instance.cpp:
3123         (CInstance::invokeMethod):
3124         * bindings/c/c_utility.cpp:
3125         (coerceValueToNPString):
3126         (convertValueToNPValueType):
3127         (convertNPValueTypeToValue):
3128         * bindings/c/c_utility.h:
3129         * bindings/test.js:
3130         * bindings/testC.js: Added.
3131         * bindings/testbindings.cpp:
3132         (logMessage):
3133         (setDoubleValue):
3134         (setIntValue):
3135         (setStringValue):
3136         (setBooleanValue):
3137         (getDoubleValue):
3138         (getIntValue):
3139         (getStringValue):
3140         (getBooleanValue):
3141         (myInterfaceInvoke):
3142         (myInterfaceAllocate):
3143
3144 === Safari-133 ===
3145
3146 2004-03-19  Darin Adler  <darin@apple.com>
3147
3148         Reviewed by Ken.
3149
3150         - fixed problem with methods like setUTCHour
3151
3152         * kjs/date_object.cpp: (DateProtoFuncImp::call): Fix conversion back to time_t to use the appropriate
3153         GMT vs. local time function based on the utc flag.
3154
3155 2004-03-17  Richard Williamson   <rjw@apple.com>
3156
3157         Added a context parameter to result callbacks use by JavaScriptObject functions.  This was a change requested by Eric Carlson on the QT plugin team.
3158
3159         Reviewed by Ken.
3160
3161         * bindings/NP_jsobject.cpp:
3162         (NP_Call):
3163         (NP_Evaluate):
3164         (NP_GetProperty):
3165         (NP_ToString):
3166         (NP_GetPropertyAtIndex):
3167         * bindings/NP_runtime.h:
3168
3169 2004-03-16  Richard Williamson   <rjw@apple.com>
3170
3171         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.
3172
3173         Reviewed by John.
3174
3175         * bindings/jni/jni_class.cpp:
3176         (JavaClass::methodsNamed):
3177
3178 2004-03-15  Richard Williamson   <rjw@apple.com>
3179
3180         Fixed 3570854.  Don't attempt to convert Null to strings.  We
3181         were incorrectly converting to "Null".
3182
3183         Actually fixed by Scott Kovatch.
3184
3185         Reviewed by Richard.
3186
3187         * bindings/jni/jni_utility.cpp:
3188         (KJS::Bindings::convertValueToJValue):
3189
3190 === Safari-132 ===
3191
3192 2004-03-11  Richard Williamson   <rjw@apple.com>
3193
3194         Stitched together the NP stuff to our language independent
3195         JavaScript binding stuff.  Very close to being done.
3196         
3197         Added program to test C bindings (and NP stuff).  Just tests
3198         properties.  Will add methods and JavaScript access, etc.
3199
3200         Updated Makefile.am to account for new bindings/c directory.
3201
3202         Change NP_UTF8 from "const char *" to "char" to allow for
3203         declarations like "const NP_UTF8 *" and "NP_UTF8 *".  Ditto
3204         for NP_UTF16.
3205
3206         Added NP_IsValidIdentifier().
3207
3208         Reviewed by Chris.
3209
3210         * JavaScriptCore.pbproj/project.pbxproj:
3211         * Makefile.am:
3212         * bindings/NP_jsobject.cpp:
3213         (identiferFromNPIdentifier):
3214         (NP_Evaluate):
3215         * bindings/NP_runtime.cpp:
3216         (NP_IdentifierFromUTF8):
3217         (NP_IsValidIdentifier):
3218         (NP_GetIdentifiers):
3219         (NP_UTF8FromIdentifier):
3220         (NP_SetExceptionWithUTF8):
3221         (NP_SetException):
3222         (NP_CreateStringWithUTF8):
3223         (NP_CreateStringWithUTF16):
3224         (NP_UTF8FromString):
3225         (NP_UTF16FromString):
3226         * bindings/NP_runtime.h:
3227         * bindings/c/c_class.cpp: Added.
3228         (CClass::_commonDelete):
3229         (CClass::_commonCopy):
3230         (CClass::_commonInit):
3231         (_createClassesByIsAIfNecessary):
3232         (CClass::classForIsA):
3233         (CClass::CClass):
3234         (CClass::name):
3235         (CClass::methodsNamed):
3236         (CClass::fieldNamed):
3237         * bindings/c/c_class.h: Added.
3238         (KJS::Bindings::CClass::~CClass):
3239         (KJS::Bindings::CClass::CClass):
3240         (KJS::Bindings::CClass::operator=):
3241         (KJS::Bindings::CClass::constructorAt):
3242         (KJS::Bindings::CClass::numConstructors):
3243         * bindings/c/c_instance.cpp: Added.
3244         (CInstance::CInstance):
3245         (CInstance::~CInstance):
3246         (CInstance::operator=):
3247         (CInstance::getClass):
3248         (CInstance::begin):
3249         (CInstance::end):
3250         (CInstance::invokeMethod):
3251         (CInstance::defaultValue):
3252         (CInstance::stringValue):
3253         (CInstance::numberValue):
3254         (CInstance::booleanValue):
3255         (CInstance::valueOf):
3256         * bindings/c/c_instance.h: Added.
3257         (KJS::Bindings::CInstance::getObject):
3258         * bindings/c/c_runtime.cpp: Added.
3259         (CField::valueFromInstance):
3260         (CField::setValueToInstance):
3261         * bindings/c/c_runtime.h: Added.
3262         (KJS::Bindings::CField::CField):
3263         (KJS::Bindings::CField::name):
3264         (KJS::Bindings::CField::type):
3265         (KJS::Bindings::CMethod::CMethod):
3266         (KJS::Bindings::CMethod::name):
3267         (KJS::Bindings::CMethod::numParameters):
3268         * bindings/c/c_utility.cpp: Added.
3269         (coerceValueToNPValueType):
3270         (convertValueToNPValueType):
3271         (convertNPValueTypeToValue):
3272         * bindings/c/c_utility.h: Added.
3273         * bindings/make_testbindings:
3274         * bindings/runtime.cpp:
3275         (Instance::createBindingForLanguageInstance):
3276         * bindings/runtime.h:
3277         (KJS::Bindings::Instance::):
3278         * bindings/testbindings.cpp: Added.
3279         (initializeIdentifiers):
3280         (myInterfaceHasProperty):
3281         (myInterfaceHasMethod):
3282         (myInterfaceGetProperty):
3283         (myInterfaceSetProperty):
3284         (myInterfaceInvoke):
3285         (myInterfaceAllocate):
3286         (myInterfaceInvalidate):
3287         (myInterfaceDeallocate):
3288         (GlobalImp::className):
3289         (readJavaScriptFromFile):
3290         (main):
3291
3292 2004-03-10  Richard Williamson   <rjw@apple.com>
3293
3294         Made changes to support new asychronous approach to calls from
3295         plugin to JavaScript
3296
3297         Reviewed by Chris.
3298
3299         * bindings/NP_jsobject.cpp:
3300         (NP_Call):
3301         (NP_Evaluate):
3302         (NP_GetProperty):
3303         (NP_ToString):
3304         (NP_GetPropertyAtIndex):
3305         * bindings/NP_runtime.h:
3306         * bindings/make_testbindings:
3307         * bindings/runtime.cpp:
3308         (Instance::createBindingForLanguageInstance):
3309
3310 2004-03-10  Richard Williamson   <rjw@apple.com>
3311
3312         Updated header to include proposed changes from
3313         plugin-futures list.  Calls from plugin to JavaScript
3314         are now asynchronous.
3315
3316         Reviewed by Chris.
3317
3318         * bindings/NP_runtime.h:
3319
3320 === Safari-131 ===
3321
3322 2004-03-04  Richard Williamson   <rjw@apple.com>
3323
3324         Implementation of NP_JavaScriptObject.  This is the 'C' class
3325         that wraps a JavaScript object.
3326
3327         Reviewed by Chris.
3328
3329         * JavaScriptCore.pbproj/project.pbxproj:
3330         * bindings/NP_jsobject.cpp: Added.
3331         (coerceValueToNPValueType):
3332         (convertValueToNPValueType):
3333         (convertNPValueTypeToValue):
3334         (listFromNPArray):
3335         (jsAllocate):
3336         (jsDeallocate):
3337         (identiferFromNPIdentifier):
3338         (NP_Call):
3339         (NP_Evaluate):
3340         (NP_GetProperty):
3341         (NP_SetProperty):
3342         (NP_RemoveProperty):
3343         (NP_ToString):
3344         (NP_GetPropertyAtIndex):
3345         (NP_SetPropertyAtIndex):
3346         * bindings/NP_runtime.cpp:
3347         (NP_ObjectAtIndex):
3348         * bindings/NP_runtime.h:
3349         * bindings/runtime_object.h:
3350
3351 2004-03-04  Richard Williamson   <rjw@apple.com>
3352
3353         Added NP_Array implementation.  
3354
3355         Changed NP_Boolean to just depend on two static instances, no
3356         space is required for values.
3357
3358         Reviewed by Chris.
3359
3360         * bindings/NP_runtime.cpp:
3361         (NP_CreateBoolean):
3362         (NP_BoolFromBoolean):
3363         (arrayAllocate):
3364         (arrayDeallocate):
3365         (NP_CreateArray):
3366         (NP_CreateArrayV):
3367         (NP_ObjectAtIndex):
3368         * bindings/NP_runtime.h:
3369
3370 2004-03-03  Darin Adler  <darin@apple.com>
3371
3372         Reviewed by Vicki.
3373
3374         * English.lproj/InfoPlist.strings: Removed. No need to localize the version and
3375         copyright string, and that's all that was in here.
3376         * JavaScriptCore.pbproj/project.pbxproj: Removed InfoPlist.strings from build.
3377
3378 2004-03-03  Richard Williamson   <rjw@apple.com>
3379
3380         More 'C' binding implementation.  Fleshed out all the
3381         'primitive' data types.
3382
3383         Reviewed by Chris.
3384
3385         * bindings/NP_runtime.cpp:
3386         (NP_ReleaseObject):
3387         (numberAllocate):
3388         (stringAllocate):
3389         (stringDeallocate):
3390         (NP_CreateStringWithUTF8):
3391         (NP_CreateStringWithUTF16):
3392         (NP_UTF8FromString):
3393         (NP_UTF16FromString):
3394         (NP_StringLength):
3395         (booleanAllocate):
3396         (booleanDeallocate):
3397         (NP_CreateBoolean):
3398         (NP_BoolFromBoolean):
3399         (nullAllocate):
3400         (nullDeallocate):
3401         (NP_GetNull):
3402         (undefinedAllocate):
3403         (undefinedDeallocate):
3404         (NP_GetUndefined):
3405         * bindings/NP_runtime.h:
3406
3407 2004-03-03  Richard Williamson   <rjw@apple.com>
3408
3409         More 'C' binding implementation.
3410
3411         Reviewed by Chris.
3412
3413         * bindings/NP_runtime.cpp:
3414         (identifierEqual):
3415         (identifierHash):
3416         (getIdentifierDictionary):
3417         (NP_IdentifierFromUTF8):
3418         (NP_UTF8FromIdentifier):
3419         (NP_CreateObject):
3420         (NP_ReleaseObject):
3421         (NP_IsKindOfClass):
3422         (numberCreate):
3423         (NP_CreateNumberWithInt):
3424         (NP_CreateNumberWithFloat):
3425         (NP_CreateNumberWithDouble):
3426         (NP_IntFromNumber):
3427         (NP_FloatFromNumber):
3428         (NP_DoubleFromNumber):
3429         * bindings/NP_runtime.h:
3430
3431 2004-03-02  Richard Williamson   <rjw@apple.com>
3432
3433         Removed retain/release from NP_Class.  Classes will not be allowed to implement their
3434         own customer retain/release scheme.
3435
3436         Reviewed by Chris.
3437
3438         * bindings/NP_runtime.cpp:
3439         (NP_RetainObject):
3440         (NP_ReleaseObject):
3441         * bindings/NP_runtime.h:
3442
3443 2004-03-02  Richard Williamson   <rjw@apple.com>
3444
3445         C binding API.  Partial implementation.
3446
3447         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.
3448
3449         Factored root object reference counting scheme.  It is now useful independent
3450         of LiveConnect.
3451
3452         Reviewed by Chris.
3453
3454         * JavaScriptCore.pbproj/project.pbxproj:
3455         * bindings/NP_runtime.cpp: Added.
3456         (NP_IdentifierFromUTF8):
3457         (NP_GetIdentifiers):
3458         (NP_UTF8FromIdentifier):
3459         (NP_CreateObject):
3460         (NP_RetainObject):
3461         (NP_ReleaseObject):
3462         (NP_IsKindOfClass):
3463         (NP_SetException):
3464         (NP_Call):
3465         (NP_Evaluate):
3466         (NP_GetProperty):
3467         (NP_SetProperty):
3468         (NP_RemoveProperty):
3469         (NP_ToString):
3470         (NP_GetPropertyAtIndex):
3471         (NP_SetPropertyAtIndex):
3472         (NP_CreateNumberWithInt):
3473         (NP_CreateNumberWithFloat):
3474         (NP_CreateNumberWithDouble):
3475         (NP_IntFromNumber):
3476         (NP_FloatFromNumber):
3477         (NP_DoubleFromNumber):
3478         (NP_CreateStringWithUTF8):
3479         (NP_CreateStringWithUTF16):
3480         (NP_UTF8FromString):
3481         (NP_UTF16FromString):
3482         (NP_CreateBoolean):
3483         (NP_BoolFromBoolean):
3484         (NP_GetNull):
3485         (NP_GetUndefined):
3486         (NP_CreateArray):
3487         (NP_CreateArrayV):
3488         (NP_ObjectAtIndex):
3489         * bindings/NP_runtime.h: Added.
3490         * bindings/jni/jni_jsobject.cpp:
3491         (JSObject::invoke):
3492         (JSObject::finalize):
3493         (JSObject::createNative):
3494         (JSObject::convertValueToJObject):
3495         * bindings/jni/jni_jsobject.h:
3496         * bindings/objc/objc_jsobject.h:
3497         * bindings/objc/objc_jsobject.mm:
3498         (rootForView):
3499         (windowJavaScriptObject):
3500         (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
3501         (-[JavaScriptObject dealloc]):
3502         (-[JavaScriptObject _convertValueToObjcValue:KJS::]):
3503         (-[JavaScriptObject call:arguments:]):
3504         (-[JavaScriptObject evaluate:]):
3505         (-[JavaScriptObject getMember:]):
3506         (-[JavaScriptObject setMember:value:]):
3507         (-[JavaScriptObject removeMember:]):
3508         (-[JavaScriptObject toString]):
3509         (-[JavaScriptObject getSlot:]):
3510         (-[JavaScriptObject setSlot:value:]):
3511         * bindings/objc/objc_utility.h:
3512         * bindings/objc/objc_utility.mm:
3513         (KJS::Bindings::convertValueToObjcValue):
3514         * bindings/runtime_root.cpp: Added.
3515         (getReferencesByRootDictionary):
3516         (getReferencesDictionary):
3517         (KJS::Bindings::findReferenceDictionary):
3518         (KJS::Bindings::rootForImp):
3519         (KJS::Bindings::addNativeReference):
3520         (KJS::Bindings::removeNativeReference):
3521         (completedJavaScriptAccess):
3522         (initializeJavaScriptAccessLock):
3523         (lockJavaScriptAccess):
3524         (unlockJavaScriptAccess):
3525         (RootObject::dispatchToJavaScriptThread):
3526         (performJavaScriptAccess):
3527         (RootObject::setFindRootObjectForNativeHandleFunction):
3528         (RootObject::removeAllNativeReferences):
3529         * bindings/runtime_root.h: Added.
3530         (KJS::Bindings::RootObject::RootObject):
3531         (KJS::Bindings::RootObject::~RootObject):
3532         (KJS::Bindings::RootObject::setRootObjectImp):
3533         (KJS::Bindings::RootObject::rootObjectImp):
3534         (KJS::Bindings::RootObject::setInterpreter):
3535         (KJS::Bindings::RootObject::interpreter):
3536         (KJS::Bindings::RootObject::findRootObjectForNativeHandleFunction):
3537         (KJS::Bindings::RootObject::runLoop):
3538         (KJS::Bindings::RootObject::performJavaScriptSource):
3539
3540 === Safari-130 ===
3541
3542 === Safari-129 ===
3543
3544 2004-02-18  Richard Williamson   <rjw@apple.com>
3545
3546         Added NSNumber/Number conversion.
3547
3548         Removed some unnecessary KJS:: namespace specifiers.
3549
3550         Reviewed by Ken.
3551
3552         * bindings/objc/objc_utility.mm:
3553         (KJS::Bindings::convertValueToObjcValue):
3554         (KJS::Bindings::convertObjcValueToValue):
3555         * bindings/runtime_array.h:
3556
3557 2004-02-18  Richard Williamson   <rjw@apple.com>