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