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