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