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