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