1 2005-05-03 Richard Williamson <rjw@apple.com>
3 Fixed <rdar://problem/4102644> Crash in LiveConnect below KJS::Bindings::JavaInstance::stringValue() const
5 Correctly handle accessing nil objects from a Java object array.
9 * bindings/jni/jni_runtime.cpp:
12 2005-05-01 Darin Adler <darin@apple.com>
14 - move to Xcode native targets and stop checking in generated files
16 * JavaScriptCore.pbproj/project.pbxproj: Updated to use native targets and generate all the generated
17 files, so we don't have to check them in any more.
18 * Info.plist: Added. Native targets use a separate file for this.
20 * Makefile.am: Removed pcre and kjs SUBDIRS. Also removed code that deleted the embedded copy of this
21 framework, since we haven't been embedding it for some time.
23 * kjs/grammar_wrapper.cpp: Added. Shell used to compile grammar.cpp since we can't add a generated file
24 easily to the list of files to be compiled.
26 * kjs/.cvsignore: Removed.
27 * kjs/Makefile.am: Removed.
28 * kjs/array_object.lut.h: Removed.
29 * kjs/date_object.lut.h: Removed.
30 * kjs/grammar.cpp: Removed.
31 * kjs/grammar.cpp.h: Removed.
32 * kjs/grammar.h: Removed.
33 * kjs/lexer.lut.h: Removed.
34 * kjs/math_object.lut.h: Removed.
35 * kjs/number_object.lut.h: Removed.
36 * kjs/string_object.lut.h: Removed.
37 * pcre/.cvsignore: Removed.
38 * pcre/Makefile.am: Removed.
39 * pcre/chartables.c: Removed.
41 2005-04-28 Darin Adler <darin@apple.com>
43 Reviewed by Dave Harrison.
45 - fixed problems preventing us from compiling with gcc 4.0
47 * JavaScriptCore.pbproj/project.pbxproj: Removed -Wmissing-prototypes from
48 WARNING_CPLUSPLUSFLAGS since it's now a C-only warning.
50 * bindings/jni/jni_jsobject.cpp:
51 (JSObject::getSlot): Changed some %d to %ld where the parameters where long ints.
52 (JSObject::setSlot): Ditto.
53 * bindings/jni/jni_utility.cpp:
54 (KJS::Bindings::getJavaVM): Ditto.
55 (KJS::Bindings::getJNIEnv): Ditto.
56 * bindings/objc/objc_utility.mm: Fixed include of <JavascriptCore/internal.h> that needed the
57 letter "S" capitalized.
58 * kjs/bool_object.cpp: (BooleanProtoFuncImp::call): Rearranged how this function returns to
59 avoid incorrect gcc 4.0 warning.
60 * kjs/collector.cpp: (KJS::Collector::markStackObjectsConservatively): Changed code to check
61 the alignment of the passed-in pointers to only require pointer-level alignment, not 8-byte alignment.
62 Prevents a crash on garbage collect when compiled with gcc 4.0.
64 (WhileNode::execute): Added a redundant return after an infinite loop to work around incorrect gcc 4.0 warning.
65 (ForNode::execute): Ditto.
66 (SwitchNode::execute):Rearranged how this function returns to avoid incorrect gcc 4.0 warning.
67 (LabelNode::execute): Ditto.
68 * kjs/string_object.cpp: (replace): Ditto.
70 2005-04-26 Richard Williamson <rjw@apple.com>
72 Fixed <rdar://problem/4098713> Scripting API is incompatible with Mozilla
74 We were incompatible with Mozilla's implementation of the scripting APIs in
77 Their NPN_SetException has the following signature:
79 void NPN_SetException(NPObject *npobj, const NPUTF8 *message);
83 void NPN_SetException (NPObject * npobj, const NPString *message);
85 Also, they expect the string returned from NPN_UTF8FromIdentifier() to be freed by caller.
88 I changed both behaviors to match Mozilla.
92 * bindings/NP_jsobject.cpp:
94 * bindings/npruntime.cpp:
95 (_NPN_UTF8FromIdentifier):
96 (_NPN_IntFromIdentifier):
97 (_NPN_SetExceptionWithUTF8):
98 * bindings/npruntime.h:
99 * bindings/npruntime_impl.h:
101 2005-04-26 Maciej Stachowiak <mjs@apple.com>
105 <rdar://problem/4092136> reproducible crash in KJS::kjs_fast_realloc loading maps.google.com
107 * kjs/string_object.cpp:
108 (StringObjectFuncImp::call): Allocate adopted ustring buffer properly.
110 2005-04-22 Darin Adler <darin@apple.com>
114 * kjs/ustring.cpp: (KJS::UString::UTF8String): Fix off-by-one error in surrogate pair logic.
116 2005-04-22 Darin Adler <darin@apple.com>
120 - fixed <rdar://problem/4090046> JavaScript throw statement causes parse error when no semicolon is present
122 * kjs/grammar.y: Added an additional rule for throw like the ones we have for all the other semicolon rules.
123 Not sure why we missed this one earlier.
125 * kjs/grammar.cpp: Regenerated.
127 === JavaScriptCore-412.1 ===
129 2005-04-20 Darin Adler <darin@apple.com>
133 - speedups, total 12% on JavaScript iBench
135 I ran the benchmark under Shark and followed its advice a lot, mainly.
138 (KJS::Collector::allocate): Take out special case for 0; costing speed but unexercised.
139 Use numLiveObjectsAtLastCollect instead of numAllocationsSinceLastCollect so we don't
140 have to bump it each time we call allocate. Put numLiveObjects into a local variable to
141 cut down on global variable accesses. Make "next" cell pointer be a byte offset rather
142 than a pointer so we don't need a special case for NULL. Allow freeList to point to some
143 bogus item when the entire block is full rather than going out of our way to make it
145 (KJS::Collector::markProtectedObjects): Get table size and pointer into locals outside
146 the loop to avoid re-loading them over and over again.
147 (KJS::Collector::collect): Put numLiveObjects into a local variable to cut down on global
148 variable accesses. Make "next" cell pointer be a byte offset as above. Put numLiveObjects
149 into a local variable to cut down on global variable accesses. Set numLiveObjectsAtLastCollect
150 rather than numAllocationsSinceLastCollect.
151 (KJS::Collector::numReferencedObjects): Get table size and pointer into locals outside
152 the loop to avoid re-loading them over and over again.
153 (KJS::Collector::rootObjectClasses): Ditto.
155 * kjs/internal.h: Make Value be a friend of NumberImp so it can construct number objects
156 directly, avoiding the conversion from Number to Value.
158 * kjs/internal.cpp: (StringImp::toObject): Don't use Object::dynamicCast, because we know
159 the thing is an object and we don't want to do all the extra work; just cast directly.
161 * kjs/list.cpp: (KJS::List::List): Construct valueRefCount in a way that avoids the need for
162 a branch -- in the hot case this just meant avoiding checking a variable we just set to false.
164 * kjs/lookup.cpp: (keysMatch): Marked this inline.
166 * kjs/nodes.cpp: Disabled KJS_BREAKPOINT, to avoid calling hitStatement all the time.
167 (BooleanNode::evaluate): Make a Value directly, rather than making a Boolean which is converted
169 (NumberNode::evaluate): Ditto.
170 (StringNode::evaluate): Ditto.
171 (ArrayNode::evaluate): Ditto.
172 (FunctionCallNode::evaluate): Use new inline baseIfMutable to avoid unnecessary getBase function.
173 Also just use a pointer for func, rather than an Object.
174 (PostfixNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
175 passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
177 (DeleteNode::evaluate): Make a Value directly.
178 (TypeOfNode::evaluate): Use new inline baseIfMutable and make Value directly.
179 (PrefixNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
180 passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
182 (UnaryPlusNode::evaluate): Make a Value directly.
183 (NegateNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
184 passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
186 (BitwiseNotNode::evaluate): Make a Value directly.
187 (LogicalNotNode::evaluate): Ditto.
188 (ShiftNode::evaluate): Don't convert to a double before making a Value.
189 (RelationalNode::evaluate): Make a Value directly.
190 (EqualNode::evaluate): Ditto.
191 (BitOperNode::evaluate): Ditto.
192 (AssignNode::evaluate): Make a Value directly. Change code so that it passes a "known to be integer"
193 boolean in, often avoiding a conversion from floating point to integer and back.
194 (VarDeclNode::evaluate): Make a Value directly.
195 (ForNode::execute): Remove unused local variable.
198 (KJS::isNaN): Inlined.
200 (KJS::isPosInf): Ditto.
201 (KJS::isNegInf): Ditto.
203 * kjs/operations.cpp: Change isNaN, isInf, isPosInf, and isNegInf to be inlines.
204 (KJS::equal): Rewrite to avoid creating values and recursing back into the function.
205 (KJS::relation): Rearranged code so that we don't need explicit isNaN checks.
206 (KJS::add): Changed code to make Value directly, and so that it passes a "known to be integer"
207 boolean in, often avoiding a conversion from floating point to integer and back.
210 * kjs/property_map.cpp:
211 (KJS::PropertyMap::~PropertyMap): Get size and entries pointer outside loop to avoid
212 re-getting them inside the loop.
213 (KJS::PropertyMap::clear): Ditto. Clear value pointer in addition to key, so we can just
214 look at the value pointer in the mark function.
215 (KJS::PropertyMap::get): Get sizeMask and entries pointer outside loop to avoid
216 re-getting them inside the loop.
217 (KJS::PropertyMap::put): Ditto.
218 (KJS::PropertyMap::insert): Ditto.
219 (KJS::PropertyMap::remove): Ditto.
220 (KJS::PropertyMap::mark): Get size and entries pointer outside loop to avoid
221 re-getting them inside the loop. Don't bother checking key for 0, since we already have
222 to check value for 0. (Also had to change clear() to set value to 0.)
223 (KJS::PropertyMap::addEnumerablesToReferenceList): Get size and entries pointer outside
224 loop to avoid re-getting them inside the loop.
225 (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): Ditto.
226 (KJS::PropertyMap::save): Ditto.
230 * kjs/protected_values.h: Remove unneeded class name qualifiers.
233 (KJS::Reference::baseIfMutable): New inline function: replaces isMutable().
234 (KJS::Reference::Reference): Inlined.
236 (KJS::Reference::getValue): Rewrite to not use getBase.
237 (KJS::Reference::putValue): Ditto.
238 (KJS::Reference::deleteValue): Dittol
240 * kjs/simple_number.h:
241 (KJS::SimpleNumber::integerFits): Added. For use when the parameter is known to be integral.
243 * kjs/string_object.cpp: (StringProtoFuncImp::call): Create the number without first converting
244 to double in various cases that involve integers.
247 (KJS::UString::attach): Inlined.
248 (KJS::UString::release): Inlined.
250 (KJS::UString::find): Get first character outside the loop instead of re-fetching it each time.
253 (Value::Value): Added overloads for all the various specific types of values, so you don't have
254 to convert from, say, Number to Value, just to create one.
255 (Number::Number): Added an overload that takes a boolean to indicate the number is already
256 known to be an integer.
258 * kjs/value.h: Added more Value constructors, added a version of toNumber that returns
259 a boolean to indicate if the number is known to be an integer (because it was a "simple number").
260 (KJS::ValueImp::marked): Inlined.
261 (KJS::ValueImp::dispatchType): Inlined.
262 (KJS::ValueImp::dispatchToPrimitive): Inlined.
263 (KJS::ValueImp::dispatchToBoolean): Inlined.
264 (KJS::ValueImp::dispatchToNumber): Inlined.
265 (KJS::ValueImp::dispatchToString): Inlined.
266 (KJS::ValueImp::dispatchToUInt32): Inlined.
268 2005-04-14 Maciej Stachowiak <mjs@apple.com>
270 - make fast_malloc.h a private header, not project
272 * JavaScriptCore.pbproj/project.pbxproj:
274 2005-04-12 Maciej Stachowiak <mjs@apple.com>
278 <rdar://problem/4089734> JavaScript iBench can be sped up ~10% with custom allocator
280 - use custom single-threaded malloc for all non-GC JavaScriptCore
281 allocations, for a 9.1% speedup on JavaScript iBench
283 * JavaScriptCore.pbproj/project.pbxproj:
285 (KJS::Collector::allocate): Use dlmalloc to allocate the collector blocks.
286 (KJS::Collector::collect): And dlfree to free it.
287 * kjs/fast_malloc.cpp: Added, just the standard dlmalloc here.
288 * kjs/fast_malloc.h: Added. Declarations for the functions. Also added a handy
289 macro to give a class custom operator new/delete
290 * kjs/identifier.cpp:
291 (KJS::Identifier::add): Use dlmalloc/dlfree.
292 * kjs/nodes.h: make nodes KJS_FAST_ALLOCATED.
293 * kjs/property_map.cpp:
294 (KJS::PropertyMap::~PropertyMap): Use dlmalloc/dlfree.
295 (KJS::PropertyMap::rehash): ditto
298 (KJS::UString::Rep::createCopying): New named constructor that copies a passed-in
299 buffer, to hide allocation details from webcore.
300 (KJS::UString::UString): use createCopying when appropriate.
301 (KJS::UString::Rep::destroy): Use dlmalloc/dlfree.
302 (KJS::UString::expandedSize): likewise
303 (KJS::UString::expandCapacity): likewise
304 (KJS::UString::expandPreCapacity): likewise
305 (KJS::UString::spliceSubstringsWithSeparators): likewise
306 (KJS::UString::append): likewise
307 (KJS::UString::operator=): likewise
308 (KJS::UString::detach): likewise
309 * kjs/ustring.h: make UString and UString::Rep KJS_FAST_ALLOCATED.
311 2005-04-11 Maciej Stachowiak <mjs@apple.com>
315 <rdar://problem/4086819> Avoid using protect count hash table so much for 5.6% JS iBench speedup
317 - Avoid using protected values hash for the two most common cases
318 - Bump up ListImp high water mark, new testing shows 508 ListImps are
319 created during JS iBench.
321 Net result is a 5.6% speedup on JavaScript iBench
324 (KJS::Collector::collect): mark protected lists as appropriate.
327 (KJS::ListImp::markValues): Moved implementation from List::markValues
328 (KJS::List::markProtectedLists): Implemented - scan pool and overflow
330 (KJS::allocateListImp): link lists outside the pool into a separate
331 doubly linked list to be able to mark protected lists
332 (KJS::deallocateListImp): do the corresponding delinking
333 (KJS::List::derefValues): do nothing in conservative GC mode
334 (KJS::List::refValues): do nothing in conservative GC mode
335 (KJS::List::markValues): call ListImp version
351 2005-03-16 Jens Alfke <jens@apple.com>
355 Fix for <rdar://problem/4025212> "REGRESSION (163-164): search not performed correctly; united.com"
356 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.
357 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.)
358 Darin says this regression occurred when we replaced our own implementation of unescape() with code from KJS.
361 (KJS::GlobalFuncImp::call):
363 2005-03-15 Richard Williamson <rjw@apple.com>
365 Fixed <rdar://problem/4053276> WebScripting protocol in WebKit cannot convert Boolean in Javascript to BOOL in Objective-C
367 Added JavaScript boolean to type that can be converted to
368 ObjC scalar parameters.
370 Reviewed by Ken Kocienda.
372 * bindings/objc/objc_utility.mm:
373 (KJS::Bindings::convertValueToObjcValue):
389 2005-02-21 Darin Adler <darin@apple.com>
391 * kjs/date_object.cpp: (timetUsingCF): Fixed indenting.
393 2005-02-17 Richard Williamson <rjw@apple.com>
395 Fixed <rdar://problem/4003251> Safari crashed at www.icelandair.com in LiveConnect code converting a Java object to a string
399 Reviewed by John Sullivan.
401 * bindings/jni/jni_runtime.cpp:
402 (JavaField::valueFromInstance):
406 2005-02-11 Richard Williamson <rjw@apple.com>
408 Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls
410 Re-factored how 'native' wrappers for JS objects are created. The interpreter now
411 creates these wrappers. The WebCore subclass of the interpreter now overrides
412 createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects.
416 * bindings/c/c_utility.cpp:
417 (convertValueToNPVariant):
418 * bindings/jni/jni_instance.cpp:
419 (JavaInstance::invokeMethod):
420 * bindings/jni/jni_objc.mm:
421 (KJS::Bindings::dispatchJNICall):
422 * bindings/jni/jni_runtime.cpp:
423 (JavaField::valueFromInstance):
424 (JavaArray::valueAt):
425 * bindings/objc/WebScriptObject.mm:
426 (-[WebScriptObject _setExecutionContext:KJS::Bindings::]):
427 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
428 * bindings/objc/WebScriptObjectPrivate.h:
429 * bindings/objc/objc_utility.h:
430 * bindings/objc/objc_utility.mm:
431 (KJS::Bindings::convertObjcValueToValue):
432 (KJS::Bindings::createObjcInstanceForValue):
433 * bindings/runtime.cpp:
434 (Instance::createBindingForLanguageInstance):
435 (Instance::createRuntimeObject):
436 (Instance::createLanguageInstanceForValue):
437 * bindings/runtime.h:
438 * kjs/interpreter.cpp:
439 (Interpreter::createLanguageInstanceForValue):
444 2005-02-10 Darin Adler <darin@apple.com>
446 "Reviewed" by Richard (he told me the file was obsolete).
448 - got rid of an obsolete file
450 * bindings/npsap.h: Removed.
456 2005-02-03 Richard Williamson <rjw@apple.com>
458 Fixed <rdar://problem/3972905> CrashTracer: ...36 crashes at com.apple.WebCore: khtml::CSSStyleSelector::applyDeclarations + 120
460 Revert to old (and correct) behavior of returning runtime object
461 when passed as a parameter, rather than it's corresponding DOM
466 * bindings/objc/WebScriptObject.mm:
467 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
471 2005-01-28 Richard Williamson <rjw@apple.com>
473 Fixed <rdar://problem/3980389> JavaScript bindings access incorrect runtime object
475 Only use special 'back door' property to get the runtime object if thisObj isn't
476 already a runtime object.
478 <gratuitous> Cleaned up a couple of strcmp on ClassInfo name. Used == on
479 ClassInfo pointer instead.
483 * bindings/c/c_utility.cpp:
484 (convertValueToNPVariant):
485 * bindings/objc/WebScriptObject.mm:
486 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
487 * bindings/runtime_method.cpp:
488 (RuntimeMethodImp::call):
492 2005-01-26 Richard Williamson <rjw@apple.com>
494 Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test
496 I added a member variable to ObjectImp. This changed it's size and consequently
497 hampered the optimizations built into the garbage collector. Objects no longer
498 fit within the allocators cell size, and thus allocation fell back to a slower
501 As a result of this fix I also dramatically cleaned up how runtime objects are
502 accessed. The path mostly *removes* code.
506 * bindings/runtime_method.cpp:
507 (RuntimeMethodImp::call):
508 * bindings/runtime_object.cpp:
509 (RuntimeObjectImp::get):
510 (RuntimeObjectImp::put):
511 (RuntimeObjectImp::canPut):
512 (RuntimeObjectImp::hasProperty):
513 (RuntimeObjectImp::defaultValue):
514 * bindings/runtime_object.h:
516 (KJS::ObjectImp::ObjectImp):
519 2005-01-20 Darin Adler <darin@apple.com>
521 Reviewed by me, changes by Han Ming Ong.
523 - <rdar://problem/3964302> SWB: A few files need to be updated to be compilable under GCC 4.0
525 * bindings/objc/WebScriptObjectPrivate.h: Make members public.
526 * kjs/lookup.h: Change "value.h" to "object.h" because we need KJS::Object to compile a template.
528 2005-01-20 Richard Williamson <rjw@apple.com>
530 Fixed <rdar://problem/3964634> undefined property value from binding seems to evaluate to true in an if statement
532 The comprehensive fix for this problem requires new API, as described in 3965326. However,
533 given that we can't add new API at this point, the 'ObjcFallbackObjectImp' will behave
534 like and Undefined object if invokeUndefinedMethodFromWebScript:withArguments: isn't
535 implemented on the bound object.
539 * bindings/objc/objc_runtime.h:
540 * bindings/objc/objc_runtime.mm:
541 (ObjcFallbackObjectImp::type):
542 (ObjcFallbackObjectImp::implementsCall):
543 (ObjcFallbackObjectImp::toBoolean):
544 * bindings/testbindings.mm:
545 (+[MyFirstInterface isSelectorExcludedFromWebScript:]):
546 (+[MyFirstInterface isKeyExcludedFromWebScript:]):
550 2005-01-19 Richard Williamson <rjw@apple.com>
552 Fixed <rdar://problem/3853676> Browser Crash when accessing CCWeb Progress Page - KJS::Bindings::convertValueToJValue
554 Fixed the following problems with LiveConnect that are demonstrated by the application
555 described in 3853676.
557 1. If a nil object is passed in an array from Java to JavaScript we will crash.
558 2. We sometimes will incorrectly attempt to access a generic JavaScript as a Java runtime object wrapper.
559 3. We will sometimes fail to find the correct static method ID.
563 * bindings/jni/jni_jsobject.cpp:
564 (JSObject::convertJObjectToValue):
565 (JSObject::listFromJArray):
566 * bindings/jni/jni_runtime.cpp:
567 (JavaField::valueFromInstance):
568 (JavaField::setValueToInstance):
569 * bindings/jni/jni_utility.cpp:
570 (KJS::Bindings::getMethodID):
571 (KJS::Bindings::convertValueToJValue):
572 * bindings/runtime_array.h:
574 2005-01-18 Richard Williamson <rjw@apple.com>
576 Fixed several issues all arising from analysis of plugin detection code at ifilm.com:
578 Fixed <rdar://problem/3958592> can't script plug-ins if plug-in is invoked with <object> element instead of <embed>
579 Fixed <rdar://problem/3958597> <object> elements with IDs do not show up as named properties of the document
580 Fixed <rdar://problem/3960973> DOM objects for plugin elements are not accessible
581 Fixed <rdar://problem/3958601> need an additional class ID in WebCore for the Real plug-in
583 We now support accessing scriptable plugin objects that are specified with <applet>, <embed>, or <object>
584 tags. Also, if any of these elements are named they can be accessed from the document or window objects.
585 Finally, DOM methods are properties will be forwarded appropriately for the plugin's root scriptable object.
589 * bindings/objc/objc_instance.h:
590 * bindings/objc/objc_instance.mm:
591 (ObjcInstance::supportsSetValueOfUndefinedField):
592 * bindings/runtime.h:
593 (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
594 * bindings/runtime_object.cpp:
595 (RuntimeObjectImp::RuntimeObjectImp):
596 (RuntimeObjectImp::get):
597 (RuntimeObjectImp::put):
598 (RuntimeObjectImp::canPut):
599 (RuntimeObjectImp::hasProperty):
600 (RuntimeObjectImp::defaultValue):
601 * bindings/runtime_object.h:
602 (KJS::RuntimeObjectImp::fallbackObject):
604 (KJS::ObjectImp::ObjectImp):
606 (KJS::ObjectImp::forwardingScriptMessage):
607 (KJS::ObjectImp::setForwardingScriptMessage):
609 2005-01-18 Richard Williamson <rjw@apple.com>
611 Back out a change that was incorrectly committed yesterday.
615 * bindings/objc/objc_utility.mm:
616 (KJS::Bindings::convertValueToObjcValue):
618 2005-01-17 Richard Williamson <rjw@apple.com>
620 Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)
622 Keep track of originating execution context and target execution
623 context for native JS object wrappers, and perform appropriate
626 Reviewed by David Harrison.
628 * bindings/NP_jsobject.cpp:
630 (_NPN_CreateScriptObject):
635 (_NPN_RemoveProperty):
639 * bindings/NP_jsobject.h:
640 * bindings/c/c_instance.cpp:
641 (CInstance::CInstance):
642 (CInstance::stringValue):
643 * bindings/c/c_instance.h:
644 * bindings/c/c_utility.cpp:
645 (convertValueToNPVariant):
646 * bindings/jni/jni_instance.cpp:
647 (JavaInstance::JavaInstance):
648 (JavaInstance::valueOf):
649 * bindings/jni/jni_instance.h:
650 * bindings/objc/WebScriptObject.mm:
651 (-[WebScriptObject _initializeWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
652 (-[WebScriptObject _initWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
653 (-[WebScriptObject KJS::Bindings::]):
654 (-[WebScriptObject _setOriginExecutionContext:KJS::Bindings::]):
655 (-[WebScriptObject _isSafeScript]):
656 (-[WebScriptObject callWebScriptMethod:withArguments:]):
657 (-[WebScriptObject evaluateWebScript:]):
658 (-[WebScriptObject setValue:forKey:]):
659 (-[WebScriptObject valueForKey:]):
660 (-[WebScriptObject removeWebScriptKey:]):
661 (-[WebScriptObject stringRepresentation]):
662 (-[WebScriptObject webScriptValueAtIndex:]):
663 (-[WebScriptObject setWebScriptValueAtIndex:value:]):
664 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
665 * bindings/objc/WebScriptObjectPrivate.h:
666 * bindings/objc/objc_instance.h:
667 * bindings/objc/objc_runtime.mm:
668 (convertValueToObjcObject):
669 * bindings/objc/objc_utility.mm:
670 (KJS::Bindings::convertValueToObjcValue):
671 * bindings/runtime.cpp:
672 (Instance::Instance):
673 (Instance::operator=):
674 * bindings/runtime.h:
675 (KJS::Bindings::Instance::Instance):
676 (KJS::Bindings::Instance::setExecutionContext):
677 (KJS::Bindings::Instance::executionContext):
678 * bindings/runtime_root.cpp:
679 (RootObject::setInterpreter):
680 * bindings/runtime_root.h:
682 (KJS::Interpreter::isGlobalObject):
683 (KJS::Interpreter::interpreterForGlobalObject):
684 (KJS::Interpreter::isSafeScript):
688 2005-01-13 Vicki Murley <vicki@apple.com>
692 - fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005
694 * JavaScriptCore.pbproj/project.pbxproj: bump "2004" to "2005"
696 2005-01-12 Richard Williamson <rjw@apple.com>
698 Avoid additional work on dealloc by adding early out to
699 removeNativeReference(). (This will save time on dealloc
700 for all ObjC DOM objects.)
704 * bindings/runtime_root.cpp:
705 (KJS::Bindings::removeNativeReference):
707 2005-01-12 Richard Williamson <rjw@apple.com>
709 Fixed <rdar://problem/3923356> REGRESSION: Java/JavaScript security checks working incorrectly
711 We were always returning the first "root" object for all runtime
712 objects. Changed 0 in loop to i, the index.
714 Reviewed by David Harrison.
716 * bindings/runtime_root.cpp:
717 (KJS::Bindings::rootForImp):
719 2005-01-11 Richard Williamson <rjw@apple.com>
721 Fixed <rdar://problem/3887930> Must use new Java plug-in API to get/set fields so exception handling works (fixes many LiveConnect crashes)
723 Use the new dispatching API to invoke JNI, rather than calling JNI
726 Reviewed by David Harrison.
728 * bindings/jni/jni_instance.cpp:
729 (JavaInstance::invokeMethod):
730 * bindings/jni/jni_runtime.cpp:
731 (JavaField::dispatchValueFromInstance):
732 (JavaField::valueFromInstance):
733 (JavaField::dispatchSetValueToInstance):
734 (JavaField::setValueToInstance):
735 * bindings/jni/jni_runtime.h:
736 * bindings/jni/jni_utility.cpp:
737 (KJS::Bindings::convertValueToJValue):
745 2004-12-17 Maciej Stachowiak <mjs@apple.com>
749 <rdar://problem/3926869> Opening caches window after running PLT causes crash
751 * kjs/protected_values.cpp:
752 (KJS::ProtectedValues::getProtectCount): Don't include simple numbers in
753 the protected value table.
754 (KJS::ProtectedValues::increaseProtectCount): Ditto.
755 (KJS::ProtectedValues::decreaseProtectCount): Ditto.
757 2004-12-16 Darin Adler <darin@apple.com>
761 - fixed <rdar://problem/3920764> Unimplemented String methods toLocaleLowerCase and toLocaleUpperCase
763 * kjs/string_object.h: Added toLocaleLowerCase and toLocaleUpperCase.
764 * kjs/string_object.cpp: (StringProtoFuncImp::call): Made locale versions be synonmyms for the
765 non-locale-specific versions.
766 * kjs/string_object.lut.h: Regenerated.
768 2004-12-14 Richard Williamson <rjw@apple.com>
770 Pass URL of plugin view when call into JNI.
774 * bindings/jni/jni_objc.mm:
775 (KJS::Bindings::dispatchJNICall):
777 2004-12-13 Richard Williamson <rjw@apple.com>
779 Fixed <rdar://problem/3827799> repro. crash with IBM Rational ClearCase Web under Safari (Java/LiveConnect-related)
781 Add support for calling static Java methods from JavaScript.
785 * bindings/jni/jni_instance.cpp:
786 (JavaInstance::invokeMethod):
787 * bindings/jni/jni_runtime.cpp:
788 (JavaMethod::JavaMethod):
789 * bindings/jni/jni_runtime.h:
790 (KJS::Bindings::JavaMethod::isStatic):
791 * bindings/jni/jni_utility.cpp:
792 (callJNIStaticMethod):
793 (KJS::Bindings::callJNIBooleanMethod):
794 (KJS::Bindings::callJNIStaticBooleanMethod):
795 * bindings/jni/jni_utility.h:
797 2004-12-13 Richard Williamson <rjw@apple.com>
799 Fixed <rdar://problem/3887767> LiveConnect doesn't propagate Java exceptions back to JavaScript (prevents security suite from running)
803 * bindings/jni/jni_instance.cpp:
804 (JavaInstance::invokeMethod):
805 * bindings/jni/jni_objc.mm:
806 (KJS::Bindings::dispatchJNICall):
807 * bindings/jni/jni_runtime.h:
808 * bindings/jni/jni_utility.h:
812 2004-12-07 Maciej Stachowiak <mjs@apple.com>
816 <rdar://problem/3908017> REGRESSION (172-173): assertion in ObjectImp::construct trying to create JS error (24hourfitness.com)
818 The fix was to implement copy constructor and assignment operator,
819 the ones that worked on the base class did not replace the
823 (KJS::ProtectedValue::ProtectedValue):
824 (KJS::ProtectedValue::operator=):
825 (KJS::ProtectedObject::ProtectedObject):
826 (KJS::ProtectedObject::operator=):
828 Also fixed a bug in the GC test mode that compares the results of
829 the old collector and the new collector.
836 2004-11-23 Richard Williamson <rjw@apple.com>
838 Fixed <rdar://problem/3890385> field and method cache incorrectly capped (c bindings)
842 * bindings/c/c_class.cpp:
843 (CClass::_commonInit):
845 2004-11-21 Maciej Stachowiak <mjs@apple.com>
849 <rdar://problem/3889696> Enable conservative garbage collection for JavaScript
852 (KJS::Collector::Thread::Thread):
853 (KJS::destroyRegisteredThread):
854 (KJS::initializeRegisteredThreadKey):
855 (KJS::Collector::registerThread):
856 (KJS::Collector::markStackObjectsConservatively):
857 (KJS::Collector::markCurrentThreadConservatively):
858 (KJS::Collector::markOtherThreadConservatively):
866 2004-11-15 Richard Williamson <rjw@apple.com>
868 Fixed <rdar://problem/3880561> Default string value of ObjC object in JS should be [obj description].
872 * bindings/objc/objc_instance.mm:
873 (ObjcInstance::stringValue):
874 * bindings/objc/objc_utility.h:
875 * bindings/objc/objc_utility.mm:
876 (KJS::Bindings::convertNSStringToString):
877 (KJS::Bindings::convertObjcValueToValue):
881 2004-11-09 Chris Blumenberg <cblu@apple.com>
883 Fixed: <rdar://problem/3872724> soft link against JavaVM to save ~2MB RSHRD
888 * JavaScriptCore.pbproj/project.pbxproj: don't link against JavaVM
889 * bindings/softlinking.c: Added.
891 (getFunctionPointer): new
892 (JNI_GetCreatedJavaVMs): load JavaVM if not already loaded, get _JNI_GetCreatedJavaVMs symbol if we don't already have it, call JNI_GetCreatedJavaVMs
896 2004-11-04 Darin Adler <darin@apple.com>
900 - fixed <rdar://problem/3865365> since -[WebScriptObject dealloc] does not call [super dealloc], the build will fail due to a warning
901 - fixed behavior so that [[WebScriptObject alloc] initWithCoder:] doesn't leak WebUndefined instances
902 and incidentally so that [[WebScriptObject alloc] init] returns the single shared instance rather
903 than allocating a new one
905 * bindings/objc/WebScriptObject.mm: Removed some stray semicolons.
906 (+[WebUndefined allocWithZone:]): Made this the common bottleneck that returns the single instance
907 of WebUndefined, since it's the single method that normally allocates new instances. Calls super to
908 actually allocate only the very first time it's called.
909 (-[WebUndefined initWithCoder:]): Simplified to just return self (no reason to re-lookup the single
910 shared instance since there can be only one).
911 (-[WebUndefined copyWithZone:]): Ditto.
912 (-[WebUndefined retain]): Ditto.
913 (-[WebUndefined retainCount]): Use UINT_MAX constant here (matches usage in NSObject.m for retain count
915 (-[WebUndefined autorelease]): Simplified to just return self (see above).
916 (-[WebUndefined copy]): No need to override this since it just turns around and calls copyWithZone:.
917 (-[WebUndefined dealloc]): Added an assertion since this method should never be called. Also added
918 a call to [super dealloc] after return; to make the new -Wdealloc-check compiler happy (fixing the
919 bug mentioned above).
920 (+[WebUndefined undefined]): Reimplemented; calls allocWithZone:NULL to get to the shared instance.
921 No need to call init, since that's a no-op for this class.
923 2004-11-03 David Harrison <harrison@apple.com>
927 Eliminate the use of a marker file to determine how to build.
932 2004-11-01 Richard Williamson <rjw@apple.com>
934 Fixed <rdar://problem/3861469> Latest Real player crashes Safari on some sites.
938 * bindings/c/c_instance.cpp:
939 (CInstance::invokeMethod):
940 (CInstance::invokeDefaultMethod):
941 Initialize out parameters to void type.
943 * bindings/c/c_runtime.cpp:
944 (CField::valueFromInstance):
945 (CField::setValueToInstance):
946 Initialize out parameters to void type.
947 Also added additional checks to protect against classes that
948 don't implement all functions.
950 2004-11-01 Richard Williamson <rjw@apple.com>
952 Fixed <rdar://problem/3861257> WebUndefined should be returned for undefined values
957 * bindings/objc/WebScriptObject.mm:
958 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
959 Added additional conversion Undefined -> WebUndefined.
960 * bindings/objc/objc_utility.mm:
961 (KJS::Bindings::convertObjcValueToValue):
962 Added additional conversion WebUndefined -> Undefined.
964 2004-11-01 Darin Adler <darin@apple.com>
966 - fixed <rdar://problem/3855573> Remove reference to "WebScriptMethods" from WebScriptObject.h comments
968 * bindings/objc/WebScriptObject.h: Removed unneeded #ifdef protection for multiple includes (since
969 this is an Objective-C header and we use #import for those). Fixed comments as requested in the bug
970 report to match the contents of the file.
976 2004-10-22 Ken Kocienda <kocienda@apple.com>
980 * JavaScriptCore.pbproj/project.pbxproj:
981 Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
985 2004-10-13 Richard Williamson <rjw@apple.com>
987 Moved boolean checks prior to NSNumber checks. booleans are
990 Follow on to <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number.
994 * bindings/objc/objc_utility.mm:
995 (KJS::Bindings::convertObjcValueToValue):
997 2004-10-12 Richard Williamson <rjw@apple.com>
999 Fixed access to DOM object via WebScriptObject API.
1000 The execution context for DOM objects wasn't being found.
1001 <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
1005 * bindings/objc/WebScriptObject.mm:
1007 (-[WebScriptObject KJS::Bindings::]):
1008 (-[WebScriptObject callWebScriptMethod:withArguments:]):
1009 (-[WebScriptObject evaluateWebScript:]):
1010 (-[WebScriptObject setValue:forKey:]):
1011 (-[WebScriptObject valueForKey:]):
1012 (-[WebScriptObject stringRepresentation]):
1013 * bindings/objc/WebScriptObjectPrivate.h:
1015 2004-10-09 Darin Adler <darin@apple.com>
1019 - fixed <rdar://problem/3804661> REGRESSION: JavaScriptCore framework now has two init routines
1021 * bindings/NP_jsobject.cpp: Fixed unnecessarily-complex globals set up that was
1022 creating an init routine.
1024 * kjs/ustring.cpp: Changed around the UString::Rep::empty construction to not
1025 require a global constructor that creates an init routine.
1027 2004-10-09 Darin Adler <darin@apple.com>
1031 - fixed <rdar://problem/3822618> REGRESSION (164-165): expedia.com's popup help doesn't work
1033 * kjs/reference.cpp: (Reference::putValue): Change so that references not found in any object
1034 work with the window object of the page the function is in, not the page of the caller. This
1035 is what all other browsers do. This code was hidden before by the "everything is defined on
1036 window object" hack in WebCore.
1038 2004-10-07 Richard Williamson <rjw@apple.com>
1040 Added simple JavaScript call tracing. Very useful for
1041 debugging complex pages.
1043 Tracing is only available in development builds and is
1046 (gdb) set traceJavaScript = 1
1050 setTraceJavaScript(true)
1052 Function, args, and return values are printed to console. Very
1057 * kjs/function_object.cpp:
1058 (FunctionProtoFuncImp::call):
1060 (KJS::Object::call):
1064 2004-10-05 Richard Williamson <rjw@apple.com>
1066 Fixed <rdar://problem/3819234> NPN_SetException (and throwException:) isn't implemented
1070 * bindings/NP_jsobject.cpp:
1071 (_NPN_SetException):
1072 * bindings/npruntime.cpp:
1073 (_NPN_SetExceptionWithUTF8):
1074 * bindings/objc/WebScriptObject.mm:
1075 (+[WebScriptObject throwException:]):
1077 (KJS::InterpreterImp::context):
1079 2004-10-05 Richard Williamson <rjw@apple.com>
1081 Fixed <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number
1085 * bindings/objc/objc_utility.mm:
1086 (KJS::Bindings::convertObjcValueToValue):
1088 2004-10-04 Darin Adler <darin@apple.com>
1092 - rolled in a fix the KDE folks did for the operations that generate HTML fragments
1094 * kjs/string_object.cpp: (StringProtoFuncImp::call): Added quote marks to generated HTML.
1096 - rolled out an old workaround we don't need any more
1098 * JavaScriptCore.pbproj/project.pbxproj: Remove -Wno-long-double because the <math.h> issue that
1099 required it is no longer there.
1101 2004-09-30 Richard Williamson <rjw@apple.com>
1103 Fixed <rdar://problem/3821215> NPN hasMethod and hasProperty functions should take NPObjects, not NPClass
1107 * bindings/NP_jsobject.cpp:
1111 * bindings/c/c_class.cpp:
1112 (CClass::methodsNamed):
1113 (CClass::fieldNamed):
1114 * bindings/c/c_class.h:
1115 * bindings/c/c_instance.cpp:
1116 (CInstance::invokeMethod):
1117 * bindings/jni/jni_class.cpp:
1118 (JavaClass::methodsNamed):
1119 * bindings/jni/jni_class.h:
1120 * bindings/npruntime.h:
1121 * bindings/objc/objc_class.h:
1122 * bindings/objc/objc_class.mm:
1123 (ObjcClass::methodsNamed):
1124 * bindings/runtime.h:
1125 * bindings/runtime_object.cpp:
1126 (RuntimeObjectImp::get):
1127 (RuntimeObjectImp::hasProperty):
1129 2004-09-29 Chris Blumenberg <cblu@apple.com>
1131 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.
1135 * JavaScriptCore.pbproj/project.pbxproj:
1136 * bindings/NP_jsobject.cpp:
1137 (_NPN_CreateScriptObject):
1138 (_NPN_InvokeDefault):
1143 (_NPN_RemoveProperty):
1146 * bindings/c/c_class.cpp:
1147 (CClass::methodsNamed):
1148 (CClass::fieldNamed):
1149 * bindings/c/c_instance.cpp:
1150 (CInstance::CInstance):
1151 (CInstance::~CInstance):
1152 (CInstance::operator=):
1153 (CInstance::invokeMethod):
1154 (CInstance::invokeDefaultMethod):
1155 * bindings/c/c_runtime.cpp:
1156 * bindings/c/c_runtime.h:
1157 (KJS::Bindings::CField::name):
1158 (KJS::Bindings::CMethod::name):
1159 * bindings/npruntime.cpp:
1160 (_NPN_GetStringIdentifier):
1161 (_NPN_GetStringIdentifiers):
1162 (_NPN_GetIntIdentifier):
1163 (_NPN_IdentifierIsString):
1164 (_NPN_UTF8FromIdentifier):
1165 (_NPN_IntFromIdentifier):
1166 (NPN_InitializeVariantWithObject):
1167 (_NPN_ReleaseVariantValue):
1168 (_NPN_CreateObject):
1169 (_NPN_RetainObject):
1170 (_NPN_ReleaseObject):
1171 (_NPN_SetExceptionWithUTF8):
1172 (_NPN_SetException):
1174 2004-09-26 Darin Adler <darin@apple.com>
1176 * kjs/string_object.cpp: (StringProtoFuncImp::call): Remove strange use of high() and
1177 low() to get Unicode value of character, and just use unicode().
1179 2004-09-26 Darin Adler <darin@apple.com>
1181 - refine charAt/charCodeAt fix slightly
1183 * kjs/string_object.cpp: (StringProtoFuncImp::call): Treat undefined the same was as an
1184 omitted parameter, as we do everywhere else, and as other browsers do here.
1186 2004-09-26 Darin Adler <darin@apple.com>
1190 - fixed <rdar://problem/3816097> REGRESSION: mailblocks, and presumably many other pages, failing because variable not found
1192 * kjs/internal.cpp: (InterpreterImp::evaluate): Process variable declarations before executing
1193 the program. We were doing this properly for functions, but not entire programs.
1195 - fixed <rdar://problem/3814706> REGRESSION: text fields in mailblocks wizards do not accept keystrokes due to use of charCodeAt()
1197 * kjs/string_object.cpp: (StringProtoFuncImp::call): Changed the implementation of charAt
1198 and charCodeAt to treat a missing parameter as an index of 0, rather than an invalid index.
1200 * tests/mozilla/expected.html: Update for two tests that now pass with these changes.
1206 2004-09-14 Richard Williamson <rjw@apple.com>
1208 1. Add class parameter to object allocation function. This is somewhat redundant, given that
1209 the allocation function is in the class function vector, but people wanted to use the same
1210 allocation function for different classes.
1212 2. Renamed NPN_Class to NPN_Invoke to match the name in the function vector.
1214 3. Add support for a default function on an object. This is a feature that ActiveX supports,
1215 and will allow JavaScript code to be written that will look exactly the same for both ActiveX
1216 plugins and Netscape or WebKit plugins. There are implementations included for the 'C' and
1217 'Objective-C' bindings.
1219 There bugs are covered by
1221 <rdar://problem/3776343> Support for default functions in the JavaScript bindings
1222 <rdar://problem/3779186> NPN_Call needs to be renamed to NPN_Invoke
1223 <rdar://problem/3674754> Need to implement latest npruntime.h
1227 * bindings/NP_jsobject.cpp:
1229 (NPN_InvokeDefault):
1231 * bindings/c/c_class.cpp:
1232 * bindings/c/c_instance.cpp:
1233 (CInstance::CInstance):
1234 (CInstance::operator=):
1235 (CInstance::invokeMethod):
1236 (CInstance::invokeDefaultMethod):
1237 * bindings/c/c_instance.h:
1238 * bindings/c/c_runtime.cpp:
1239 * bindings/c/c_runtime.h:
1240 * bindings/jni/jni_instance.cpp:
1241 (JavaInstance::invokeDefaultMethod):
1242 * bindings/jni/jni_instance.h:
1243 * bindings/npruntime.cpp:
1245 * bindings/npruntime.h:
1246 * bindings/objc/WebScriptObject.h:
1247 * bindings/objc/objc_class.mm:
1248 (ObjcClass::fallbackObject):
1249 * bindings/objc/objc_instance.h:
1250 * bindings/objc/objc_instance.mm:
1251 (ObjcInstance::invokeDefaultMethod):
1252 * bindings/objc/objc_runtime.h:
1253 * bindings/objc/objc_runtime.mm:
1254 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
1255 (ObjcFallbackObjectImp::get):
1256 (ObjcFallbackObjectImp::put):
1257 (ObjcFallbackObjectImp::canPut):
1258 (ObjcFallbackObjectImp::implementsCall):
1259 (ObjcFallbackObjectImp::call):
1260 (ObjcFallbackObjectImp::hasProperty):
1261 (ObjcFallbackObjectImp::deleteProperty):
1262 (ObjcFallbackObjectImp::defaultValue):
1263 * bindings/runtime.h:
1264 (KJS::Bindings::Class::fallbackObject):
1265 (KJS::Bindings::Instance::getValueOfUndefinedField):
1266 (KJS::Bindings::Instance::setValueOfUndefinedField):
1267 (KJS::Bindings::Instance::valueOf):
1268 * bindings/runtime_object.cpp:
1269 (RuntimeObjectImp::implementsCall):
1270 (RuntimeObjectImp::call):
1271 * bindings/runtime_object.h:
1273 2004-09-13 Maciej Stachowiak <mjs@apple.com>
1277 <rdar://problem/3794735> Gmail- sending a very long message with Safari is so slow it seems like a hang
1279 * kjs/string_object.cpp:
1280 (StringProtoFuncImp::call): Replaced implementation of replace()
1281 method with function below...
1282 (replace): In order to avoid excessive allocation and copying,
1283 figure out the ranges of the original string and replacement
1284 strings to be assembled, instead of constantly creating new
1285 strings at each substitution. The old behavior is basically O(N^2)
1286 for a global replace on a pattern that matches many places in the
1288 (regExpIsGlobal): Helper function for the above.
1289 (expandSourceRanges): ditto
1290 (pushSourceRange): ditto
1291 (expandReplacements): ditto
1292 (pushReplacement): ditto
1294 (KJS::UString::spliceSubstringsWithSeparators): New method that
1295 pieces together substring ranges of this string together with
1296 specified separators, all at one go.
1298 (KJS::UString::Range::Range): Added new helper class to represent
1301 2004-09-14 Maciej Stachowiak <mjs@apple.com>
1305 - fixed <rdar://problem/3800315> encode-URI-test layout test is failing
1308 (KJS::GlobalFuncImp::call): Make sure to escape null
1309 characters. This is a bug in the new code that made part of the
1312 2004-09-13 Darin Adler <darin@apple.com>
1314 Reviewed by Kevin and Maciej.
1316 - new function to support fix for DIG bug in WebCore
1318 * kjs/scope_chain.h: Added new push function that pushes another entire scope chain.
1319 * kjs/scope_chain.cpp: (KJS::ScopeChain::push): Ditto.
1321 2004-09-12 Darin Adler <darin@apple.com>
1323 * tests/mozilla/expected.html: Updated test results for 3 more tests that pass with the new version
1324 of escape and unescape.
1326 2004-09-12 Darin Adler <darin@apple.com>
1330 - fixed <rdar://problem/3798209> any non-ASCII characters are garbled in the result of toLocaleString
1332 * kjs/date_object.cpp:
1333 (formatLocaleDate): Replaced two old functions that used LongDateTime with this one new function that
1334 uses CFDateFormatter.
1335 (DateProtoFuncImp::call): Call the new formatLocaleDate instead of both formatLocaleDate and formatLocaleTime.
1337 2004-09-09 Maciej Stachowiak <mjs@apple.com>
1339 Reviewed by Richard.
1341 <rdar://problem/3493140> REGRESSION (85-100): cedille displays %-escaped in JavaScript message at hotmail.com
1344 (KJS::GlobalFuncImp::call): Replace our escape() and unescape() implementations with
1345 ones from KDE KJS, which have the proper latin-1 behavior to match Win IE.
1347 (Lexer::isHexDigit): Made static and non-const.
1352 2004-09-06 Darin Adler <darin@apple.com>
1354 * JavaScriptCore.pbproj/project.pbxproj: Bump MACOSX_DEPLOYMENT_TARGET to 10.3.
1358 2004-09-01 Richard Williamson <rjw@apple.com>
1360 Add pid to exception messages (to help debug dashboard clients).
1364 * kjs/interpreter.cpp:
1365 (Interpreter::evaluate):
1369 2004-08-20 Richard Williamson <rjw@apple.com>
1371 Implemented new JNI abstraction. We no longer invoke Java methods
1372 directly with JNI, rather we call into the plugin. This allows the
1373 plugin to dispatch the call to the appropriate VM thread. This
1374 change should (will?) fix a whole class of threading related problems with
1379 * JavaScriptCore.pbproj/project.pbxproj:
1380 * bindings/c/c_instance.h:
1381 (KJS::Bindings::CInstance::setExecutionContext):
1382 (KJS::Bindings::CInstance::executionContext):
1383 * bindings/jni/jni_instance.cpp:
1384 (JavaInstance::JavaInstance):
1385 (JavaInstance::invokeMethod):
1386 (JavaInstance::setExecutionContext):
1387 (JavaInstance::executionContext):
1388 * bindings/jni/jni_instance.h:
1389 * bindings/jni/jni_jsobject.cpp:
1390 (JSObject::convertJObjectToValue):
1391 * bindings/jni/jni_runtime.cpp:
1392 (JavaField::JavaField):
1393 (JavaArray::convertJObjectToArray):
1394 (JavaField::valueFromInstance):
1395 (JavaArray::JavaArray):
1396 (JavaArray::valueAt):
1397 * bindings/jni/jni_runtime.h:
1398 (KJS::Bindings::JavaArray::operator=):
1399 (KJS::Bindings::JavaArray::executionContext):
1400 * bindings/jni/jni_utility.h:
1401 * bindings/objc/objc_instance.h:
1402 (KJS::Bindings::ObjcInstance::setExecutionContext):
1403 (KJS::Bindings::ObjcInstance::executionContext):
1404 * bindings/runtime.cpp:
1405 (Instance::createBindingForLanguageInstance):
1406 * bindings/runtime.h:
1407 * bindings/runtime_root.h:
1408 (KJS::Bindings::RootObject::nativeHandle):
1412 2004-08-19 Vicki Murley <vicki@apple.com>
1416 * kjs/property_map.cpp:
1417 (KJS::PropertyMap::put): initialize deletedElementIndex to zero, to make the compiler happy
1419 2004-08-17 Darin Adler <darin@apple.com>
1423 - fixed <rdar://problem/3746676> SAP WebDynpro app hangs inside JavaScript property map hash table code (deleted sentinel problem)
1425 * kjs/property_map.h: Added some private functions.
1426 * kjs/property_map.cpp:
1427 (KJS::PropertyMap::clear): Set sentinelCount to 0.
1428 (KJS::PropertyMap::put): Complete search for the element before choosing to use the deleted-element sentinel.
1429 Also keep sentinel count up to date when we destroy a sentinel by overwriting with a new added element.
1430 (KJS::PropertyMap::expand): Added. Calls rehash with a size 2x the old size, or 16.
1431 (KJS::PropertyMap::rehash): Added. Refactored the rehash code into a separate function.
1432 (KJS::PropertyMap::remove): Add one to sentinelCount, and rehash if 1/4 or more of the elements are
1433 deleted-element sentinels.
1434 (KJS::PropertyMap::checkConsistency): Check the sentinelCount.
1436 2004-08-16 Maciej Stachowiak <mjs@apple.com>
1438 Code change by Eric Albert, reviewd by me.
1440 <rdar://problem/3571960> washingtonpost.com claims I don't have cookies enabled and won't let me read articles
1442 * kjs/date_object.cpp:
1443 (timetUsingCF): Clamp time to LONG_MAX (getting rid of time_t
1444 entirely would be even better, but is not required to fix this bug.
1448 2004-08-16 Richard Williamson <rjw@apple.com>
1450 Fixed <rdar://problem/3581092> cash in KJS::Bindings::JSObject::eval at tcvetantcvetkov.com
1452 Adds bullet proofing to protect against evaluation of bogus JS in all the flavors of bindings (Java, C, and ObjC).
1456 * bindings/NP_jsobject.cpp:
1458 * bindings/jni/jni_jsobject.cpp:
1460 * bindings/objc/WebScriptObject.mm:
1461 (-[WebScriptObject evaluateWebScript:]):
1463 2004-08-15 Richard Williamson <rjw@apple.com>
1465 More updates to np headers. Implemented new NPN functions.
1469 * bindings/NP_jsobject.cpp:
1473 * bindings/npruntime.h:
1475 2004-08-13 Darin Adler <darin@apple.com>
1477 - fix build so we can compile again
1479 * bindings/npapi.h: Added. Richard forgot to check this in. The one I'm checking in here
1480 is good enough so that we can compile, but it's only a stopgap measure, because I think
1481 Richard has a newer one he wants to check in.
1483 2004-08-12 Richard Williamson <rjw@apple.com>
1485 Bring npruntime.h and friends closer to compliance with
1490 * JavaScriptCore.pbproj/project.pbxproj:
1491 * bindings/NP_jsobject.cpp:
1493 (_NPN_CreateScriptObject):
1498 (NPN_RemoveProperty):
1499 * bindings/NP_jsobject.h:
1500 * bindings/c/c_instance.cpp:
1501 (CInstance::invokeMethod):
1502 * bindings/c/c_utility.cpp:
1503 (convertNPVariantToValue):
1504 * bindings/npruntime.cpp:
1505 (NPN_IdentifierIsString):
1506 (NPN_VariantIsVoid):
1507 (NPN_VariantIsNull):
1508 (NPN_VariantIsUndefined):
1509 (NPN_VariantIsBool):
1510 (NPN_VariantIsInt32):
1511 (NPN_VariantIsDouble):
1512 (NPN_VariantIsString):
1513 (NPN_VariantIsObject):
1514 (NPN_VariantToBool):
1515 (NPN_VariantToString):
1516 (NPN_VariantToInt32):
1517 (NPN_VariantToDouble):
1518 (NPN_VariantToObject):
1519 (NPN_InitializeVariantAsVoid):
1520 (NPN_InitializeVariantAsNull):
1521 (NPN_InitializeVariantAsUndefined):
1522 (NPN_InitializeVariantWithBool):
1523 (NPN_InitializeVariantWithInt32):
1524 (NPN_InitializeVariantWithDouble):
1525 (NPN_InitializeVariantWithString):
1526 (NPN_InitializeVariantWithStringCopy):
1527 (NPN_InitializeVariantWithObject):
1528 (NPN_InitializeVariantWithVariant):
1529 (NPN_ReleaseVariantValue):
1531 * bindings/npruntime.h:
1533 (_NPString::_NPVariant::):
1534 * bindings/npruntime_priv.h: Added.
1536 2004-08-12 Darin Adler <darin@apple.com>
1540 - fixed 3 problems with parse functions that I just wrote, fixing 3 more Mozilla JavaScript tests
1543 (KJS::parseDigit): Fix typo, 'Z' instead of 'z', that prevented lowercase hex digits from working.
1544 (KJS::parseInt): Add octal support. Specification says it's optional, but I guess not.
1545 (KJS::parseFloat): Fix check for "0x" in parseFloat to return 0 rather than NaN. Also add code
1546 to skip leading "+" or "-".
1550 2004-08-12 Darin Adler <darin@apple.com>
1554 - fixed 43 Mozilla JavaScript tests
1556 * kjs/date_object.h: Change parseDate and timeClip to take and return doubles.
1557 * kjs/date_object.cpp:
1558 (DateObjectImp::construct): Change to use a timeClip function that takes and returns a double rather
1559 than constructing a number object to pass to it.
1560 (DateObjectFuncImp::call): Change to use a parseDate function that returns a double.
1561 (KJS::parseDate): Change to return a double instead of creating the Number object here.
1562 (KJS::timeClip): Implement this as specified in the language standard.
1564 * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set the DontDelete, ReadOnly, and DontEnum
1565 flags on the prototype property.
1568 (KJS::FunctionImp::get): Return null rather than undefined for arguments when the function is not
1570 (KJS::isStrWhiteSpace): Added. Matches specification for StrWhiteSpace. Could move it to some utility
1572 (KJS::parseDigit): Added. Helper function for parseInt.
1573 (KJS::parseInt): Added. Integer parser that puts result in a double so we're not limited to what
1574 strtoll can handle. Also matches standard more closely.
1575 (KJS::parseFloat): Added. Handles "0x" properly and passes flag to make empty string turn into NaN
1577 (KJS::GlobalFuncImp::call): Use the new parseInt and parseFloat.
1579 * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Add a length property.
1581 * kjs/lexer.h: Added error flag and sawError() function for detecting errors.
1583 (Lexer::setCode): Clear error state.
1584 (Lexer::lex): Set error state if the lexer encounters an error
1587 (NumberImp::toString): Roll in change from KDE version to special case 0 so we handle -0 correctly.
1588 (Parser::parse): Use new lexer error method so those errors are treated like parser errors.
1590 * kjs/math_object.cpp: (MathFuncImp::call): Change min and max to treat -0 as less than +0.
1591 Change round to round values between -0.5 and -0 to -0 instead of +0.
1593 * kjs/nodes.h: Add evaluateReference function to GroupNode.
1594 * kjs/nodes.cpp: (GroupNode::evaluateReference): Pass references through groups (parenthesized
1595 expressions) properly so that expressions like "delete (x.y)" work. Before, the parentheses
1596 would change x.y into a value that can't be deleted as a side effect.
1598 * kjs/string_object.cpp: Change parameter count for indexOf and lastIndexOf from 2 to 1 to match
1601 * kjs/testkjs.cpp: Rolled in changes from KDE to add a "quit" function to the test tool and
1602 get rid of the fixed size limit for code.
1604 * kjs/ustring.cpp: (KJS::UString::substr): Added optimized case for substr(0, length) so it just
1605 returns the string without creating a new Rep, since I'm using substr in a place where it will
1606 often be passed a 0.
1608 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed one wrong entry in the Unicode table I added to
1609 the other day that was making a couple tests fail.
1610 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
1611 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
1612 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
1613 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
1614 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
1616 * kjs/string_object.lut.h: Regenerated.
1618 2004-08-11 Darin Adler <darin@apple.com>
1620 - fixed a tiny problem with the UTF-16 PCRE check-in
1622 * pcre/maketables.c: (pcre_maketables): Fix mistake in table-generating code that sometimes caused
1623 the ctype_meta flag to get set in items that should not have it.
1625 * pcre/chartables.c: Regenerated.
1627 2004-08-10 Richard Williamson <rjw@apple.com>
1629 Fixed <rdar://problem/3674747> Need to implement invokeUndefinedMethodFromWebScript:withArguments:
1631 The following WebScripting methods are now supported on bound
1634 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args;
1635 - (void)setValue:(id)value forUndefinedKey:(NSString *)key
1636 - (id)valueForUndefinedKey:(NSString *)key
1640 * bindings/c/c_class.cpp:
1641 (CClass::fieldNamed):
1642 * bindings/c/c_class.h:
1643 * bindings/jni/jni_class.cpp:
1644 (JavaClass::fieldNamed):
1645 * bindings/jni/jni_class.h:
1646 * bindings/objc/objc_class.h:
1647 (KJS::Bindings::ObjcClass::isa):
1648 * bindings/objc/objc_class.mm:
1649 (ObjcClass::methodsNamed):
1650 (ObjcClass::fieldNamed):
1651 (ObjcClass::fallbackObject):
1652 * bindings/objc/objc_instance.h:
1653 * bindings/objc/objc_instance.mm:
1654 (ObjcInstance::invokeMethod):
1655 (ObjcInstance::setValueOfField):
1656 (ObjcInstance::setValueOfUndefinedField):
1657 (ObjcInstance::getValueOfField):
1658 (ObjcInstance::getValueOfUndefinedField):
1659 * bindings/objc/objc_runtime.h:
1660 (KJS::Bindings::ObjcField::~ObjcField):
1661 (KJS::Bindings::ObjcField::ObjcField):
1662 (KJS::Bindings::ObjcField::operator=):
1663 (KJS::Bindings::FallbackObjectImp::classInfo):
1664 * bindings/objc/objc_runtime.mm:
1665 (ObjcField::ObjcField):
1668 (ObjcField::valueFromInstance):
1669 (ObjcField::setValueToInstance):
1670 (FallbackObjectImp::FallbackObjectImp):
1671 (FallbackObjectImp::get):
1672 (FallbackObjectImp::put):
1673 (FallbackObjectImp::canPut):
1674 (FallbackObjectImp::implementsCall):
1675 (FallbackObjectImp::call):
1676 (FallbackObjectImp::hasProperty):
1677 (FallbackObjectImp::deleteProperty):
1678 (FallbackObjectImp::defaultValue):
1679 * bindings/runtime.h:
1680 (KJS::Bindings::Class::fallbackObject):
1681 (KJS::Bindings::Instance::getValueOfUndefinedField):
1682 (KJS::Bindings::Instance::setValueOfUndefinedField):
1683 * bindings/runtime_object.cpp:
1684 (RuntimeObjectImp::get):
1685 (RuntimeObjectImp::put):
1686 (RuntimeObjectImp::canPut):
1687 (RuntimeObjectImp::hasProperty):
1688 * bindings/testbindings.mm:
1689 (-[MyFirstInterface valueForUndefinedKey:]):
1690 (-[MyFirstInterface setValue:forUndefinedKey:]):
1692 2004-08-10 Darin Adler <darin@apple.com>
1696 - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
1698 * pcre/pcre.h: Added PCRE_UTF16 switch, set to 1. Added pcre_char typedef, which is char
1699 or uint16_t depending on the mode, and used appropriate in the 7 public functions
1700 that need to use it.
1701 * pcre/pcre.c: Add UTF-16 support to all functions.
1702 * pcre/study.c: Ditto.
1704 * pcre/internal.h: Added ichar typedef, which is unsigned char or uint16_t depending on
1705 the mode. Changed declarations to use symbolic constants and typedefs so we size
1706 things to ichar when needed.
1708 * pcre/maketables.c: (pcre_maketables): Change code to make tables that are
1709 sized to 16-bit characters instead of 8-bit.
1712 (pcre_copy_substring): Use pcre_char instead of char.
1713 (pcre_get_substring_list): Ditto.
1714 (pcre_free_substring_list): Ditto.
1715 (pcre_get_substring): Ditto.
1716 (pcre_free_substring): Ditto.
1718 * pcre/dftables.c: (main): Used a bit more const, and use ICHAR sizes instead
1719 of hard-coding 8-bit table sizes.
1721 * pcre/chartables.c: Regenerated.
1723 * kjs/ustring.h: Remove functions that convert UTF-16 to/from UTF-8 offsets.
1724 * kjs/ustring.cpp: Change the shared empty string to have a unicode pointer that
1725 is not null. The null string still has a null pointer. This prevents us from
1726 passing a null through to the regular expression engine (which results in a null
1727 error even when the string length is 0).
1730 (KJS::RegExp::RegExp): Null-terminate the pattern and pass it.
1731 (KJS::RegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
1733 2004-08-09 Darin Adler <darin@apple.com>
1737 - fixed 28 Mozilla JavaScript tests
1739 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Check for undefined rather than
1740 checking the number of arguments for the join method.
1742 * kjs/lexer.cpp: (Lexer::lex): Parse hexadecimal and octal constants in doubles rather
1743 than integers, so we aren't limited to 32 bits.
1745 * kjs/math_object.cpp: (MathFuncImp::call): Get rid of many unneeded special cases in
1746 the implementation of the pow operation. Also simplied a case that was handling positive
1747 and negative infinity separately.
1749 * kjs/nodes.cpp: (ShiftNode::evaluate): Keep the result of shifts in a double instead of
1750 putting them in a long, so that unsigned shift will work properly.
1752 * kjs/number_object.cpp: Add the DontDelete and ReadOnly flags to the numeric constants.
1754 * kjs/operations.cpp:
1755 (KJS::isPosInf): Added an implementation inside APPLE_CHANGES that does not depend on the
1756 sign of isinf; our isinf function returns +1 even for negative infinity.
1757 (KJS::isNegInf): And again.
1758 (KJS::relation): Put in a nice simple implementation of comparison inside APPLE_CHANGES.
1759 Our floating point already handles the various infinity cases correctly.
1761 * kjs/regexp_object.cpp:
1762 (RegExpProtoFuncImp::call): Add missing return before Null() in Exec method.
1763 (RegExpObjectImp::arrayOfMatches): Put undefined rather than an empty string into the
1764 array in cases where we did not match.
1765 (RegExpObjectImp::construct): Set the DontDelete, ReadOnly, and DontEnum flags for
1766 "global", "ignoreCase", "multiline", and "source".
1768 * kjs/string_object.cpp: (StringProtoFuncImp::call): For the match method, turn a null
1769 string into undefined rather than an empty string. For the slice method, handle an
1770 undefined parameter for the limit properly as decribed in the specification, and add
1771 the limit to one case that didn't have the limit at all. For the methods that generate
1772 HTML strings, use lowercase tags instead of uppercase.
1775 (KJS::UChar::toLower): Use u_tolower from the ICU library.
1776 (KJS::UChar::toUpper): Use u_toupper from the ICU library.
1777 (KJS::UString::append): Fix some math that caused a buffer overflow.
1778 (KJS::convertUTF16OffsetsToUTF8Offsets): Ignore negative numbers (-1 is used as a special
1779 flag) rather than converting them all to 0.
1780 (KJS::convertUTF8OffsetsToUTF16Offsets): Ditto.
1782 * tests/mozilla/jsDriver.pl: Fixed the relative links to point to our actual test files.
1784 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed the Unicode table in this test to match
1785 the Unicode specification in a few cases where it was wrong before.
1786 * tests/mozilla/ecma/String/15.5.4.11-2.js: Ditto.
1787 * tests/mozilla/ecma/String/15.5.4.11-3.js: Ditto.
1788 * tests/mozilla/ecma/String/15.5.4.11-5.js: Ditto.
1789 * tests/mozilla/ecma/String/15.5.4.11-6.js: Ditto.
1790 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
1791 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
1792 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
1793 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
1794 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
1796 * JavaScriptCore.pbproj/project.pbxproj: Link to libicu.
1798 * kjs/number_object.lut.h: Regenerated.
1800 2004-08-09 Darin Adler <darin@apple.com>
1804 - fixed <rdar://problem/3753467> REGRESSION (137-138): reproducible buffer overrun in UString manipulation code
1806 * kjs/ustring.cpp: (KJS::UString::append): Fix incorrect size computation. Without it
1807 we get a buffer overflow.
1811 2004-08-05 Richard Williamson <rjw@apple.com>
1813 Fixed part of 3674747. The QT guys need this for feature freeze.
1815 This patch implements support for the
1817 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args
1819 method of objects bound to JavaScript.
1824 * bindings/objc/objc_class.mm:
1825 (ObjcClass::methodsNamed):
1826 (ObjcClass::fieldNamed):
1827 * bindings/objc/objc_instance.mm:
1828 (ObjcInstance::invokeMethod):
1829 * bindings/objc/objc_runtime.h:
1830 (KJS::Bindings::ObjcMethod::~ObjcMethod):
1831 (KJS::Bindings::ObjcMethod::isFallbackMethod):
1832 (KJS::Bindings::ObjcMethod::javaScriptName):
1833 * bindings/objc/objc_runtime.mm:
1834 (ObjcMethod::ObjcMethod):
1835 (ObjcMethod::getMethodSignature):
1836 (ObjcMethod::setJavaScriptName):
1837 * bindings/testbindings.mm:
1839 2004-08-04 Vicki Murley <vicki@apple.com>
1843 - fix <rdar://problem/3649789> SAP WebGUI has problems loading first page because of parse error
1846 (Lexer::lex): if the current character is a '\' and the next character is a line terminator,
1847 go to the next line and continue parsing the string (instead of failing). This matches
1848 behavior in Mac IE and Mozilla.
1850 2004-08-03 Kevin Decker <kdecker@apple.com>
1854 Rolled in changes from the latest KJS sources that support additional
1855 Number.prototype functions.
1857 Specifically this patch covers the follow parts of the ECMA 3 spec:
1858 15.7.4.5, 15.7.4.6, and 15.7.4.7
1861 <rdar://problem/3663716> missing Number.toFixed (and toPrecision, toExponential)
1862 <rdar://problem/3749492> missing Number.toPrecision prototype implementation
1863 <rdar://problem/3749591> missing Number.toExponential prototype implementation
1865 * kjs/identifier.h: Added toFixed, toPrecision, and toExponential to the
1866 list of supported identifiers (a macro).
1867 * kjs/number_object.cpp: Implemented support for toFixed(), toPrecision(),
1868 and toExponential().
1869 (NumberPrototypeImp::NumberPrototypeImp):
1870 (NumberProtoFuncImp::call):
1871 * kjs/number_object.h: Added property names for toFixed, toPrecision,
1873 (KJS::NumberProtoFuncImp::):
1874 * tests/mozilla/expected.html: Update results.
1876 2004-08-03 Darin Adler <darin@apple.com>
1880 - added support for copying RegExp objects so 7 more Mozilla regexp tests pass
1882 * kjs/regexp_object.cpp: (RegExpObjectImp::construct): Check for case where
1883 we are supposed to just copy the regular expression object, and do so.
1884 Also tighten up arguments check to handle case where an actual "undefined"
1885 is passed rather than just omitting an argument.
1887 * tests/mozilla/expected.html: Update results.
1889 2004-08-02 Darin Adler <darin@apple.com>
1891 * tests/mozilla/.cvsignore: Added.
1892 * tests/mozilla/expected.html: Update results.
1894 2004-08-02 Darin Adler <darin@apple.com>
1898 - fixed RegExp.toString so 3 more Mozilla regexp tests pass
1900 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call):
1901 Append the flags here so more tests paseed.
1903 2004-08-02 Darin Adler <darin@apple.com>
1907 - fixed a couple things making 5 Mozilla regexp tests pass
1909 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call): Implement toString
1911 (RegExpObjectImp::construct): Fix bug where the string "undefined" would
1912 be used as the flags string when no parameter was passed.
1914 * kjs/regexp_object.h: (KJS::RegExpPrototypeImp::classInfo):
1915 Added a class info object for RegExp prototype so it can return
1916 a string instead of raising an exception when converting to a string.
1918 * tests/mozilla/expected.html: Update results.
1920 2004-08-02 Darin Adler <darin@apple.com>
1924 - fix crashes in mozilla tests due to mishandling NaN
1926 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Rerranged range checks after
1927 calls to toInteger so that NaN will get turned into something that fits in an integer.
1928 These were the ones John already fixed, but his fix used isnan and the new fix is
1931 * kjs/number_object.cpp: (NumberProtoFuncImp::call): Rearranged radix range checks
1932 after a call to toInteger to handle NaN properly. Also removed separate check
1933 for undefined that's not needed.
1935 * kjs/string_object.cpp: (StringProtoFuncImp::call): More of the same kinds of changes
1936 as in the above two files, but for a lot more functions. Also changed one place with
1937 an explicit check for undefined to instead just check isNaN.
1939 * tests/mozilla/run-mozilla-tests: Changed to invoke jst using $SYMROOTS for people
1940 like me who don't keep $SYMROOTS in their $PATH.
1946 2004-07-26 Kevin Decker <kdecker@apple.com>
1948 Changes done by Darin, reviewed by Kevin.
1950 - changed testkjs to build in Xcode rather than from Makefile
1952 * .cvsignore: Removed obsolete files from this list.
1953 * Makefile.am: Removed code to build testkjs; we do this in Xcode now.
1954 Changed to build target "All" rather than default target. This makes us
1955 build the testkjs test tool.
1956 * dummy.cpp: Removed.
1957 * kjs/.cvsignore: Removed obsolete files from this list, including
1958 the testkjs tool, which is now built in the symroots directory.
1959 * kjs/testkjs.cpp: Added copyright notice that was missing, since we have
1960 changed this file. Also this has the nice side effect of causing the tool
1961 to be rebuilt in the new location even if there are no other changes in
1962 your tree when you check this out.
1963 * tests/mozilla/run-mozilla-tests: Invoke perl explicitly so this works
1964 without setting the execute bit on jsDriver.pl.
1966 2004-07-22 Kevin Decker <kdecker@apple.com>
1970 Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions).
1972 * kjs/function_object.cpp:
1973 (FunctionObjectImp::construct):
1974 * kjs/function_object.h:
1976 (KJS::ObjectImp::construct):
1978 (KJS::Object::construct):
1980 2004-07-21 Darin Adler <darin@apple.com>
1982 * bindings/npruntime.h: Fixed typo.
1984 2004-07-19 John Sullivan <sullivan@apple.com>
1988 - bulletproofed array.slice() against NAN arguments. Harri noticed this
1989 vulnerability in my patch for 3714644
1991 * kjs/array_object.cpp:
1992 (ArrayProtoFuncImp::call):
1993 handle NAN parameters passed to slice() by clamping to 0 and length.
1995 2004-07-19 Richard Williamson <rjw@apple.com>
1997 Fixed 3733349. Prevent Java applet callbacks into JavaScript after applet
2002 * bindings/jni/jni_jsobject.cpp:
2004 (JSObject::JSObject):
2006 2004-07-16 John Sullivan <sullivan@apple.com>
2010 - fixed <rdar://problem/3714644> REGRESSION (125.8-146): bugzilla submit link
2011 hangs browser with javascript
2013 * kjs/array_object.cpp:
2014 (ArrayProtoFuncImp::call):
2015 Check for undefined type for args[0] the same way we were already checking
2016 for args[1]. In this case, args was zero-length, but we were treating
2017 args[0] like an integer anyway. Resulted in some code looping from a NAN
2018 value to 4, taking approximately forever.
2020 * JavaScriptCore.pbproj/project.pbxproj:
2025 2004-07-14 Maciej Stachowiak <mjs@apple.com>
2029 <rdar://problem/3711474>: (REGRESSION (125-146): JavaScript 'toString(16)' is broken)
2030 <rdar://problem/3644873>: (REGRESSION (125-140u): secondary list doesn't fill in at Southwest.com)
2032 * kjs/number_object.cpp:
2033 (NumberProtoFuncImp::call): Initialize radix from dradix, not from itself!
2035 2004-07-13 Kevin Decker <kdecker@apple.com>
2037 Reviewed by kocienda.
2039 - made testkjs and JavaScriptCore a subtarget of 'All'
2040 - testkjs now builds in $SYMROOTS
2042 * JavaScriptCore.pbproj/project.pbxproj:
2046 2004-06-24 Chris Blumenberg <cblu@apple.com>
2048 Ignore .mode1 files in JavaScriptCore.pbproj
2050 Reviewed by kocienda.
2052 * JavaScriptCore.pbproj/.cvsignore:
2054 2004-06-23 Richard Williamson <rjw@apple.com>
2056 Implemented changes for latest npruntime.h.
2060 * JavaScriptCore.pbproj/project.pbxproj:
2061 * bindings/NP_jsobject.cpp:
2062 (listFromVariantArgs):
2063 (identiferFromNPIdentifier):
2064 (_NPN_CreateScriptObject):
2069 (NPN_RemoveProperty):
2070 * bindings/NP_jsobject.h:
2071 * bindings/c/c_class.cpp:
2072 (CClass::methodsNamed):
2073 (CClass::fieldNamed):
2074 * bindings/c/c_instance.cpp:
2075 (CInstance::invokeMethod):
2076 * bindings/c/c_utility.cpp:
2077 (convertNPVariantToValue):
2078 * bindings/c/c_utility.h:
2079 * bindings/npruntime.cpp:
2080 (stringIdentifierEqual):
2081 (stringIdentifierHash):
2082 (getStringIdentifierDictionary):
2083 (intIdentifierEqual):
2084 (intIdentifierHash):
2085 (getIntIdentifierDictionary):
2086 (NPN_GetStringIdentifier):
2087 (NPN_GetStringIdentifiers):
2088 (NPN_GetIntIdentifier):
2089 (NPN_IdentifierIsString):
2090 (NPN_UTF8FromIdentifier):
2091 (NPN_VariantToInt32):
2092 (NPN_VariantToDouble):
2094 * bindings/npruntime.h:
2095 * bindings/objc/WebScriptObject.mm:
2096 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2097 * bindings/runtime_object.cpp:
2098 (RuntimeObjectImp::~RuntimeObjectImp):
2099 * bindings/runtime_root.cpp:
2100 (KJS::Bindings::rootForInterpreter):
2101 * bindings/testbindings.cpp:
2102 (initializeIdentifiers):
2108 === JavaScriptCore-146.1 ===
2110 2004-06-16 Richard Williamson <rjw@apple.com>
2112 Fixed <rdar://problem/3702287> Crash returning nil from bound ObjC
2114 This turned out to be a show stopper for Dashboard. Accessing a nil
2115 ObjC property from JS caused a crash. Similar to the problem
2116 3696112 fixed below.
2120 * bindings/objc/objc_runtime.mm:
2121 (KJS::Bindings::ObjcField::valueFromInstance):
2125 2004-06-16 Richard Williamson <rjw@apple.com>
2127 Fixed <rdar://problem/3696112>: nil from an Objective-C class seems to get wrapped as a JavaScript proxy that will not print.
2129 This turned out to be a show stopper for Dashboard. We now
2130 return Undefined() when nil is returned from a ObjC method
2131 that returns an object type.
2135 * bindings/objc/objc_utility.mm:
2136 (KJS::Bindings::convertObjcValueToValue):
2140 2004-06-15 Richard Williamson <rjw@apple.com>
2142 Fixed <rdar://problem/3695875>: Objective-C instances that are exported to JavaScript are too promiscuous
2144 No longer need to check respondsToSelector: for
2145 isSelectorExcludedFromWebScript: and isKeyExcludedFromWebScript:
2146 because these now have a default implementation on NSObject.
2150 * bindings/objc/objc_class.mm:
2151 (ObjcClass::methodsNamed):
2152 (ObjcClass::fieldNamed):
2154 2004-06-14 Darin Adler <darin@apple.com>
2158 - fixed some things for GC that Patrick missed, or that happened after the branch
2160 * bindings/objc/WebScriptObject.mm:
2161 (-[WebScriptObject dealloc]): Moved removeNativeReference call here from private object.
2162 (-[WebScriptObject finalize]): Added.
2164 - added some missing nil checks
2166 * bindings/objc/objc_instance.mm:
2167 (ObjcInstance::ObjcInstance): Check for nil.
2168 (ObjcInstance::~ObjcInstance): Check for nil.
2169 (ObjcInstance::operator=): Check for nil.
2171 2004-06-14 Darin Adler <darin@apple.com>
2173 Reviewed by me, code changes by Patrick Beard.
2175 - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
2177 * bindings/objc/objc_instance.mm:
2178 (ObjcInstance::ObjcInstance): Use CFRetain instead of retain.
2179 (ObjcInstance::~ObjcInstance): Use CFRelease instead of release.
2180 (ObjcInstance::operator=): More of the same.
2181 (ObjcInstance::end): Use [pool drain] if compiling on Tiger.
2183 * bindings/objc/objc_runtime.mm:
2184 (ObjcArray::ObjcArray): Use CFRetain instead of retain.
2185 (ObjcArray::~ObjcArray): Use CFRelease instead of release.
2186 (ObjcArray::operator=): More of the same.
2188 * bindings/testbindings.mm: Fixed incorrect license.
2189 (main): Use [pool drain] if compiling on Tiger.
2193 2004-06-10 Kevin Decker <kdecker@apple.com>
2199 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
2201 (KJS::Lexer::lineNo):
2202 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
2204 === JavaScriptCore-143.2 ===
2206 2004-06-07 Darin Adler <darin@apple.com>
2208 - fixed <rdar://problem/3682489>: (JavaScriptGlue no longer compiles because Interpreter::evaluate parameters changed)
2210 * kjs/interpreter.h: Added an overload to make JavaScriptGlue compile.
2211 * kjs/interpreter.cpp: (KJS::Interpreter::evaluate): Implemented the overload.
2213 === JavaScriptCore-143.1 ===
2215 2004-06-04 Kevin Decker <kdecker@apple.com>
2219 - fixed <rdar://problem/3680594>
2222 (KJS::Error::create):
2226 2004-06-04 Darin Adler <darin@apple.com>
2228 * kjs/testkjs.cpp: (main): Fix build breakage by adding URL and line number parameters.
2230 2004-06-04 Kevin Decker <kdecker@apple.com>
2234 - ObjC bindings do not (yet) pass along sourceurl or line numbers
2235 - we don't have a way as of yet to accomidate line numbers and urls for dynamic javascript
2236 - changed the wording of an error message
2237 - the lexer, parser, and interpreter have been made "sourceURL aware"
2238 - stored the url into Error
2240 * bindings/NP_jsobject.cpp:
2242 * bindings/jni/jni_jsobject.cpp:
2244 * bindings/objc/WebScriptObject.mm:
2245 (-[WebScriptObject evaluateWebScript:]):
2247 (GlobalFuncImp::call):
2248 * kjs/function_object.cpp:
2249 (FunctionObjectImp::construct):
2252 (InterpreterImp::checkSyntax):
2253 (InterpreterImp::evaluate):
2255 * kjs/interpreter.cpp:
2256 (Interpreter::evaluate):
2257 * kjs/interpreter.h:
2261 (KJS::Lexer::sourceURL):
2265 (FunctionCallNode::evaluate):
2268 (KJS::Error::create):
2271 2004-06-04 Richard Williamson <rjw@apple.com>
2273 Fixed crash when attempting to access properties on nil
2278 * bindings/objc/objc_instance.mm:
2279 (ObjcInstance::getClass):
2280 * bindings/runtime_object.cpp:
2281 (RuntimeObjectImp::get):
2282 * bindings/testM.js:
2283 * bindings/testbindings.mm:
2284 (-[MyFirstInterface getString]):
2286 2004-05-27 Kevin Decker <kdecker@apple.com>
2290 -revised generated error message content
2292 * kjs/error_object.cpp:
2293 (ErrorProtoFuncImp::call):
2297 (KJS::Error::create):
2301 2004-05-27 Richard Williamson <rjw@apple.com>
2303 Renamed WebScriptMethods to WebScripting based on feedback from Nancy.
2307 * bindings/objc/WebScriptObject.h:
2309 2004-05-27 Darin Adler <darin@apple.com>
2313 - moved to new symlink technique for embedding frameworks
2315 * JavaScriptCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
2316 because we don't need it any more.
2318 2004-05-24 Richard Williamson <rjw@apple.com>
2320 Changed RuntimeArrayImp to inherit from ArrayInstanceImp and
2321 fixed ClassInfo to correctly reflect inheritance. This is required
2322 because of the runtime checks in JSC for arrays, i.e. in
2323 the Function objects apply method.
2327 * bindings/jni/jni_runtime.cpp:
2328 (JavaArray::convertJObjectToArray):
2329 * bindings/objc/objc_utility.mm:
2330 (KJS::Bindings::convertObjcValueToValue):
2331 * bindings/runtime_array.cpp:
2332 (RuntimeArrayImp::RuntimeArrayImp):
2333 * bindings/runtime_array.h:
2334 * bindings/testM.js: Added.
2335 * bindings/testbindings.mm:
2336 (+[MyFirstInterface webScriptNameForSelector:]):
2337 (-[MyFirstInterface logMessages:]):
2338 (-[MyFirstInterface logMessage:prefix:]):
2339 (-[MyFirstInterface callJSObject::]):
2341 2004-05-22 Darin Adler <darin@apple.com>
2345 - fixed <rdar://problem/3664260>: (JS needs to listen to timezone change notifications)
2347 * kjs/date_object.cpp: (CopyLocalTimeZone): As per Chris Kane and Jordan Hubbard, use <notify.h>
2348 with a hardcoded string of "com.apple.system.timezone", and do CFTimeZoneResetSystem since
2349 CoreFoundation doesn't do this itself. Turns out this affects the default time zone as long as
2350 it hasn't been set explicitly.
2354 2004-05-20 Richard Williamson <rjw@apple.com>
2356 Implemented WebScriptObject/DOM wrapper voodoo. DOM wrappers
2357 can now be referenced like any other WebScriptObject, meaning
2358 you can do JS operations on them.
2360 All added implementation of finalizeForWebScript.
2364 * bindings/objc/WebScriptObject.h:
2365 * bindings/objc/WebScriptObject.mm:
2366 (-[WebScriptObject _initializeWithObjectImp:KJS::root:Bindings::]):
2367 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
2368 (-[WebScriptObject KJS::]):
2369 (-[WebScriptObject dealloc]):
2370 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2371 (-[WebScriptObject evaluateWebScript:]):
2372 (-[WebScriptObject setValue:forKey:]):
2373 (-[WebScriptObject valueForKey:]):
2374 (-[WebScriptObject stringRepresentation]):
2375 * bindings/objc/WebScriptObjectPrivate.h:
2376 * bindings/objc/objc_instance.mm:
2377 (ObjcInstance::~ObjcInstance):
2379 2004-05-19 Richard Williamson <rjw@apple.com>
2381 Removed extraneous tabs that were added (by XCode?).
2383 * bindings/objc/WebScriptObject.h:
2385 2004-05-19 Darin Adler <darin@apple.com>
2387 - fixed headers with licenses mangled by Xcode auto-indenting
2389 * bindings/jni/jni_jsobject.cpp:
2390 * bindings/jni/jni_jsobject.h:
2391 * bindings/runtime_array.h:
2392 * bindings/runtime_root.cpp:
2393 * bindings/runtime_root.h:
2395 2004-05-18 Richard Williamson <rjw@apple.com>
2397 Added exception logging. Also check for exception and
2398 set results as appropriate.
2400 Reviewed by Maciej (partially reviewed).
2402 * bindings/objc/WebScriptObject.mm:
2403 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2404 (-[WebScriptObject evaluateWebScript:]):
2405 (-[WebScriptObject setValue:forKey:]):
2406 (-[WebScriptObject valueForKey:]):
2408 2004-05-18 Richard Williamson <rjw@apple.com>
2410 Finsished implementing support for windowScriptObject.
2411 Had to make WebScriptObjectPrivate.h accessible from
2416 * JavaScriptCore.pbproj/project.pbxproj:
2417 * bindings/objc/WebScriptObjectPrivate.h:
2419 2004-05-18 Richard Williamson <rjw@apple.com>
2421 Use KVC to set/get values instead of directly accessing
2426 * bindings/objc/WebScriptObject.mm:
2427 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2428 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2429 * bindings/objc/objc_runtime.mm:
2430 (ObjcField::valueFromInstance):
2431 (convertValueToObjcObject):
2432 (ObjcField::setValueToInstance):
2434 2004-05-17 Richard Williamson <rjw@apple.com>
2436 Implemented new API for WebScriptObject.
2438 Fixed <rdar://problem/3657145>: (objc to javascript method calls do not cause updates.)
2439 Fixed <rdar://problem/3654887>: (Update to JSC to refer to new JSObject LiveConnect object) (w/ help from Vicki)
2443 * JavaScriptCore.pbproj/project.pbxproj:
2444 * bindings/c/c_instance.cpp:
2445 (CInstance::invokeMethod):
2446 * bindings/jni/jni_instance.cpp:
2447 (JavaInstance::invokeMethod):
2448 * bindings/jni/jni_jsobject.cpp:
2449 (JSObject::convertValueToJObject):
2450 * bindings/jni/jni_utility.cpp:
2451 (KJS::Bindings::getJNIField):
2452 * bindings/objc/WebScriptObject.mm:
2454 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
2455 (-[WebScriptObject KJS::]):
2456 (-[WebScriptObject dealloc]):
2457 (+[WebScriptObject throwException:]):
2459 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2460 (-[WebScriptObject evaluateWebScript:]):
2461 (-[WebScriptObject setValue:forKey:]):
2462 (-[WebScriptObject valueForKey:]):
2463 (-[WebScriptObject stringRepresentation]):
2464 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2465 (+[WebUndefined undefined]):
2466 (-[WebUndefined initWithCoder:]):
2467 (-[WebUndefined encodeWithCoder:]):
2468 (-[WebUndefined copyWithZone:]):
2469 (-[WebUndefined retain]):
2470 (-[WebUndefined release]):
2471 (-[WebUndefined retainCount]):
2472 (-[WebUndefined autorelease]):
2473 (-[WebUndefined dealloc]):
2474 (-[WebUndefined copy]):
2475 (-[WebUndefined replacementObjectForPortCoder:]):
2476 * bindings/objc/WebScriptObjectPrivate.h: Added.
2477 * bindings/objc/objc_class.mm:
2478 (ObjcClass::methodsNamed):
2479 (ObjcClass::fieldNamed):
2480 * bindings/objc/objc_instance.mm:
2481 (ObjcInstance::invokeMethod):
2482 * bindings/objc/objc_jsobject.h:
2483 * bindings/objc/objc_jsobject.mm:
2484 * bindings/objc/objc_runtime.mm:
2485 (ObjcField::valueFromInstance):
2486 * bindings/objc/objc_utility.mm:
2487 (KJS::Bindings::JSMethodNameToObjCMethodName):
2488 (KJS::Bindings::convertValueToObjcValue):
2489 (KJS::Bindings::convertObjcValueToValue):
2490 * bindings/runtime.cpp:
2491 (Instance::setDidExecuteFunction):
2492 (Instance::didExecuteFunction):
2493 (Instance::setValueOfField):
2494 * bindings/runtime.h:
2495 * bindings/testbindings.mm:
2496 (+[MyFirstInterface webScriptNameForSelector:]):
2497 (-[MyFirstInterface callJSObject::]):
2499 2004-05-14 Vicki Murley <vicki@apple.com>
2503 <rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release
2505 * JavaScriptCore.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0
2509 2004-05-13 Richard Williamson <rjw@apple.com>
2516 * bindings/objc/WebScriptObject.h:
2518 2004-05-13 Richard Williamson <rjw@apple.com>
2520 Approved API changes. Currently unimplemented.
2525 * JavaScriptCore.pbproj/project.pbxproj:
2526 * bindings/objc/WebScriptObject.h: Added.
2527 * bindings/objc/WebScriptObject.mm: Added.
2528 (+[WebScriptObject throwException:]):
2529 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2530 (-[WebScriptObject evaluateWebScript:]):
2531 (-[WebScriptObject stringRepresentation]):
2532 (+[WebUndefined undefined]):
2533 (-[WebUndefined initWithCoder:]):
2534 (-[WebUndefined encodeWithCoder:]):
2535 (-[WebUndefined copyWithZone:]):
2537 2004-05-07 Vicki Murley <vicki@apple.com>
2541 Turn off GC since it uses ppc only instructions (which breaks
2544 * kjs/value.h: set USE_CONSERVATIVE_GC to 0
2548 2004-05-07 Maciej Stachowiak <mjs@apple.com>
2552 - add -funroll-loops=16 compiler option for approx .5% speedup on
2553 HTML iBench and .5-1% speedup on JS iBench.
2555 * JavaScriptCore.pbproj/project.pbxproj:
2557 2004-04-25 Maciej Stachowiak <mjs@apple.com>
2561 Enable full conservative GC mode in addition to test mode. When
2562 conservative GC is enabled, we now get an 11% speed improvement on
2563 the iBench. Also fix some spots I missed before.
2565 Specific noteworth changes:
2567 * kjs/collector.cpp:
2568 (KJS::Collector::markStackObjectsConservatively): Check possible
2569 cell pointers for 8-byte aligment and verify they are not 0.
2571 * kjs/protected_values.cpp:
2572 (KJS::ProtectedValues::increaseProtectCount): Move null-tolerance from here...
2573 (KJS::ProtectedValues::decreaseProtectCount): ...and here...
2575 (KJS::gcProtectNullTolerant): ...to here...
2576 (KJS::gcUnprotectNullTolerant): ...and here, because not all callers need the null
2577 tolerance, and doing the check is expensive.
2579 * kjs/protected_values.cpp:
2580 (KJS::ProtectedValues::computeHash): Replace hash function with a much faster one
2581 that is still very good.
2586 (KJS::ProtectedValue::ProtectedValue):
2587 (KJS::ProtectedValue::~ProtectedValue):
2588 (KJS::ProtectedValue::operator=):
2589 (KJS::ProtectedObject::ProtectedObject):
2590 (KJS::ProtectedObject::~ProtectedObject):
2591 (KJS::ProtectedObject::operator=):
2592 (KJS::ProtectedReference::ProtectedReference):
2593 (KJS::ProtectedReference::~ProtectedReference):
2594 (KJS::ProtectedReference::operator=):
2595 * kjs/protected_values.cpp:
2596 (KJS::ProtectedValues::getProtectCount):
2597 (KJS::ProtectedValues::increaseProtectCount):
2598 (KJS::ProtectedValues::decreaseProtectCount):
2599 (KJS::ProtectedValues::computeHash):
2600 * bindings/runtime_root.cpp:
2601 (KJS::Bindings::addNativeReference):
2602 (KJS::Bindings::removeNativeReference):
2603 (RootObject::removeAllNativeReferences):
2604 * bindings/runtime_root.h:
2605 (KJS::Bindings::RootObject::~RootObject):
2606 (KJS::Bindings::RootObject::setRootObjectImp):
2607 * kjs/collector.cpp:
2608 (KJS::Collector::allocate):
2609 (KJS::Collector::collect):
2612 (NumberImp::create):
2613 (InterpreterImp::globalInit):
2614 (InterpreterImp::globalClear):
2615 (InterpreterImp::mark):
2617 (KJS::List::derefValues):
2618 (KJS::List::refValues):
2619 (KJS::List::append):
2621 (KJS::ObjectImp::setInternalValue):
2622 (KJS::ObjectImp::putDirect):
2627 (KJS::ValueImp::ValueImp):
2628 (KJS::ValueImp::~ValueImp):
2630 (KJS::Value::Value):
2631 (KJS::Value::~Value):
2632 (KJS::Value::operator=):
2634 2004-04-30 Richard Williamson <rjw@apple.com>
2636 Asking an NSInvocation for it's return value when return type
2637 is void throws an exception. Added check for void return types
2638 to avoid this exception.
2642 * bindings/objc/objc_instance.mm:
2643 (ObjcInstance::invokeMethod):
2645 2004-04-29 Richard Williamson <rjw@apple.com>
2647 Fixed several bad problems with the ObjC bindings. In particular, conversion
2648 to/from JavaScriptObject (soon to be WebScriptObject) was completely broken.
2652 * bindings/objc/objc_jsobject.h:
2653 * bindings/objc/objc_jsobject.mm:
2654 (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
2655 (-[JavaScriptObject KJS::]):
2656 (+[JavaScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2657 (-[JavaScriptObject call:arguments:]):
2658 (-[JavaScriptObject evaluate:]):
2659 (-[JavaScriptObject getMember:]):
2660 (-[JavaScriptObject getSlot:]):
2661 * bindings/objc/objc_runtime.mm:
2662 (ObjcField::valueFromInstance):
2663 (ObjcField::setValueToInstance):
2664 * bindings/objc/objc_utility.mm:
2665 (KJS::Bindings::convertValueToObjcValue):
2666 (KJS::Bindings::convertObjcValueToValue):
2667 * bindings/runtime.h:
2668 * bindings/runtime_root.cpp:
2669 (KJS::Bindings::rootForInterpreter):
2670 (KJS::Bindings::addNativeReference):
2671 (KJS::Bindings::removeNativeReference):
2672 * bindings/runtime_root.h:
2673 * bindings/testbindings.mm:
2674 (-[MyFirstInterface logMessage:]):
2675 (-[MyFirstInterface setJSObject:]):
2676 (-[MyFirstInterface callJSObject::]):
2678 2004-04-24 Darin Adler <darin@apple.com>
2682 * kjs/ustring.cpp: (KJS::UString::append): Fix one case that was allocating a buffer
2685 2004-04-23 Maciej Stachowiak <mjs@apple.com>
2689 Implementation of conservative GC, based partly on code from
2690 Darin. It's turned off for now, so it shouldn't have any effect on
2693 * JavaScriptCore.pbproj/project.pbxproj:
2694 * kjs/collector.cpp:
2695 (KJS::Collector::markStackObjectsConservatively):
2696 (KJS::Collector::markProtectedObjects):
2697 (KJS::Collector::collect):
2702 * kjs/protected_values.cpp: Added.
2703 (KJS::ProtectedValues::getProtectCount):
2704 (KJS::ProtectedValues::increaseProtectCount):
2705 (KJS::ProtectedValues::insert):
2706 (KJS::ProtectedValues::decreaseProtectCount):
2707 (KJS::ProtectedValues::expand):
2708 (KJS::ProtectedValues::shrink):
2709 (KJS::ProtectedValues::rehash):
2710 (KJS::ProtectedValues::computeHash):
2711 * kjs/protected_values.h: Added.
2713 (ValueImp::useConservativeMark):
2721 2004-04-22 Richard Williamson <rjw@apple.com>
2723 Fixed build snafu (re-declaration of NPBool in npruntime.h and
2726 * bindings/npruntime.h:
2728 2004-04-22 Richard Williamson <rjw@apple.com>
2730 Updated plugin binding API to reflect latest revision from
2733 Biggest change is the introduction of NPVariant used to represent
2734 value types. NPVariant replaces the use of NPObject for the
2735 exchange of values between scripting environment and native code.
2739 * JavaScriptCore.pbproj/project.pbxproj:
2740 * bindings/NP_jsobject.cpp:
2741 (identiferFromNPIdentifier):
2747 (NPN_GetPropertyAtIndex):
2748 (NPN_SetPropertyAtIndex):
2749 * bindings/c/c_class.cpp:
2750 (CClass::methodsNamed):
2751 (CClass::fieldNamed):
2752 * bindings/c/c_instance.cpp:
2753 (CInstance::invokeMethod):
2754 (CInstance::defaultValue):
2755 * bindings/c/c_runtime.cpp:
2756 (CField::valueFromInstance):
2757 (CField::setValueToInstance):
2758 * bindings/c/c_utility.cpp:
2759 (convertNPStringToUTF16):
2760 (convertUTF8ToUTF16):
2761 (coerceValueToNPVariantStringType):
2762 (convertValueToNPVariant):
2763 (convertNPVariantToValue):
2764 * bindings/c/c_utility.h:
2765 * bindings/npruntime.cpp:
2766 (NPN_GetIdentifier):
2767 (NPN_GetIdentifiers):
2768 (NPN_UTF8FromIdentifier):
2769 (NPN_VariantIsVoid):
2770 (NPN_VariantIsNull):
2771 (NPN_VariantIsUndefined):
2772 (NPN_VariantIsBool):
2773 (NPN_VariantIsInt32):
2774 (NPN_VariantIsDouble):
2775 (NPN_VariantIsString):
2776 (NPN_VariantIsObject):
2777 (NPN_VariantToBool):
2778 (NPN_VariantToString):
2779 (NPN_VariantToInt32):
2780 (NPN_VariantToDouble):
2781 (NPN_VariantToObject):
2782 (NPN_InitializeVariantAsVoid):
2783 (NPN_InitializeVariantAsNull):
2784 (NPN_InitializeVariantAsUndefined):
2785 (NPN_InitializeVariantWithBool):
2786 (NPN_InitializeVariantWithInt32):
2787 (NPN_InitializeVariantWithDouble):
2788 (NPN_InitializeVariantWithString):
2789 (NPN_InitializeVariantWithStringCopy):
2790 (NPN_InitializeVariantWithObject):
2791 (NPN_InitializeVariantWithVariant):
2792 (NPN_ReleaseVariantValue):
2795 (NPN_ReleaseObject):
2796 (NPN_IsKindOfClass):
2797 (NPN_SetExceptionWithUTF8):
2799 * bindings/npruntime.h:
2801 (_NPString::_NPVariant::):
2802 * bindings/testbindings.cpp:
2817 2004-04-22 Darin Adler <darin@apple.com>
2821 - fixed <rdar://problem/3627473>: "REGRESSION (125-137): memory trasher in UString::append, causing many different crashes"
2824 (KJS::UString::expandCapacity): Fix sizeof(UChar *) that should be sizeof(UChar).
2825 Was resulting in a buffer 2x the needed size.
2826 (KJS::UString::expandPreCapacity): Ditto.
2827 (KJS::UString::append): Fix malloc that is missing a sizeof(UChar).
2829 2004-04-21 Maciej Stachowiak <mjs@apple.com>
2833 Preliminary change for conservative GC. Create "protected"
2834 subclasses to GC-protect objects when on heap, since we will soon
2835 remove the built-in refcounting of the normal wrapper classes. Use
2838 * JavaScriptCore.pbproj/project.pbxproj:
2841 (KJS::InterpreterImp::globalObject):
2842 * kjs/interpreter.h:
2843 * kjs/property_map.cpp:
2845 * kjs/reference_list.cpp:
2847 2004-04-19 Maciej Stachowiak <mjs@apple.com>
2851 Optimize prepend using the shared substring optimization. Also,
2852 limit the applicability of shared append and shared prepend. If
2853 you overdo it, it does more harm than good, because you create a
2854 bunch of strings that are disqualified from future shared
2855 append/prepend, for not much immediate savings in allocate/copy
2860 (KJS::UString::Rep::create):
2861 (KJS::UString::expandedSize):
2862 (KJS::UString::usedPreCapacity):
2863 (KJS::UString::expandCapacity):
2864 (KJS::UString::expandPreCapacity):
2865 (KJS::UString::UString):
2866 (KJS::UString::append):
2867 (KJS::UString::operator=):
2869 (KJS::UString::Rep::data):
2871 2004-04-16 Maciej Stachowiak <mjs@apple.com>
2872 Reviewed by Richard.
2874 No more need for Completion or Reference to privately inherit from
2875 Value, none of the superclass functionality is used.
2882 2004-04-16 Richard Williamson <rjw@apple.com>
2884 Added interpreter lock protection around object creation.
2888 * bindings/runtime.cpp:
2889 (Instance::createRuntimeObject):
2891 2004-04-16 Maciej Stachowiak <mjs@apple.com>
2895 Another JavaScript speed improvement: use the mechanism from
2896 string append optimization to make taking a substring fast, again
2899 A further 22% improvement on the 24fun string speed test.
2903 (KJS::UString::Rep::create):
2904 (KJS::UString::UString):
2905 (KJS::UString::append):
2906 (KJS::UString::operator=):
2907 (KJS::UString::substr):
2909 (KJS::UString::Rep::data):
2911 2004-04-13 Maciej Stachowiak <mjs@apple.com>
2915 - fixed <rdar://problem/3600695>: String manipulation in JavaScript 24fun test is very slow (slow)
2916 - fixed <rdar://problem/3600691>: Table generation test is really slow
2917 - fixed <rdar://problem/3600661>: 24fun date test is really slow
2919 80% speedup on the string test, lesser speedups on the other two.
2921 Two different optimizations here:
2923 1) Avoid large overhead of scanning strings to see if they are all
2924 ASCII before numeric conversion.
2927 (AssignNode::evaluate): Don't convert to integer until we know for
2928 sure the operation will need it. Attempting to convert strings to
2929 numbers is a waste when they are being appended with +=.
2931 2) Avoid huge cost of appending strings.
2933 This is done by allowing multiple strings to share a buffer but
2934 actually use different ranges of it. The first time a string is
2935 appended to, we start leaving at least 10% extra space in the
2936 buffer, so doing N appends to the same string takes O(log N)
2937 mallocs instead of O(N).
2939 * kjs/identifier.cpp:
2940 (KJS::Identifier::equal):
2941 (KJS::Identifier::add):
2944 (KJS::UCharReference::operator=):
2945 (KJS::UCharReference::ref):
2946 (KJS::UString::Rep::create):
2947 (KJS::UString::Rep::destroy):
2948 (KJS::UString::expandedSize):
2949 (KJS::UString::usedCapacity):
2950 (KJS::UString::expandCapacity):
2951 (KJS::UString::UString):
2952 (KJS::UString::null):
2953 (KJS::UString::append):
2954 (KJS::UString::operator=):
2955 (KJS::UString::toStrictUInt32):
2956 (KJS::UString::detach):
2957 (KJS::KJS::operator==):
2959 (KJS::UString::Rep::data):
2960 (KJS::UString::Rep::hash):
2962 2004-04-09 Maciej Stachowiak <mjs@apple.com>
2966 - fix deployment build by avoiding deployment-only warning.
2968 * kjs/scope_chain.cpp:
2969 (KJS::ScopeChain::bottom):
2971 2004-04-09 Maciej Stachowiak <mjs@apple.com>
2975 Changed things so that newly created objects get a prototype based
2976 on the scope chain of the current function, rather than the
2977 interpreter that started execution. This fixes the following bugs:
2979 <rdar://problem/3368523>: ARCH: wrong prototype used to create new objects (hang on lookup.atomica.com)
2980 <rdar://problem/3559173>: ARCH: Cannot scan using a HP Jetdirect product (JS object prototypes bind incorrectly)
2982 * JavaScriptCore.pbproj/project.pbxproj:
2983 * kjs/array_object.cpp:
2984 (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
2985 (ArrayProtoFuncImp::ArrayProtoFuncImp):
2986 (ArrayProtoFuncImp::call):
2987 (ArrayObjectImp::construct):
2988 * kjs/bool_object.cpp:
2989 (BooleanObjectImp::construct):
2990 * kjs/date_object.cpp:
2991 (DateProtoFuncImp::DateProtoFuncImp):
2992 (DateProtoFuncImp::call):
2993 (DateObjectImp::construct):
2994 * kjs/error_object.cpp:
2995 (ErrorObjectImp::construct):
2997 (FunctionImp::FunctionImp):
2998 (FunctionImp::call):
2999 (DeclaredFunctionImp::construct):
3000 (ArgumentsImp::ArgumentsImp):
3001 (GlobalFuncImp::call):
3002 * kjs/function_object.cpp:
3003 (FunctionProtoFuncImp::call):
3004 (FunctionObjectImp::construct):
3006 (BooleanImp::toObject):
3007 (StringImp::toObject):
3008 (NumberImp::toObject):
3009 (InterpreterImp::InterpreterImp):
3010 (InterpreterImp::clear):
3011 (InterpreterImp::interpreterWithGlobalObject):
3013 * kjs/interpreter.cpp:
3014 (ExecState::lexicalInterpreter):
3015 * kjs/interpreter.h:
3016 (KJS::ExecState::dynamicInterpreter):
3017 (KJS::ExecState::interpreter):
3018 * kjs/math_object.cpp:
3019 (MathFuncImp::MathFuncImp):
3021 (StatementNode::hitStatement):
3022 (StatementNode::abortStatement):
3023 (RegExpNode::evaluate):
3024 (ElementNode::evaluate):
3025 (ArrayNode::evaluate):
3026 (ObjectLiteralNode::evaluate):
3027 (PropertyValueNode::evaluate):
3028 (FunctionCallNode::evaluate):
3029 (FuncDeclNode::processFuncDecl):
3030 (FuncExprNode::evaluate):
3031 * kjs/number_object.cpp:
3032 (NumberObjectImp::construct):
3034 (KJS::ObjectImp::defaultValue):
3035 (KJS::Error::create):
3036 * kjs/object_object.cpp:
3037 (ObjectObjectImp::construct):
3038 * kjs/reference.cpp:
3039 (Reference::putValue):
3040 * kjs/regexp_object.cpp:
3041 (RegExpProtoFuncImp::call):
3042 (RegExpObjectImp::arrayOfMatches):
3043 (RegExpObjectImp::construct):
3044 * kjs/scope_chain.cpp:
3045 (KJS::ScopeChain::bottom):
3046 * kjs/scope_chain.h:
3047 * kjs/string_object.cpp:
3048 (StringProtoFuncImp::StringProtoFuncImp):
3049 (StringProtoFuncImp::call):
3050 (StringObjectImp::construct):
3056 2004-03-31 Richard Williamson <rjw@apple.com>
3058 Tedious renames based on feedback from plugin-futures list.
3059 NP_ functions are renamed with NPN_ prefix.
3060 Types prefix renamed from NP_ to NP.
3061 NPN_CreateStringWithUTF8 and NPN_SetExceptionWithUTF8 now take a length, optionally -1 if string is null terminated.
3063 No review because this was just a renaming patch.
3065 * bindings/NP_jsobject.cpp:
3068 (identiferFromNPIdentifier):
3073 (NPN_RemoveProperty):
3075 (NPN_GetPropertyAtIndex):
3076 (NPN_SetPropertyAtIndex):
3077 * bindings/NP_jsobject.h:
3078 * bindings/c/c_class.cpp:
3079 (CClass::_commonInit):
3080 (CClass::classForIsA):
3082 (CClass::methodsNamed):
3083 (CClass::fieldNamed):
3084 * bindings/c/c_class.h:
3085 * bindings/c/c_instance.cpp:
3086 (CInstance::CInstance):
3087 (CInstance::~CInstance):
3088 (CInstance::operator=):
3089 (CInstance::invokeMethod):
3090 (CInstance::defaultValue):
3091 * bindings/c/c_instance.h:
3092 (KJS::Bindings::CInstance::getObject):
3093 * bindings/c/c_runtime.cpp:
3094 (CField::valueFromInstance):
3095 (CField::setValueToInstance):
3096 * bindings/c/c_runtime.h:
3097 (KJS::Bindings::CField::CField):
3098 (KJS::Bindings::CField::name):
3099 (KJS::Bindings::CMethod::CMethod):
3100 (KJS::Bindings::CMethod::name):
3101 * bindings/c/c_utility.cpp:
3102 (coerceValueToNPString):
3103 (convertValueToNPValueType):
3104 (convertNPValueTypeToValue):
3105 * bindings/c/c_utility.h:
3106 * bindings/npruntime.cpp:
3107 (NPN_IdentifierFromUTF8):
3108 (NPN_IsValidIdentifier):
3109 (NPN_GetIdentifiers):
3110 (NPN_UTF8FromIdentifier):
3113 (NPN_ReleaseObject):
3114 (NPN_IsKindOfClass):
3115 (NPN_SetExceptionWithUTF8):
3118 (NPN_CreateNumberWithInt):
3119 (NPN_CreateNumberWithFloat):
3120 (NPN_CreateNumberWithDouble):
3121 (NPN_IntFromNumber):
3122 (NPN_FloatFromNumber):
3123 (NPN_DoubleFromNumber):
3125 (NPN_CreateStringWithUTF8):
3126 (NPN_CreateStringWithUTF16):
3127 (NPN_DeallocateUTF8):
3128 (NPN_UTF8FromString):
3129 (NPN_UTF16FromString):
3132 (NPN_CreateBoolean):
3133 (NPN_BoolFromBoolean):
3136 (undefinedAllocate):
3142 (NPN_ObjectAtIndex):
3143 * bindings/npruntime.h:
3144 * bindings/runtime.cpp:
3145 (Instance::createBindingForLanguageInstance):
3146 * bindings/testbindings.cpp:
3147 (initializeIdentifiers):
3167 2004-03-31 Richard Williamson <rjw@apple.com>
3169 Changed references to NP_runtime.h to npruntime.h
3171 * JavaScriptCore.pbproj/project.pbxproj:
3172 * bindings/NP_jsobject.h:
3173 * bindings/c/c_class.h:
3174 * bindings/c/c_instance.h:
3175 * bindings/c/c_runtime.h:
3176 * bindings/c/c_utility.h:
3177 * bindings/npruntime.cpp:
3179 2004-03-31 Richard Williamson <rjw@apple.com>
3181 Renamed NP_runtime.h to npruntime.h to match Netscape SDK.
3183 * JavaScriptCore.pbproj/project.pbxproj:
3184 * bindings/NP_jsobject.h:
3185 * bindings/npruntime.cpp:
3189 2004-03-23 Richard Williamson <rjw@apple.com>
3191 Added implementation of KJS::Value <-> NP_Object conversion functions.
3192 Augmented test program for 'C' bindings.
3193 Added asserts and parameter checking to all public API.
3197 * JavaScriptCore.pbproj/project.pbxproj:
3198 * bindings/NP_jsobject.cpp:
3200 * bindings/NP_jsobject.h: Added.
3201 * bindings/NP_runtime.cpp:
3202 (NP_IdentifierFromUTF8):
3203 (NP_IsValidIdentifier):
3204 (NP_GetIdentifiers):
3209 (NP_SetExceptionWithUTF8):
3212 (NP_FloatFromNumber):
3213 (NP_DoubleFromNumber):
3214 (NP_CreateStringWithUTF8):
3215 (NP_CreateStringWithUTF16):
3216 (NP_DeallocateUTF8):
3217 (NP_UTF8FromString):
3218 (NP_UTF16FromString):
3220 (NP_BoolFromBoolean):
3221 * bindings/NP_runtime.h:
3222 * bindings/c/c_instance.cpp:
3223 (CInstance::invokeMethod):
3224 * bindings/c/c_utility.cpp:
3225 (coerceValueToNPString):
3226 (convertValueToNPValueType):
3227 (convertNPValueTypeToValue):
3228 * bindings/c/c_utility.h:
3230 * bindings/testC.js: Added.
3231 * bindings/testbindings.cpp:
3241 (myInterfaceInvoke):
3242 (myInterfaceAllocate):
3246 2004-03-19 Darin Adler <darin@apple.com>
3250 - fixed problem with methods like setUTCHour
3252 * kjs/date_object.cpp: (DateProtoFuncImp::call): Fix conversion back to time_t to use the appropriate
3253 GMT vs. local time function based on the utc flag.
3255 2004-03-17 Richard Williamson <rjw@apple.com>
3257 Added a context parameter to result callbacks use by JavaScriptObject functions. This was a change requested by Eric Carlson on the QT plugin team.
3261 * bindings/NP_jsobject.cpp:
3266 (NP_GetPropertyAtIndex):
3267 * bindings/NP_runtime.h:
3269 2004-03-16 Richard Williamson <rjw@apple.com>
3271 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.
3275 * bindings/jni/jni_class.cpp:
3276 (JavaClass::methodsNamed):
3278 2004-03-15 Richard Williamson <rjw@apple.com>
3280 Fixed 3570854. Don't attempt to convert Null to strings. We
3281 were incorrectly converting to "Null".
3283 Actually fixed by Scott Kovatch.
3285 Reviewed by Richard.
3287 * bindings/jni/jni_utility.cpp:
3288 (KJS::Bindings::convertValueToJValue):
3292 2004-03-11 Richard Williamson <rjw@apple.com>
3294 Stitched together the NP stuff to our language independent
3295 JavaScript binding stuff. Very close to being done.
3297 Added program to test C bindings (and NP stuff). Just tests
3298 properties. Will add methods and JavaScript access, etc.
3300 Updated Makefile.am to account for new bindings/c directory.
3302 Change NP_UTF8 from "const char *" to "char" to allow for
3303 declarations like "const NP_UTF8 *" and "NP_UTF8 *". Ditto
3306 Added NP_IsValidIdentifier().
3310 * JavaScriptCore.pbproj/project.pbxproj:
3312 * bindings/NP_jsobject.cpp:
3313 (identiferFromNPIdentifier):
3315 * bindings/NP_runtime.cpp:
3316 (NP_IdentifierFromUTF8):
3317 (NP_IsValidIdentifier):
3318 (NP_GetIdentifiers):
3319 (NP_UTF8FromIdentifier):
3320 (NP_SetExceptionWithUTF8):
3322 (NP_CreateStringWithUTF8):
3323 (NP_CreateStringWithUTF16):
3324 (NP_UTF8FromString):
3325 (NP_UTF16FromString):
3326 * bindings/NP_runtime.h:
3327 * bindings/c/c_class.cpp: Added.
3328 (CClass::_commonDelete):
3329 (CClass::_commonCopy):
3330 (CClass::_commonInit):
3331 (_createClassesByIsAIfNecessary):
3332 (CClass::classForIsA):
3335 (CClass::methodsNamed):
3336 (CClass::fieldNamed):
3337 * bindings/c/c_class.h: Added.
3338 (KJS::Bindings::CClass::~CClass):
3339 (KJS::Bindings::CClass::CClass):
3340 (KJS::Bindings::CClass::operator=):
3341 (KJS::Bindings::CClass::constructorAt):
3342 (KJS::Bindings::CClass::numConstructors):
3343 * bindings/c/c_instance.cpp: Added.
3344 (CInstance::CInstance):
3345 (CInstance::~CInstance):
3346 (CInstance::operator=):
3347 (CInstance::getClass):
3350 (CInstance::invokeMethod):
3351 (CInstance::defaultValue):
3352 (CInstance::stringValue):
3353 (CInstance::numberValue):
3354 (CInstance::booleanValue):
3355 (CInstance::valueOf):
3356 * bindings/c/c_instance.h: Added.
3357 (KJS::Bindings::CInstance::getObject):
3358 * bindings/c/c_runtime.cpp: Added.
3359 (CField::valueFromInstance):
3360 (CField::setValueToInstance):
3361 * bindings/c/c_runtime.h: Added.
3362 (KJS::Bindings::CField::CField):
3363 (KJS::Bindings::CField::name):
3364 (KJS::Bindings::CField::type):
3365 (KJS::Bindings::CMethod::CMethod):
3366 (KJS::Bindings::CMethod::name):
3367 (KJS::Bindings::CMethod::numParameters):
3368 * bindings/c/c_utility.cpp: Added.
3369 (coerceValueToNPValueType):
3370 (convertValueToNPValueType):
3371 (convertNPValueTypeToValue):
3372 * bindings/c/c_utility.h: Added.
3373 * bindings/make_testbindings:
3374 * bindings/runtime.cpp:
3375 (Instance::createBindingForLanguageInstance):
3376 * bindings/runtime.h:
3377 (KJS::Bindings::Instance::):
3378 * bindings/testbindings.cpp: Added.
3379 (initializeIdentifiers):
3380 (myInterfaceHasProperty):
3381 (myInterfaceHasMethod):
3382 (myInterfaceGetProperty):
3383 (myInterfaceSetProperty):
3384 (myInterfaceInvoke):
3385 (myInterfaceAllocate):
3386 (myInterfaceInvalidate):
3387 (myInterfaceDeallocate):
3388 (GlobalImp::className):
3389 (readJavaScriptFromFile):
3392 2004-03-10 Richard Williamson <rjw@apple.com>
3394 Made changes to support new asychronous approach to calls from
3395 plugin to JavaScript
3399 * bindings/NP_jsobject.cpp:
3404 (NP_GetPropertyAtIndex):
3405 * bindings/NP_runtime.h:
3406 * bindings/make_testbindings:
3407 * bindings/runtime.cpp:
3408 (Instance::createBindingForLanguageInstance):
3410 2004-03-10 Richard Williamson <rjw@apple.com>
3412 Updated header to include proposed changes from
3413 plugin-futures list. Calls from plugin to JavaScript
3414 are now asynchronous.
3418 * bindings/NP_runtime.h:
3422 2004-03-04 Richard Williamson <rjw@apple.com>
3424 Implementation of NP_JavaScriptObject. This is the 'C' class
3425 that wraps a JavaScript object.
3429 * JavaScriptCore.pbproj/project.pbxproj:
3430 * bindings/NP_jsobject.cpp: Added.
3431 (coerceValueToNPValueType):
3432 (convertValueToNPValueType):
3433 (convertNPValueTypeToValue):
3437 (identiferFromNPIdentifier):
3442 (NP_RemoveProperty):
3444 (NP_GetPropertyAtIndex):
3445 (NP_SetPropertyAtIndex):
3446 * bindings/NP_runtime.cpp:
3448 * bindings/NP_runtime.h:
3449 * bindings/runtime_object.h:
3451 2004-03-04 Richard Williamson <rjw@apple.com>
3453 Added NP_Array implementation.
3455 Changed NP_Boolean to just depend on two static instances, no
3456 space is required for values.
3460 * bindings/NP_runtime.cpp:
3462 (NP_BoolFromBoolean):
3468 * bindings/NP_runtime.h:
3470 2004-03-03 Darin Adler <darin@apple.com>
3474 * English.lproj/InfoPlist.strings: Removed. No need to localize the version and
3475 copyright string, and that's all that was in here.
3476 * JavaScriptCore.pbproj/project.pbxproj: Removed InfoPlist.strings from build.
3478 2004-03-03 Richard Williamson <rjw@apple.com>
3480 More 'C' binding implementation. Fleshed out all the
3481 'primitive' data types.
3485 * bindings/NP_runtime.cpp:
3490 (NP_CreateStringWithUTF8):
3491 (NP_CreateStringWithUTF16):
3492 (NP_UTF8FromString):
3493 (NP_UTF16FromString):
3496 (booleanDeallocate):
3498 (NP_BoolFromBoolean):
3502 (undefinedAllocate):
3503 (undefinedDeallocate):
3505 * bindings/NP_runtime.h:
3507 2004-03-03 Richard Williamson <rjw@apple.com>
3509 More 'C' binding implementation.
3513 * bindings/NP_runtime.cpp:
3516 (getIdentifierDictionary):
3517 (NP_IdentifierFromUTF8):
3518 (NP_UTF8FromIdentifier):
3523 (NP_CreateNumberWithInt):
3524 (NP_CreateNumberWithFloat):
3525 (NP_CreateNumberWithDouble):
3527 (NP_FloatFromNumber):
3528 (NP_DoubleFromNumber):
3529 * bindings/NP_runtime.h:
3531 2004-03-02 Richard Williamson <rjw@apple.com>
3533 Removed retain/release from NP_Class. Classes will not be allowed to implement their
3534 own customer retain/release scheme.
3538 * bindings/NP_runtime.cpp:
3541 * bindings/NP_runtime.h:
3543 2004-03-02 Richard Williamson <rjw@apple.com>
3545 C binding API. Partial implementation.
3547 Completed ObjectiveC bindings (not based on the C API). These will re-implemented over the C binding API, but I wanted to get this code in the tree.
3549 Factored root object reference counting scheme. It is now useful independent