1 2005-04-12 Maciej Stachowiak <mjs@apple.com>
5 <rdar://problem/4089734> JavaScript iBench can be sped up ~10% with custom allocator
7 - use custom single-threaded malloc for all non-GC JavaScriptCore
8 allocations, for a 9.1% speedup on JavaScript iBench
10 * JavaScriptCore.pbproj/project.pbxproj:
12 (KJS::Collector::allocate): Use dlmalloc to allocate the collector blocks.
13 (KJS::Collector::collect): And dlfree to free it.
14 * kjs/fast_malloc.cpp: Added, just the standard dlmalloc here.
15 * kjs/fast_malloc.h: Added. Declarations for the functions. Also added a handy
16 macro to give a class custom operator new/delete
18 (KJS::Identifier::add): Use dlmalloc/dlfree.
19 * kjs/nodes.h: make nodes KJS_FAST_ALLOCATED.
20 * kjs/property_map.cpp:
21 (KJS::PropertyMap::~PropertyMap): Use dlmalloc/dlfree.
22 (KJS::PropertyMap::rehash): ditto
25 (KJS::UString::Rep::createCopying): New named constructor that copies a passed-in
26 buffer, to hide allocation details from webcore.
27 (KJS::UString::UString): use createCopying when appropriate.
28 (KJS::UString::Rep::destroy): Use dlmalloc/dlfree.
29 (KJS::UString::expandedSize): likewise
30 (KJS::UString::expandCapacity): likewise
31 (KJS::UString::expandPreCapacity): likewise
32 (KJS::UString::spliceSubstringsWithSeparators): likewise
33 (KJS::UString::append): likewise
34 (KJS::UString::operator=): likewise
35 (KJS::UString::detach): likewise
36 * kjs/ustring.h: make UString and UString::Rep KJS_FAST_ALLOCATED.
38 2005-04-11 Maciej Stachowiak <mjs@apple.com>
42 <rdar://problem/4086819> Avoid using protect count hash table so much for 5.6% JS iBench speedup
44 - Avoid using protected values hash for the two most common cases
45 - Bump up ListImp high water mark, new testing shows 508 ListImps are
46 created during JS iBench.
48 Net result is a 5.6% speedup on JavaScript iBench
51 (KJS::Collector::collect): mark protected lists as appropriate.
54 (KJS::ListImp::markValues): Moved implementation from List::markValues
55 (KJS::List::markProtectedLists): Implemented - scan pool and overflow
57 (KJS::allocateListImp): link lists outside the pool into a separate
58 doubly linked list to be able to mark protected lists
59 (KJS::deallocateListImp): do the corresponding delinking
60 (KJS::List::derefValues): do nothing in conservative GC mode
61 (KJS::List::refValues): do nothing in conservative GC mode
62 (KJS::List::markValues): call ListImp version
78 2005-03-16 Jens Alfke <jens@apple.com>
82 Fix for <rdar://problem/4025212> "REGRESSION (163-164): search not performed correctly; united.com"
83 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.
84 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.)
85 Darin says this regression occurred when we replaced our own implementation of unescape() with code from KJS.
88 (KJS::GlobalFuncImp::call):
90 2005-03-15 Richard Williamson <rjw@apple.com>
92 Fixed <rdar://problem/4053276> WebScripting protocol in WebKit cannot convert Boolean in Javascript to BOOL in Objective-C
94 Added JavaScript boolean to type that can be converted to
95 ObjC scalar parameters.
97 Reviewed by Ken Kocienda.
99 * bindings/objc/objc_utility.mm:
100 (KJS::Bindings::convertValueToObjcValue):
116 2005-02-21 Darin Adler <darin@apple.com>
118 * kjs/date_object.cpp: (timetUsingCF): Fixed indenting.
120 2005-02-17 Richard Williamson <rjw@apple.com>
122 Fixed <rdar://problem/4003251> Safari crashed at www.icelandair.com in LiveConnect code converting a Java object to a string
126 Reviewed by John Sullivan.
128 * bindings/jni/jni_runtime.cpp:
129 (JavaField::valueFromInstance):
133 2005-02-11 Richard Williamson <rjw@apple.com>
135 Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls
137 Re-factored how 'native' wrappers for JS objects are created. The interpreter now
138 creates these wrappers. The WebCore subclass of the interpreter now overrides
139 createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects.
143 * bindings/c/c_utility.cpp:
144 (convertValueToNPVariant):
145 * bindings/jni/jni_instance.cpp:
146 (JavaInstance::invokeMethod):
147 * bindings/jni/jni_objc.mm:
148 (KJS::Bindings::dispatchJNICall):
149 * bindings/jni/jni_runtime.cpp:
150 (JavaField::valueFromInstance):
151 (JavaArray::valueAt):
152 * bindings/objc/WebScriptObject.mm:
153 (-[WebScriptObject _setExecutionContext:KJS::Bindings::]):
154 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
155 * bindings/objc/WebScriptObjectPrivate.h:
156 * bindings/objc/objc_utility.h:
157 * bindings/objc/objc_utility.mm:
158 (KJS::Bindings::convertObjcValueToValue):
159 (KJS::Bindings::createObjcInstanceForValue):
160 * bindings/runtime.cpp:
161 (Instance::createBindingForLanguageInstance):
162 (Instance::createRuntimeObject):
163 (Instance::createLanguageInstanceForValue):
164 * bindings/runtime.h:
165 * kjs/interpreter.cpp:
166 (Interpreter::createLanguageInstanceForValue):
171 2005-02-10 Darin Adler <darin@apple.com>
173 "Reviewed" by Richard (he told me the file was obsolete).
175 - got rid of an obsolete file
177 * bindings/npsap.h: Removed.
183 2005-02-03 Richard Williamson <rjw@apple.com>
185 Fixed <rdar://problem/3972905> CrashTracer: ...36 crashes at com.apple.WebCore: khtml::CSSStyleSelector::applyDeclarations + 120
187 Revert to old (and correct) behavior of returning runtime object
188 when passed as a parameter, rather than it's corresponding DOM
193 * bindings/objc/WebScriptObject.mm:
194 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
198 2005-01-28 Richard Williamson <rjw@apple.com>
200 Fixed <rdar://problem/3980389> JavaScript bindings access incorrect runtime object
202 Only use special 'back door' property to get the runtime object if thisObj isn't
203 already a runtime object.
205 <gratuitous> Cleaned up a couple of strcmp on ClassInfo name. Used == on
206 ClassInfo pointer instead.
210 * bindings/c/c_utility.cpp:
211 (convertValueToNPVariant):
212 * bindings/objc/WebScriptObject.mm:
213 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
214 * bindings/runtime_method.cpp:
215 (RuntimeMethodImp::call):
219 2005-01-26 Richard Williamson <rjw@apple.com>
221 Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test
223 I added a member variable to ObjectImp. This changed it's size and consequently
224 hampered the optimizations built into the garbage collector. Objects no longer
225 fit within the allocators cell size, and thus allocation fell back to a slower
228 As a result of this fix I also dramatically cleaned up how runtime objects are
229 accessed. The path mostly *removes* code.
233 * bindings/runtime_method.cpp:
234 (RuntimeMethodImp::call):
235 * bindings/runtime_object.cpp:
236 (RuntimeObjectImp::get):
237 (RuntimeObjectImp::put):
238 (RuntimeObjectImp::canPut):
239 (RuntimeObjectImp::hasProperty):
240 (RuntimeObjectImp::defaultValue):
241 * bindings/runtime_object.h:
243 (KJS::ObjectImp::ObjectImp):
246 2005-01-20 Darin Adler <darin@apple.com>
248 Reviewed by me, changes by Han Ming Ong.
250 - <rdar://problem/3964302> SWB: A few files need to be updated to be compilable under GCC 4.0
252 * bindings/objc/WebScriptObjectPrivate.h: Make members public.
253 * kjs/lookup.h: Change "value.h" to "object.h" because we need KJS::Object to compile a template.
255 2005-01-20 Richard Williamson <rjw@apple.com>
257 Fixed <rdar://problem/3964634> undefined property value from binding seems to evaluate to true in an if statement
259 The comprehensive fix for this problem requires new API, as described in 3965326. However,
260 given that we can't add new API at this point, the 'ObjcFallbackObjectImp' will behave
261 like and Undefined object if invokeUndefinedMethodFromWebScript:withArguments: isn't
262 implemented on the bound object.
266 * bindings/objc/objc_runtime.h:
267 * bindings/objc/objc_runtime.mm:
268 (ObjcFallbackObjectImp::type):
269 (ObjcFallbackObjectImp::implementsCall):
270 (ObjcFallbackObjectImp::toBoolean):
271 * bindings/testbindings.mm:
272 (+[MyFirstInterface isSelectorExcludedFromWebScript:]):
273 (+[MyFirstInterface isKeyExcludedFromWebScript:]):
277 2005-01-19 Richard Williamson <rjw@apple.com>
279 Fixed <rdar://problem/3853676> Browser Crash when accessing CCWeb Progress Page - KJS::Bindings::convertValueToJValue
281 Fixed the following problems with LiveConnect that are demonstrated by the application
282 described in 3853676.
284 1. If a nil object is passed in an array from Java to JavaScript we will crash.
285 2. We sometimes will incorrectly attempt to access a generic JavaScript as a Java runtime object wrapper.
286 3. We will sometimes fail to find the correct static method ID.
290 * bindings/jni/jni_jsobject.cpp:
291 (JSObject::convertJObjectToValue):
292 (JSObject::listFromJArray):
293 * bindings/jni/jni_runtime.cpp:
294 (JavaField::valueFromInstance):
295 (JavaField::setValueToInstance):
296 * bindings/jni/jni_utility.cpp:
297 (KJS::Bindings::getMethodID):
298 (KJS::Bindings::convertValueToJValue):
299 * bindings/runtime_array.h:
301 2005-01-18 Richard Williamson <rjw@apple.com>
303 Fixed several issues all arising from analysis of plugin detection code at ifilm.com:
305 Fixed <rdar://problem/3958592> can't script plug-ins if plug-in is invoked with <object> element instead of <embed>
306 Fixed <rdar://problem/3958597> <object> elements with IDs do not show up as named properties of the document
307 Fixed <rdar://problem/3960973> DOM objects for plugin elements are not accessible
308 Fixed <rdar://problem/3958601> need an additional class ID in WebCore for the Real plug-in
310 We now support accessing scriptable plugin objects that are specified with <applet>, <embed>, or <object>
311 tags. Also, if any of these elements are named they can be accessed from the document or window objects.
312 Finally, DOM methods are properties will be forwarded appropriately for the plugin's root scriptable object.
316 * bindings/objc/objc_instance.h:
317 * bindings/objc/objc_instance.mm:
318 (ObjcInstance::supportsSetValueOfUndefinedField):
319 * bindings/runtime.h:
320 (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
321 * bindings/runtime_object.cpp:
322 (RuntimeObjectImp::RuntimeObjectImp):
323 (RuntimeObjectImp::get):
324 (RuntimeObjectImp::put):
325 (RuntimeObjectImp::canPut):
326 (RuntimeObjectImp::hasProperty):
327 (RuntimeObjectImp::defaultValue):
328 * bindings/runtime_object.h:
329 (KJS::RuntimeObjectImp::fallbackObject):
331 (KJS::ObjectImp::ObjectImp):
333 (KJS::ObjectImp::forwardingScriptMessage):
334 (KJS::ObjectImp::setForwardingScriptMessage):
336 2005-01-18 Richard Williamson <rjw@apple.com>
338 Back out a change that was incorrectly committed yesterday.
342 * bindings/objc/objc_utility.mm:
343 (KJS::Bindings::convertValueToObjcValue):
345 2005-01-17 Richard Williamson <rjw@apple.com>
347 Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)
349 Keep track of originating execution context and target execution
350 context for native JS object wrappers, and perform appropriate
353 Reviewed by David Harrison.
355 * bindings/NP_jsobject.cpp:
357 (_NPN_CreateScriptObject):
362 (_NPN_RemoveProperty):
366 * bindings/NP_jsobject.h:
367 * bindings/c/c_instance.cpp:
368 (CInstance::CInstance):
369 (CInstance::stringValue):
370 * bindings/c/c_instance.h:
371 * bindings/c/c_utility.cpp:
372 (convertValueToNPVariant):
373 * bindings/jni/jni_instance.cpp:
374 (JavaInstance::JavaInstance):
375 (JavaInstance::valueOf):
376 * bindings/jni/jni_instance.h:
377 * bindings/objc/WebScriptObject.mm:
378 (-[WebScriptObject _initializeWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
379 (-[WebScriptObject _initWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
380 (-[WebScriptObject KJS::Bindings::]):
381 (-[WebScriptObject _setOriginExecutionContext:KJS::Bindings::]):
382 (-[WebScriptObject _isSafeScript]):
383 (-[WebScriptObject callWebScriptMethod:withArguments:]):
384 (-[WebScriptObject evaluateWebScript:]):
385 (-[WebScriptObject setValue:forKey:]):
386 (-[WebScriptObject valueForKey:]):
387 (-[WebScriptObject removeWebScriptKey:]):
388 (-[WebScriptObject stringRepresentation]):
389 (-[WebScriptObject webScriptValueAtIndex:]):
390 (-[WebScriptObject setWebScriptValueAtIndex:value:]):
391 (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
392 * bindings/objc/WebScriptObjectPrivate.h:
393 * bindings/objc/objc_instance.h:
394 * bindings/objc/objc_runtime.mm:
395 (convertValueToObjcObject):
396 * bindings/objc/objc_utility.mm:
397 (KJS::Bindings::convertValueToObjcValue):
398 * bindings/runtime.cpp:
399 (Instance::Instance):
400 (Instance::operator=):
401 * bindings/runtime.h:
402 (KJS::Bindings::Instance::Instance):
403 (KJS::Bindings::Instance::setExecutionContext):
404 (KJS::Bindings::Instance::executionContext):
405 * bindings/runtime_root.cpp:
406 (RootObject::setInterpreter):
407 * bindings/runtime_root.h:
409 (KJS::Interpreter::isGlobalObject):
410 (KJS::Interpreter::interpreterForGlobalObject):
411 (KJS::Interpreter::isSafeScript):
415 2005-01-13 Vicki Murley <vicki@apple.com>
419 - fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005
421 * JavaScriptCore.pbproj/project.pbxproj: bump "2004" to "2005"
423 2005-01-12 Richard Williamson <rjw@apple.com>
425 Avoid additional work on dealloc by adding early out to
426 removeNativeReference(). (This will save time on dealloc
427 for all ObjC DOM objects.)
431 * bindings/runtime_root.cpp:
432 (KJS::Bindings::removeNativeReference):
434 2005-01-12 Richard Williamson <rjw@apple.com>
436 Fixed <rdar://problem/3923356> REGRESSION: Java/JavaScript security checks working incorrectly
438 We were always returning the first "root" object for all runtime
439 objects. Changed 0 in loop to i, the index.
441 Reviewed by David Harrison.
443 * bindings/runtime_root.cpp:
444 (KJS::Bindings::rootForImp):
446 2005-01-11 Richard Williamson <rjw@apple.com>
448 Fixed <rdar://problem/3887930> Must use new Java plug-in API to get/set fields so exception handling works (fixes many LiveConnect crashes)
450 Use the new dispatching API to invoke JNI, rather than calling JNI
453 Reviewed by David Harrison.
455 * bindings/jni/jni_instance.cpp:
456 (JavaInstance::invokeMethod):
457 * bindings/jni/jni_runtime.cpp:
458 (JavaField::dispatchValueFromInstance):
459 (JavaField::valueFromInstance):
460 (JavaField::dispatchSetValueToInstance):
461 (JavaField::setValueToInstance):
462 * bindings/jni/jni_runtime.h:
463 * bindings/jni/jni_utility.cpp:
464 (KJS::Bindings::convertValueToJValue):
472 2004-12-17 Maciej Stachowiak <mjs@apple.com>
476 <rdar://problem/3926869> Opening caches window after running PLT causes crash
478 * kjs/protected_values.cpp:
479 (KJS::ProtectedValues::getProtectCount): Don't include simple numbers in
480 the protected value table.
481 (KJS::ProtectedValues::increaseProtectCount): Ditto.
482 (KJS::ProtectedValues::decreaseProtectCount): Ditto.
484 2004-12-16 Darin Adler <darin@apple.com>
488 - fixed <rdar://problem/3920764> Unimplemented String methods toLocaleLowerCase and toLocaleUpperCase
490 * kjs/string_object.h: Added toLocaleLowerCase and toLocaleUpperCase.
491 * kjs/string_object.cpp: (StringProtoFuncImp::call): Made locale versions be synonmyms for the
492 non-locale-specific versions.
493 * kjs/string_object.lut.h: Regenerated.
495 2004-12-14 Richard Williamson <rjw@apple.com>
497 Pass URL of plugin view when call into JNI.
501 * bindings/jni/jni_objc.mm:
502 (KJS::Bindings::dispatchJNICall):
504 2004-12-13 Richard Williamson <rjw@apple.com>
506 Fixed <rdar://problem/3827799> repro. crash with IBM Rational ClearCase Web under Safari (Java/LiveConnect-related)
508 Add support for calling static Java methods from JavaScript.
512 * bindings/jni/jni_instance.cpp:
513 (JavaInstance::invokeMethod):
514 * bindings/jni/jni_runtime.cpp:
515 (JavaMethod::JavaMethod):
516 * bindings/jni/jni_runtime.h:
517 (KJS::Bindings::JavaMethod::isStatic):
518 * bindings/jni/jni_utility.cpp:
519 (callJNIStaticMethod):
520 (KJS::Bindings::callJNIBooleanMethod):
521 (KJS::Bindings::callJNIStaticBooleanMethod):
522 * bindings/jni/jni_utility.h:
524 2004-12-13 Richard Williamson <rjw@apple.com>
526 Fixed <rdar://problem/3887767> LiveConnect doesn't propagate Java exceptions back to JavaScript (prevents security suite from running)
530 * bindings/jni/jni_instance.cpp:
531 (JavaInstance::invokeMethod):
532 * bindings/jni/jni_objc.mm:
533 (KJS::Bindings::dispatchJNICall):
534 * bindings/jni/jni_runtime.h:
535 * bindings/jni/jni_utility.h:
539 2004-12-07 Maciej Stachowiak <mjs@apple.com>
543 <rdar://problem/3908017> REGRESSION (172-173): assertion in ObjectImp::construct trying to create JS error (24hourfitness.com)
545 The fix was to implement copy constructor and assignment operator,
546 the ones that worked on the base class did not replace the
550 (KJS::ProtectedValue::ProtectedValue):
551 (KJS::ProtectedValue::operator=):
552 (KJS::ProtectedObject::ProtectedObject):
553 (KJS::ProtectedObject::operator=):
555 Also fixed a bug in the GC test mode that compares the results of
556 the old collector and the new collector.
563 2004-11-23 Richard Williamson <rjw@apple.com>
565 Fixed <rdar://problem/3890385> field and method cache incorrectly capped (c bindings)
569 * bindings/c/c_class.cpp:
570 (CClass::_commonInit):
572 2004-11-21 Maciej Stachowiak <mjs@apple.com>
576 <rdar://problem/3889696> Enable conservative garbage collection for JavaScript
579 (KJS::Collector::Thread::Thread):
580 (KJS::destroyRegisteredThread):
581 (KJS::initializeRegisteredThreadKey):
582 (KJS::Collector::registerThread):
583 (KJS::Collector::markStackObjectsConservatively):
584 (KJS::Collector::markCurrentThreadConservatively):
585 (KJS::Collector::markOtherThreadConservatively):
593 2004-11-15 Richard Williamson <rjw@apple.com>
595 Fixed <rdar://problem/3880561> Default string value of ObjC object in JS should be [obj description].
599 * bindings/objc/objc_instance.mm:
600 (ObjcInstance::stringValue):
601 * bindings/objc/objc_utility.h:
602 * bindings/objc/objc_utility.mm:
603 (KJS::Bindings::convertNSStringToString):
604 (KJS::Bindings::convertObjcValueToValue):
608 2004-11-09 Chris Blumenberg <cblu@apple.com>
610 Fixed: <rdar://problem/3872724> soft link against JavaVM to save ~2MB RSHRD
615 * JavaScriptCore.pbproj/project.pbxproj: don't link against JavaVM
616 * bindings/softlinking.c: Added.
618 (getFunctionPointer): new
619 (JNI_GetCreatedJavaVMs): load JavaVM if not already loaded, get _JNI_GetCreatedJavaVMs symbol if we don't already have it, call JNI_GetCreatedJavaVMs
623 2004-11-04 Darin Adler <darin@apple.com>
627 - fixed <rdar://problem/3865365> since -[WebScriptObject dealloc] does not call [super dealloc], the build will fail due to a warning
628 - fixed behavior so that [[WebScriptObject alloc] initWithCoder:] doesn't leak WebUndefined instances
629 and incidentally so that [[WebScriptObject alloc] init] returns the single shared instance rather
630 than allocating a new one
632 * bindings/objc/WebScriptObject.mm: Removed some stray semicolons.
633 (+[WebUndefined allocWithZone:]): Made this the common bottleneck that returns the single instance
634 of WebUndefined, since it's the single method that normally allocates new instances. Calls super to
635 actually allocate only the very first time it's called.
636 (-[WebUndefined initWithCoder:]): Simplified to just return self (no reason to re-lookup the single
637 shared instance since there can be only one).
638 (-[WebUndefined copyWithZone:]): Ditto.
639 (-[WebUndefined retain]): Ditto.
640 (-[WebUndefined retainCount]): Use UINT_MAX constant here (matches usage in NSObject.m for retain count
642 (-[WebUndefined autorelease]): Simplified to just return self (see above).
643 (-[WebUndefined copy]): No need to override this since it just turns around and calls copyWithZone:.
644 (-[WebUndefined dealloc]): Added an assertion since this method should never be called. Also added
645 a call to [super dealloc] after return; to make the new -Wdealloc-check compiler happy (fixing the
646 bug mentioned above).
647 (+[WebUndefined undefined]): Reimplemented; calls allocWithZone:NULL to get to the shared instance.
648 No need to call init, since that's a no-op for this class.
650 2004-11-03 David Harrison <harrison@apple.com>
654 Eliminate the use of a marker file to determine how to build.
659 2004-11-01 Richard Williamson <rjw@apple.com>
661 Fixed <rdar://problem/3861469> Latest Real player crashes Safari on some sites.
665 * bindings/c/c_instance.cpp:
666 (CInstance::invokeMethod):
667 (CInstance::invokeDefaultMethod):
668 Initialize out parameters to void type.
670 * bindings/c/c_runtime.cpp:
671 (CField::valueFromInstance):
672 (CField::setValueToInstance):
673 Initialize out parameters to void type.
674 Also added additional checks to protect against classes that
675 don't implement all functions.
677 2004-11-01 Richard Williamson <rjw@apple.com>
679 Fixed <rdar://problem/3861257> WebUndefined should be returned for undefined values
684 * bindings/objc/WebScriptObject.mm:
685 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
686 Added additional conversion Undefined -> WebUndefined.
687 * bindings/objc/objc_utility.mm:
688 (KJS::Bindings::convertObjcValueToValue):
689 Added additional conversion WebUndefined -> Undefined.
691 2004-11-01 Darin Adler <darin@apple.com>
693 - fixed <rdar://problem/3855573> Remove reference to "WebScriptMethods" from WebScriptObject.h comments
695 * bindings/objc/WebScriptObject.h: Removed unneeded #ifdef protection for multiple includes (since
696 this is an Objective-C header and we use #import for those). Fixed comments as requested in the bug
697 report to match the contents of the file.
703 2004-10-22 Ken Kocienda <kocienda@apple.com>
707 * JavaScriptCore.pbproj/project.pbxproj:
708 Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
712 2004-10-13 Richard Williamson <rjw@apple.com>
714 Moved boolean checks prior to NSNumber checks. booleans are
717 Follow on to <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number.
721 * bindings/objc/objc_utility.mm:
722 (KJS::Bindings::convertObjcValueToValue):
724 2004-10-12 Richard Williamson <rjw@apple.com>
726 Fixed access to DOM object via WebScriptObject API.
727 The execution context for DOM objects wasn't being found.
728 <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
732 * bindings/objc/WebScriptObject.mm:
734 (-[WebScriptObject KJS::Bindings::]):
735 (-[WebScriptObject callWebScriptMethod:withArguments:]):
736 (-[WebScriptObject evaluateWebScript:]):
737 (-[WebScriptObject setValue:forKey:]):
738 (-[WebScriptObject valueForKey:]):
739 (-[WebScriptObject stringRepresentation]):
740 * bindings/objc/WebScriptObjectPrivate.h:
742 2004-10-09 Darin Adler <darin@apple.com>
746 - fixed <rdar://problem/3804661> REGRESSION: JavaScriptCore framework now has two init routines
748 * bindings/NP_jsobject.cpp: Fixed unnecessarily-complex globals set up that was
749 creating an init routine.
751 * kjs/ustring.cpp: Changed around the UString::Rep::empty construction to not
752 require a global constructor that creates an init routine.
754 2004-10-09 Darin Adler <darin@apple.com>
758 - fixed <rdar://problem/3822618> REGRESSION (164-165): expedia.com's popup help doesn't work
760 * kjs/reference.cpp: (Reference::putValue): Change so that references not found in any object
761 work with the window object of the page the function is in, not the page of the caller. This
762 is what all other browsers do. This code was hidden before by the "everything is defined on
763 window object" hack in WebCore.
765 2004-10-07 Richard Williamson <rjw@apple.com>
767 Added simple JavaScript call tracing. Very useful for
768 debugging complex pages.
770 Tracing is only available in development builds and is
773 (gdb) set traceJavaScript = 1
777 setTraceJavaScript(true)
779 Function, args, and return values are printed to console. Very
784 * kjs/function_object.cpp:
785 (FunctionProtoFuncImp::call):
791 2004-10-05 Richard Williamson <rjw@apple.com>
793 Fixed <rdar://problem/3819234> NPN_SetException (and throwException:) isn't implemented
797 * bindings/NP_jsobject.cpp:
799 * bindings/npruntime.cpp:
800 (_NPN_SetExceptionWithUTF8):
801 * bindings/objc/WebScriptObject.mm:
802 (+[WebScriptObject throwException:]):
804 (KJS::InterpreterImp::context):
806 2004-10-05 Richard Williamson <rjw@apple.com>
808 Fixed <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number
812 * bindings/objc/objc_utility.mm:
813 (KJS::Bindings::convertObjcValueToValue):
815 2004-10-04 Darin Adler <darin@apple.com>
819 - rolled in a fix the KDE folks did for the operations that generate HTML fragments
821 * kjs/string_object.cpp: (StringProtoFuncImp::call): Added quote marks to generated HTML.
823 - rolled out an old workaround we don't need any more
825 * JavaScriptCore.pbproj/project.pbxproj: Remove -Wno-long-double because the <math.h> issue that
826 required it is no longer there.
828 2004-09-30 Richard Williamson <rjw@apple.com>
830 Fixed <rdar://problem/3821215> NPN hasMethod and hasProperty functions should take NPObjects, not NPClass
834 * bindings/NP_jsobject.cpp:
838 * bindings/c/c_class.cpp:
839 (CClass::methodsNamed):
840 (CClass::fieldNamed):
841 * bindings/c/c_class.h:
842 * bindings/c/c_instance.cpp:
843 (CInstance::invokeMethod):
844 * bindings/jni/jni_class.cpp:
845 (JavaClass::methodsNamed):
846 * bindings/jni/jni_class.h:
847 * bindings/npruntime.h:
848 * bindings/objc/objc_class.h:
849 * bindings/objc/objc_class.mm:
850 (ObjcClass::methodsNamed):
851 * bindings/runtime.h:
852 * bindings/runtime_object.cpp:
853 (RuntimeObjectImp::get):
854 (RuntimeObjectImp::hasProperty):
856 2004-09-29 Chris Blumenberg <cblu@apple.com>
858 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.
862 * JavaScriptCore.pbproj/project.pbxproj:
863 * bindings/NP_jsobject.cpp:
864 (_NPN_CreateScriptObject):
865 (_NPN_InvokeDefault):
870 (_NPN_RemoveProperty):
873 * bindings/c/c_class.cpp:
874 (CClass::methodsNamed):
875 (CClass::fieldNamed):
876 * bindings/c/c_instance.cpp:
877 (CInstance::CInstance):
878 (CInstance::~CInstance):
879 (CInstance::operator=):
880 (CInstance::invokeMethod):
881 (CInstance::invokeDefaultMethod):
882 * bindings/c/c_runtime.cpp:
883 * bindings/c/c_runtime.h:
884 (KJS::Bindings::CField::name):
885 (KJS::Bindings::CMethod::name):
886 * bindings/npruntime.cpp:
887 (_NPN_GetStringIdentifier):
888 (_NPN_GetStringIdentifiers):
889 (_NPN_GetIntIdentifier):
890 (_NPN_IdentifierIsString):
891 (_NPN_UTF8FromIdentifier):
892 (_NPN_IntFromIdentifier):
893 (NPN_InitializeVariantWithObject):
894 (_NPN_ReleaseVariantValue):
897 (_NPN_ReleaseObject):
898 (_NPN_SetExceptionWithUTF8):
901 2004-09-26 Darin Adler <darin@apple.com>
903 * kjs/string_object.cpp: (StringProtoFuncImp::call): Remove strange use of high() and
904 low() to get Unicode value of character, and just use unicode().
906 2004-09-26 Darin Adler <darin@apple.com>
908 - refine charAt/charCodeAt fix slightly
910 * kjs/string_object.cpp: (StringProtoFuncImp::call): Treat undefined the same was as an
911 omitted parameter, as we do everywhere else, and as other browsers do here.
913 2004-09-26 Darin Adler <darin@apple.com>
917 - fixed <rdar://problem/3816097> REGRESSION: mailblocks, and presumably many other pages, failing because variable not found
919 * kjs/internal.cpp: (InterpreterImp::evaluate): Process variable declarations before executing
920 the program. We were doing this properly for functions, but not entire programs.
922 - fixed <rdar://problem/3814706> REGRESSION: text fields in mailblocks wizards do not accept keystrokes due to use of charCodeAt()
924 * kjs/string_object.cpp: (StringProtoFuncImp::call): Changed the implementation of charAt
925 and charCodeAt to treat a missing parameter as an index of 0, rather than an invalid index.
927 * tests/mozilla/expected.html: Update for two tests that now pass with these changes.
933 2004-09-14 Richard Williamson <rjw@apple.com>
935 1. Add class parameter to object allocation function. This is somewhat redundant, given that
936 the allocation function is in the class function vector, but people wanted to use the same
937 allocation function for different classes.
939 2. Renamed NPN_Class to NPN_Invoke to match the name in the function vector.
941 3. Add support for a default function on an object. This is a feature that ActiveX supports,
942 and will allow JavaScript code to be written that will look exactly the same for both ActiveX
943 plugins and Netscape or WebKit plugins. There are implementations included for the 'C' and
944 'Objective-C' bindings.
946 There bugs are covered by
948 <rdar://problem/3776343> Support for default functions in the JavaScript bindings
949 <rdar://problem/3779186> NPN_Call needs to be renamed to NPN_Invoke
950 <rdar://problem/3674754> Need to implement latest npruntime.h
954 * bindings/NP_jsobject.cpp:
958 * bindings/c/c_class.cpp:
959 * bindings/c/c_instance.cpp:
960 (CInstance::CInstance):
961 (CInstance::operator=):
962 (CInstance::invokeMethod):
963 (CInstance::invokeDefaultMethod):
964 * bindings/c/c_instance.h:
965 * bindings/c/c_runtime.cpp:
966 * bindings/c/c_runtime.h:
967 * bindings/jni/jni_instance.cpp:
968 (JavaInstance::invokeDefaultMethod):
969 * bindings/jni/jni_instance.h:
970 * bindings/npruntime.cpp:
972 * bindings/npruntime.h:
973 * bindings/objc/WebScriptObject.h:
974 * bindings/objc/objc_class.mm:
975 (ObjcClass::fallbackObject):
976 * bindings/objc/objc_instance.h:
977 * bindings/objc/objc_instance.mm:
978 (ObjcInstance::invokeDefaultMethod):
979 * bindings/objc/objc_runtime.h:
980 * bindings/objc/objc_runtime.mm:
981 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
982 (ObjcFallbackObjectImp::get):
983 (ObjcFallbackObjectImp::put):
984 (ObjcFallbackObjectImp::canPut):
985 (ObjcFallbackObjectImp::implementsCall):
986 (ObjcFallbackObjectImp::call):
987 (ObjcFallbackObjectImp::hasProperty):
988 (ObjcFallbackObjectImp::deleteProperty):
989 (ObjcFallbackObjectImp::defaultValue):
990 * bindings/runtime.h:
991 (KJS::Bindings::Class::fallbackObject):
992 (KJS::Bindings::Instance::getValueOfUndefinedField):
993 (KJS::Bindings::Instance::setValueOfUndefinedField):
994 (KJS::Bindings::Instance::valueOf):
995 * bindings/runtime_object.cpp:
996 (RuntimeObjectImp::implementsCall):
997 (RuntimeObjectImp::call):
998 * bindings/runtime_object.h:
1000 2004-09-13 Maciej Stachowiak <mjs@apple.com>
1004 <rdar://problem/3794735> Gmail- sending a very long message with Safari is so slow it seems like a hang
1006 * kjs/string_object.cpp:
1007 (StringProtoFuncImp::call): Replaced implementation of replace()
1008 method with function below...
1009 (replace): In order to avoid excessive allocation and copying,
1010 figure out the ranges of the original string and replacement
1011 strings to be assembled, instead of constantly creating new
1012 strings at each substitution. The old behavior is basically O(N^2)
1013 for a global replace on a pattern that matches many places in the
1015 (regExpIsGlobal): Helper function for the above.
1016 (expandSourceRanges): ditto
1017 (pushSourceRange): ditto
1018 (expandReplacements): ditto
1019 (pushReplacement): ditto
1021 (KJS::UString::spliceSubstringsWithSeparators): New method that
1022 pieces together substring ranges of this string together with
1023 specified separators, all at one go.
1025 (KJS::UString::Range::Range): Added new helper class to represent
1028 2004-09-14 Maciej Stachowiak <mjs@apple.com>
1032 - fixed <rdar://problem/3800315> encode-URI-test layout test is failing
1035 (KJS::GlobalFuncImp::call): Make sure to escape null
1036 characters. This is a bug in the new code that made part of the
1039 2004-09-13 Darin Adler <darin@apple.com>
1041 Reviewed by Kevin and Maciej.
1043 - new function to support fix for DIG bug in WebCore
1045 * kjs/scope_chain.h: Added new push function that pushes another entire scope chain.
1046 * kjs/scope_chain.cpp: (KJS::ScopeChain::push): Ditto.
1048 2004-09-12 Darin Adler <darin@apple.com>
1050 * tests/mozilla/expected.html: Updated test results for 3 more tests that pass with the new version
1051 of escape and unescape.
1053 2004-09-12 Darin Adler <darin@apple.com>
1057 - fixed <rdar://problem/3798209> any non-ASCII characters are garbled in the result of toLocaleString
1059 * kjs/date_object.cpp:
1060 (formatLocaleDate): Replaced two old functions that used LongDateTime with this one new function that
1061 uses CFDateFormatter.
1062 (DateProtoFuncImp::call): Call the new formatLocaleDate instead of both formatLocaleDate and formatLocaleTime.
1064 2004-09-09 Maciej Stachowiak <mjs@apple.com>
1066 Reviewed by Richard.
1068 <rdar://problem/3493140> REGRESSION (85-100): cedille displays %-escaped in JavaScript message at hotmail.com
1071 (KJS::GlobalFuncImp::call): Replace our escape() and unescape() implementations with
1072 ones from KDE KJS, which have the proper latin-1 behavior to match Win IE.
1074 (Lexer::isHexDigit): Made static and non-const.
1079 2004-09-06 Darin Adler <darin@apple.com>
1081 * JavaScriptCore.pbproj/project.pbxproj: Bump MACOSX_DEPLOYMENT_TARGET to 10.3.
1085 2004-09-01 Richard Williamson <rjw@apple.com>
1087 Add pid to exception messages (to help debug dashboard clients).
1091 * kjs/interpreter.cpp:
1092 (Interpreter::evaluate):
1096 2004-08-20 Richard Williamson <rjw@apple.com>
1098 Implemented new JNI abstraction. We no longer invoke Java methods
1099 directly with JNI, rather we call into the plugin. This allows the
1100 plugin to dispatch the call to the appropriate VM thread. This
1101 change should (will?) fix a whole class of threading related problems with
1106 * JavaScriptCore.pbproj/project.pbxproj:
1107 * bindings/c/c_instance.h:
1108 (KJS::Bindings::CInstance::setExecutionContext):
1109 (KJS::Bindings::CInstance::executionContext):
1110 * bindings/jni/jni_instance.cpp:
1111 (JavaInstance::JavaInstance):
1112 (JavaInstance::invokeMethod):
1113 (JavaInstance::setExecutionContext):
1114 (JavaInstance::executionContext):
1115 * bindings/jni/jni_instance.h:
1116 * bindings/jni/jni_jsobject.cpp:
1117 (JSObject::convertJObjectToValue):
1118 * bindings/jni/jni_runtime.cpp:
1119 (JavaField::JavaField):
1120 (JavaArray::convertJObjectToArray):
1121 (JavaField::valueFromInstance):
1122 (JavaArray::JavaArray):
1123 (JavaArray::valueAt):
1124 * bindings/jni/jni_runtime.h:
1125 (KJS::Bindings::JavaArray::operator=):
1126 (KJS::Bindings::JavaArray::executionContext):
1127 * bindings/jni/jni_utility.h:
1128 * bindings/objc/objc_instance.h:
1129 (KJS::Bindings::ObjcInstance::setExecutionContext):
1130 (KJS::Bindings::ObjcInstance::executionContext):
1131 * bindings/runtime.cpp:
1132 (Instance::createBindingForLanguageInstance):
1133 * bindings/runtime.h:
1134 * bindings/runtime_root.h:
1135 (KJS::Bindings::RootObject::nativeHandle):
1139 2004-08-19 Vicki Murley <vicki@apple.com>
1143 * kjs/property_map.cpp:
1144 (KJS::PropertyMap::put): initialize deletedElementIndex to zero, to make the compiler happy
1146 2004-08-17 Darin Adler <darin@apple.com>
1150 - fixed <rdar://problem/3746676> SAP WebDynpro app hangs inside JavaScript property map hash table code (deleted sentinel problem)
1152 * kjs/property_map.h: Added some private functions.
1153 * kjs/property_map.cpp:
1154 (KJS::PropertyMap::clear): Set sentinelCount to 0.
1155 (KJS::PropertyMap::put): Complete search for the element before choosing to use the deleted-element sentinel.
1156 Also keep sentinel count up to date when we destroy a sentinel by overwriting with a new added element.
1157 (KJS::PropertyMap::expand): Added. Calls rehash with a size 2x the old size, or 16.
1158 (KJS::PropertyMap::rehash): Added. Refactored the rehash code into a separate function.
1159 (KJS::PropertyMap::remove): Add one to sentinelCount, and rehash if 1/4 or more of the elements are
1160 deleted-element sentinels.
1161 (KJS::PropertyMap::checkConsistency): Check the sentinelCount.
1163 2004-08-16 Maciej Stachowiak <mjs@apple.com>
1165 Code change by Eric Albert, reviewd by me.
1167 <rdar://problem/3571960> washingtonpost.com claims I don't have cookies enabled and won't let me read articles
1169 * kjs/date_object.cpp:
1170 (timetUsingCF): Clamp time to LONG_MAX (getting rid of time_t
1171 entirely would be even better, but is not required to fix this bug.
1175 2004-08-16 Richard Williamson <rjw@apple.com>
1177 Fixed <rdar://problem/3581092> cash in KJS::Bindings::JSObject::eval at tcvetantcvetkov.com
1179 Adds bullet proofing to protect against evaluation of bogus JS in all the flavors of bindings (Java, C, and ObjC).
1183 * bindings/NP_jsobject.cpp:
1185 * bindings/jni/jni_jsobject.cpp:
1187 * bindings/objc/WebScriptObject.mm:
1188 (-[WebScriptObject evaluateWebScript:]):
1190 2004-08-15 Richard Williamson <rjw@apple.com>
1192 More updates to np headers. Implemented new NPN functions.
1196 * bindings/NP_jsobject.cpp:
1200 * bindings/npruntime.h:
1202 2004-08-13 Darin Adler <darin@apple.com>
1204 - fix build so we can compile again
1206 * bindings/npapi.h: Added. Richard forgot to check this in. The one I'm checking in here
1207 is good enough so that we can compile, but it's only a stopgap measure, because I think
1208 Richard has a newer one he wants to check in.
1210 2004-08-12 Richard Williamson <rjw@apple.com>
1212 Bring npruntime.h and friends closer to compliance with
1217 * JavaScriptCore.pbproj/project.pbxproj:
1218 * bindings/NP_jsobject.cpp:
1220 (_NPN_CreateScriptObject):
1225 (NPN_RemoveProperty):
1226 * bindings/NP_jsobject.h:
1227 * bindings/c/c_instance.cpp:
1228 (CInstance::invokeMethod):
1229 * bindings/c/c_utility.cpp:
1230 (convertNPVariantToValue):
1231 * bindings/npruntime.cpp:
1232 (NPN_IdentifierIsString):
1233 (NPN_VariantIsVoid):
1234 (NPN_VariantIsNull):
1235 (NPN_VariantIsUndefined):
1236 (NPN_VariantIsBool):
1237 (NPN_VariantIsInt32):
1238 (NPN_VariantIsDouble):
1239 (NPN_VariantIsString):
1240 (NPN_VariantIsObject):
1241 (NPN_VariantToBool):
1242 (NPN_VariantToString):
1243 (NPN_VariantToInt32):
1244 (NPN_VariantToDouble):
1245 (NPN_VariantToObject):
1246 (NPN_InitializeVariantAsVoid):
1247 (NPN_InitializeVariantAsNull):
1248 (NPN_InitializeVariantAsUndefined):
1249 (NPN_InitializeVariantWithBool):
1250 (NPN_InitializeVariantWithInt32):
1251 (NPN_InitializeVariantWithDouble):
1252 (NPN_InitializeVariantWithString):
1253 (NPN_InitializeVariantWithStringCopy):
1254 (NPN_InitializeVariantWithObject):
1255 (NPN_InitializeVariantWithVariant):
1256 (NPN_ReleaseVariantValue):
1258 * bindings/npruntime.h:
1260 (_NPString::_NPVariant::):
1261 * bindings/npruntime_priv.h: Added.
1263 2004-08-12 Darin Adler <darin@apple.com>
1267 - fixed 3 problems with parse functions that I just wrote, fixing 3 more Mozilla JavaScript tests
1270 (KJS::parseDigit): Fix typo, 'Z' instead of 'z', that prevented lowercase hex digits from working.
1271 (KJS::parseInt): Add octal support. Specification says it's optional, but I guess not.
1272 (KJS::parseFloat): Fix check for "0x" in parseFloat to return 0 rather than NaN. Also add code
1273 to skip leading "+" or "-".
1277 2004-08-12 Darin Adler <darin@apple.com>
1281 - fixed 43 Mozilla JavaScript tests
1283 * kjs/date_object.h: Change parseDate and timeClip to take and return doubles.
1284 * kjs/date_object.cpp:
1285 (DateObjectImp::construct): Change to use a timeClip function that takes and returns a double rather
1286 than constructing a number object to pass to it.
1287 (DateObjectFuncImp::call): Change to use a parseDate function that returns a double.
1288 (KJS::parseDate): Change to return a double instead of creating the Number object here.
1289 (KJS::timeClip): Implement this as specified in the language standard.
1291 * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set the DontDelete, ReadOnly, and DontEnum
1292 flags on the prototype property.
1295 (KJS::FunctionImp::get): Return null rather than undefined for arguments when the function is not
1297 (KJS::isStrWhiteSpace): Added. Matches specification for StrWhiteSpace. Could move it to some utility
1299 (KJS::parseDigit): Added. Helper function for parseInt.
1300 (KJS::parseInt): Added. Integer parser that puts result in a double so we're not limited to what
1301 strtoll can handle. Also matches standard more closely.
1302 (KJS::parseFloat): Added. Handles "0x" properly and passes flag to make empty string turn into NaN
1304 (KJS::GlobalFuncImp::call): Use the new parseInt and parseFloat.
1306 * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Add a length property.
1308 * kjs/lexer.h: Added error flag and sawError() function for detecting errors.
1310 (Lexer::setCode): Clear error state.
1311 (Lexer::lex): Set error state if the lexer encounters an error
1314 (NumberImp::toString): Roll in change from KDE version to special case 0 so we handle -0 correctly.
1315 (Parser::parse): Use new lexer error method so those errors are treated like parser errors.
1317 * kjs/math_object.cpp: (MathFuncImp::call): Change min and max to treat -0 as less than +0.
1318 Change round to round values between -0.5 and -0 to -0 instead of +0.
1320 * kjs/nodes.h: Add evaluateReference function to GroupNode.
1321 * kjs/nodes.cpp: (GroupNode::evaluateReference): Pass references through groups (parenthesized
1322 expressions) properly so that expressions like "delete (x.y)" work. Before, the parentheses
1323 would change x.y into a value that can't be deleted as a side effect.
1325 * kjs/string_object.cpp: Change parameter count for indexOf and lastIndexOf from 2 to 1 to match
1328 * kjs/testkjs.cpp: Rolled in changes from KDE to add a "quit" function to the test tool and
1329 get rid of the fixed size limit for code.
1331 * kjs/ustring.cpp: (KJS::UString::substr): Added optimized case for substr(0, length) so it just
1332 returns the string without creating a new Rep, since I'm using substr in a place where it will
1333 often be passed a 0.
1335 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed one wrong entry in the Unicode table I added to
1336 the other day that was making a couple tests fail.
1337 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
1338 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
1339 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
1340 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
1341 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
1343 * kjs/string_object.lut.h: Regenerated.
1345 2004-08-11 Darin Adler <darin@apple.com>
1347 - fixed a tiny problem with the UTF-16 PCRE check-in
1349 * pcre/maketables.c: (pcre_maketables): Fix mistake in table-generating code that sometimes caused
1350 the ctype_meta flag to get set in items that should not have it.
1352 * pcre/chartables.c: Regenerated.
1354 2004-08-10 Richard Williamson <rjw@apple.com>
1356 Fixed <rdar://problem/3674747> Need to implement invokeUndefinedMethodFromWebScript:withArguments:
1358 The following WebScripting methods are now supported on bound
1361 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args;
1362 - (void)setValue:(id)value forUndefinedKey:(NSString *)key
1363 - (id)valueForUndefinedKey:(NSString *)key
1367 * bindings/c/c_class.cpp:
1368 (CClass::fieldNamed):
1369 * bindings/c/c_class.h:
1370 * bindings/jni/jni_class.cpp:
1371 (JavaClass::fieldNamed):
1372 * bindings/jni/jni_class.h:
1373 * bindings/objc/objc_class.h:
1374 (KJS::Bindings::ObjcClass::isa):
1375 * bindings/objc/objc_class.mm:
1376 (ObjcClass::methodsNamed):
1377 (ObjcClass::fieldNamed):
1378 (ObjcClass::fallbackObject):
1379 * bindings/objc/objc_instance.h:
1380 * bindings/objc/objc_instance.mm:
1381 (ObjcInstance::invokeMethod):
1382 (ObjcInstance::setValueOfField):
1383 (ObjcInstance::setValueOfUndefinedField):
1384 (ObjcInstance::getValueOfField):
1385 (ObjcInstance::getValueOfUndefinedField):
1386 * bindings/objc/objc_runtime.h:
1387 (KJS::Bindings::ObjcField::~ObjcField):
1388 (KJS::Bindings::ObjcField::ObjcField):
1389 (KJS::Bindings::ObjcField::operator=):
1390 (KJS::Bindings::FallbackObjectImp::classInfo):
1391 * bindings/objc/objc_runtime.mm:
1392 (ObjcField::ObjcField):
1395 (ObjcField::valueFromInstance):
1396 (ObjcField::setValueToInstance):
1397 (FallbackObjectImp::FallbackObjectImp):
1398 (FallbackObjectImp::get):
1399 (FallbackObjectImp::put):
1400 (FallbackObjectImp::canPut):
1401 (FallbackObjectImp::implementsCall):
1402 (FallbackObjectImp::call):
1403 (FallbackObjectImp::hasProperty):
1404 (FallbackObjectImp::deleteProperty):
1405 (FallbackObjectImp::defaultValue):
1406 * bindings/runtime.h:
1407 (KJS::Bindings::Class::fallbackObject):
1408 (KJS::Bindings::Instance::getValueOfUndefinedField):
1409 (KJS::Bindings::Instance::setValueOfUndefinedField):
1410 * bindings/runtime_object.cpp:
1411 (RuntimeObjectImp::get):
1412 (RuntimeObjectImp::put):
1413 (RuntimeObjectImp::canPut):
1414 (RuntimeObjectImp::hasProperty):
1415 * bindings/testbindings.mm:
1416 (-[MyFirstInterface valueForUndefinedKey:]):
1417 (-[MyFirstInterface setValue:forUndefinedKey:]):
1419 2004-08-10 Darin Adler <darin@apple.com>
1423 - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
1425 * pcre/pcre.h: Added PCRE_UTF16 switch, set to 1. Added pcre_char typedef, which is char
1426 or uint16_t depending on the mode, and used appropriate in the 7 public functions
1427 that need to use it.
1428 * pcre/pcre.c: Add UTF-16 support to all functions.
1429 * pcre/study.c: Ditto.
1431 * pcre/internal.h: Added ichar typedef, which is unsigned char or uint16_t depending on
1432 the mode. Changed declarations to use symbolic constants and typedefs so we size
1433 things to ichar when needed.
1435 * pcre/maketables.c: (pcre_maketables): Change code to make tables that are
1436 sized to 16-bit characters instead of 8-bit.
1439 (pcre_copy_substring): Use pcre_char instead of char.
1440 (pcre_get_substring_list): Ditto.
1441 (pcre_free_substring_list): Ditto.
1442 (pcre_get_substring): Ditto.
1443 (pcre_free_substring): Ditto.
1445 * pcre/dftables.c: (main): Used a bit more const, and use ICHAR sizes instead
1446 of hard-coding 8-bit table sizes.
1448 * pcre/chartables.c: Regenerated.
1450 * kjs/ustring.h: Remove functions that convert UTF-16 to/from UTF-8 offsets.
1451 * kjs/ustring.cpp: Change the shared empty string to have a unicode pointer that
1452 is not null. The null string still has a null pointer. This prevents us from
1453 passing a null through to the regular expression engine (which results in a null
1454 error even when the string length is 0).
1457 (KJS::RegExp::RegExp): Null-terminate the pattern and pass it.
1458 (KJS::RegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
1460 2004-08-09 Darin Adler <darin@apple.com>
1464 - fixed 28 Mozilla JavaScript tests
1466 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Check for undefined rather than
1467 checking the number of arguments for the join method.
1469 * kjs/lexer.cpp: (Lexer::lex): Parse hexadecimal and octal constants in doubles rather
1470 than integers, so we aren't limited to 32 bits.
1472 * kjs/math_object.cpp: (MathFuncImp::call): Get rid of many unneeded special cases in
1473 the implementation of the pow operation. Also simplied a case that was handling positive
1474 and negative infinity separately.
1476 * kjs/nodes.cpp: (ShiftNode::evaluate): Keep the result of shifts in a double instead of
1477 putting them in a long, so that unsigned shift will work properly.
1479 * kjs/number_object.cpp: Add the DontDelete and ReadOnly flags to the numeric constants.
1481 * kjs/operations.cpp:
1482 (KJS::isPosInf): Added an implementation inside APPLE_CHANGES that does not depend on the
1483 sign of isinf; our isinf function returns +1 even for negative infinity.
1484 (KJS::isNegInf): And again.
1485 (KJS::relation): Put in a nice simple implementation of comparison inside APPLE_CHANGES.
1486 Our floating point already handles the various infinity cases correctly.
1488 * kjs/regexp_object.cpp:
1489 (RegExpProtoFuncImp::call): Add missing return before Null() in Exec method.
1490 (RegExpObjectImp::arrayOfMatches): Put undefined rather than an empty string into the
1491 array in cases where we did not match.
1492 (RegExpObjectImp::construct): Set the DontDelete, ReadOnly, and DontEnum flags for
1493 "global", "ignoreCase", "multiline", and "source".
1495 * kjs/string_object.cpp: (StringProtoFuncImp::call): For the match method, turn a null
1496 string into undefined rather than an empty string. For the slice method, handle an
1497 undefined parameter for the limit properly as decribed in the specification, and add
1498 the limit to one case that didn't have the limit at all. For the methods that generate
1499 HTML strings, use lowercase tags instead of uppercase.
1502 (KJS::UChar::toLower): Use u_tolower from the ICU library.
1503 (KJS::UChar::toUpper): Use u_toupper from the ICU library.
1504 (KJS::UString::append): Fix some math that caused a buffer overflow.
1505 (KJS::convertUTF16OffsetsToUTF8Offsets): Ignore negative numbers (-1 is used as a special
1506 flag) rather than converting them all to 0.
1507 (KJS::convertUTF8OffsetsToUTF16Offsets): Ditto.
1509 * tests/mozilla/jsDriver.pl: Fixed the relative links to point to our actual test files.
1511 * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed the Unicode table in this test to match
1512 the Unicode specification in a few cases where it was wrong before.
1513 * tests/mozilla/ecma/String/15.5.4.11-2.js: Ditto.
1514 * tests/mozilla/ecma/String/15.5.4.11-3.js: Ditto.
1515 * tests/mozilla/ecma/String/15.5.4.11-5.js: Ditto.
1516 * tests/mozilla/ecma/String/15.5.4.11-6.js: Ditto.
1517 * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
1518 * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
1519 * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
1520 * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
1521 * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
1523 * JavaScriptCore.pbproj/project.pbxproj: Link to libicu.
1525 * kjs/number_object.lut.h: Regenerated.
1527 2004-08-09 Darin Adler <darin@apple.com>
1531 - fixed <rdar://problem/3753467> REGRESSION (137-138): reproducible buffer overrun in UString manipulation code
1533 * kjs/ustring.cpp: (KJS::UString::append): Fix incorrect size computation. Without it
1534 we get a buffer overflow.
1538 2004-08-05 Richard Williamson <rjw@apple.com>
1540 Fixed part of 3674747. The QT guys need this for feature freeze.
1542 This patch implements support for the
1544 - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args
1546 method of objects bound to JavaScript.
1551 * bindings/objc/objc_class.mm:
1552 (ObjcClass::methodsNamed):
1553 (ObjcClass::fieldNamed):
1554 * bindings/objc/objc_instance.mm:
1555 (ObjcInstance::invokeMethod):
1556 * bindings/objc/objc_runtime.h:
1557 (KJS::Bindings::ObjcMethod::~ObjcMethod):
1558 (KJS::Bindings::ObjcMethod::isFallbackMethod):
1559 (KJS::Bindings::ObjcMethod::javaScriptName):
1560 * bindings/objc/objc_runtime.mm:
1561 (ObjcMethod::ObjcMethod):
1562 (ObjcMethod::getMethodSignature):
1563 (ObjcMethod::setJavaScriptName):
1564 * bindings/testbindings.mm:
1566 2004-08-04 Vicki Murley <vicki@apple.com>
1570 - fix <rdar://problem/3649789> SAP WebGUI has problems loading first page because of parse error
1573 (Lexer::lex): if the current character is a '\' and the next character is a line terminator,
1574 go to the next line and continue parsing the string (instead of failing). This matches
1575 behavior in Mac IE and Mozilla.
1577 2004-08-03 Kevin Decker <kdecker@apple.com>
1581 Rolled in changes from the latest KJS sources that support additional
1582 Number.prototype functions.
1584 Specifically this patch covers the follow parts of the ECMA 3 spec:
1585 15.7.4.5, 15.7.4.6, and 15.7.4.7
1588 <rdar://problem/3663716> missing Number.toFixed (and toPrecision, toExponential)
1589 <rdar://problem/3749492> missing Number.toPrecision prototype implementation
1590 <rdar://problem/3749591> missing Number.toExponential prototype implementation
1592 * kjs/identifier.h: Added toFixed, toPrecision, and toExponential to the
1593 list of supported identifiers (a macro).
1594 * kjs/number_object.cpp: Implemented support for toFixed(), toPrecision(),
1595 and toExponential().
1596 (NumberPrototypeImp::NumberPrototypeImp):
1597 (NumberProtoFuncImp::call):
1598 * kjs/number_object.h: Added property names for toFixed, toPrecision,
1600 (KJS::NumberProtoFuncImp::):
1601 * tests/mozilla/expected.html: Update results.
1603 2004-08-03 Darin Adler <darin@apple.com>
1607 - added support for copying RegExp objects so 7 more Mozilla regexp tests pass
1609 * kjs/regexp_object.cpp: (RegExpObjectImp::construct): Check for case where
1610 we are supposed to just copy the regular expression object, and do so.
1611 Also tighten up arguments check to handle case where an actual "undefined"
1612 is passed rather than just omitting an argument.
1614 * tests/mozilla/expected.html: Update results.
1616 2004-08-02 Darin Adler <darin@apple.com>
1618 * tests/mozilla/.cvsignore: Added.
1619 * tests/mozilla/expected.html: Update results.
1621 2004-08-02 Darin Adler <darin@apple.com>
1625 - fixed RegExp.toString so 3 more Mozilla regexp tests pass
1627 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call):
1628 Append the flags here so more tests paseed.
1630 2004-08-02 Darin Adler <darin@apple.com>
1634 - fixed a couple things making 5 Mozilla regexp tests pass
1636 * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call): Implement toString
1638 (RegExpObjectImp::construct): Fix bug where the string "undefined" would
1639 be used as the flags string when no parameter was passed.
1641 * kjs/regexp_object.h: (KJS::RegExpPrototypeImp::classInfo):
1642 Added a class info object for RegExp prototype so it can return
1643 a string instead of raising an exception when converting to a string.
1645 * tests/mozilla/expected.html: Update results.
1647 2004-08-02 Darin Adler <darin@apple.com>
1651 - fix crashes in mozilla tests due to mishandling NaN
1653 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Rerranged range checks after
1654 calls to toInteger so that NaN will get turned into something that fits in an integer.
1655 These were the ones John already fixed, but his fix used isnan and the new fix is
1658 * kjs/number_object.cpp: (NumberProtoFuncImp::call): Rearranged radix range checks
1659 after a call to toInteger to handle NaN properly. Also removed separate check
1660 for undefined that's not needed.
1662 * kjs/string_object.cpp: (StringProtoFuncImp::call): More of the same kinds of changes
1663 as in the above two files, but for a lot more functions. Also changed one place with
1664 an explicit check for undefined to instead just check isNaN.
1666 * tests/mozilla/run-mozilla-tests: Changed to invoke jst using $SYMROOTS for people
1667 like me who don't keep $SYMROOTS in their $PATH.
1673 2004-07-26 Kevin Decker <kdecker@apple.com>
1675 Changes done by Darin, reviewed by Kevin.
1677 - changed testkjs to build in Xcode rather than from Makefile
1679 * .cvsignore: Removed obsolete files from this list.
1680 * Makefile.am: Removed code to build testkjs; we do this in Xcode now.
1681 Changed to build target "All" rather than default target. This makes us
1682 build the testkjs test tool.
1683 * dummy.cpp: Removed.
1684 * kjs/.cvsignore: Removed obsolete files from this list, including
1685 the testkjs tool, which is now built in the symroots directory.
1686 * kjs/testkjs.cpp: Added copyright notice that was missing, since we have
1687 changed this file. Also this has the nice side effect of causing the tool
1688 to be rebuilt in the new location even if there are no other changes in
1689 your tree when you check this out.
1690 * tests/mozilla/run-mozilla-tests: Invoke perl explicitly so this works
1691 without setting the execute bit on jsDriver.pl.
1693 2004-07-22 Kevin Decker <kdecker@apple.com>
1697 Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions).
1699 * kjs/function_object.cpp:
1700 (FunctionObjectImp::construct):
1701 * kjs/function_object.h:
1703 (KJS::ObjectImp::construct):
1705 (KJS::Object::construct):
1707 2004-07-21 Darin Adler <darin@apple.com>
1709 * bindings/npruntime.h: Fixed typo.
1711 2004-07-19 John Sullivan <sullivan@apple.com>
1715 - bulletproofed array.slice() against NAN arguments. Harri noticed this
1716 vulnerability in my patch for 3714644
1718 * kjs/array_object.cpp:
1719 (ArrayProtoFuncImp::call):
1720 handle NAN parameters passed to slice() by clamping to 0 and length.
1722 2004-07-19 Richard Williamson <rjw@apple.com>
1724 Fixed 3733349. Prevent Java applet callbacks into JavaScript after applet
1729 * bindings/jni/jni_jsobject.cpp:
1731 (JSObject::JSObject):
1733 2004-07-16 John Sullivan <sullivan@apple.com>
1737 - fixed <rdar://problem/3714644> REGRESSION (125.8-146): bugzilla submit link
1738 hangs browser with javascript
1740 * kjs/array_object.cpp:
1741 (ArrayProtoFuncImp::call):
1742 Check for undefined type for args[0] the same way we were already checking
1743 for args[1]. In this case, args was zero-length, but we were treating
1744 args[0] like an integer anyway. Resulted in some code looping from a NAN
1745 value to 4, taking approximately forever.
1747 * JavaScriptCore.pbproj/project.pbxproj:
1752 2004-07-14 Maciej Stachowiak <mjs@apple.com>
1756 <rdar://problem/3711474>: (REGRESSION (125-146): JavaScript 'toString(16)' is broken)
1757 <rdar://problem/3644873>: (REGRESSION (125-140u): secondary list doesn't fill in at Southwest.com)
1759 * kjs/number_object.cpp:
1760 (NumberProtoFuncImp::call): Initialize radix from dradix, not from itself!
1762 2004-07-13 Kevin Decker <kdecker@apple.com>
1764 Reviewed by kocienda.
1766 - made testkjs and JavaScriptCore a subtarget of 'All'
1767 - testkjs now builds in $SYMROOTS
1769 * JavaScriptCore.pbproj/project.pbxproj:
1773 2004-06-24 Chris Blumenberg <cblu@apple.com>
1775 Ignore .mode1 files in JavaScriptCore.pbproj
1777 Reviewed by kocienda.
1779 * JavaScriptCore.pbproj/.cvsignore:
1781 2004-06-23 Richard Williamson <rjw@apple.com>
1783 Implemented changes for latest npruntime.h.
1787 * JavaScriptCore.pbproj/project.pbxproj:
1788 * bindings/NP_jsobject.cpp:
1789 (listFromVariantArgs):
1790 (identiferFromNPIdentifier):
1791 (_NPN_CreateScriptObject):
1796 (NPN_RemoveProperty):
1797 * bindings/NP_jsobject.h:
1798 * bindings/c/c_class.cpp:
1799 (CClass::methodsNamed):
1800 (CClass::fieldNamed):
1801 * bindings/c/c_instance.cpp:
1802 (CInstance::invokeMethod):
1803 * bindings/c/c_utility.cpp:
1804 (convertNPVariantToValue):
1805 * bindings/c/c_utility.h:
1806 * bindings/npruntime.cpp:
1807 (stringIdentifierEqual):
1808 (stringIdentifierHash):
1809 (getStringIdentifierDictionary):
1810 (intIdentifierEqual):
1811 (intIdentifierHash):
1812 (getIntIdentifierDictionary):
1813 (NPN_GetStringIdentifier):
1814 (NPN_GetStringIdentifiers):
1815 (NPN_GetIntIdentifier):
1816 (NPN_IdentifierIsString):
1817 (NPN_UTF8FromIdentifier):
1818 (NPN_VariantToInt32):
1819 (NPN_VariantToDouble):
1821 * bindings/npruntime.h:
1822 * bindings/objc/WebScriptObject.mm:
1823 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
1824 * bindings/runtime_object.cpp:
1825 (RuntimeObjectImp::~RuntimeObjectImp):
1826 * bindings/runtime_root.cpp:
1827 (KJS::Bindings::rootForInterpreter):
1828 * bindings/testbindings.cpp:
1829 (initializeIdentifiers):
1835 === JavaScriptCore-146.1 ===
1837 2004-06-16 Richard Williamson <rjw@apple.com>
1839 Fixed <rdar://problem/3702287> Crash returning nil from bound ObjC
1841 This turned out to be a show stopper for Dashboard. Accessing a nil
1842 ObjC property from JS caused a crash. Similar to the problem
1843 3696112 fixed below.
1847 * bindings/objc/objc_runtime.mm:
1848 (KJS::Bindings::ObjcField::valueFromInstance):
1852 2004-06-16 Richard Williamson <rjw@apple.com>
1854 Fixed <rdar://problem/3696112>: nil from an Objective-C class seems to get wrapped as a JavaScript proxy that will not print.
1856 This turned out to be a show stopper for Dashboard. We now
1857 return Undefined() when nil is returned from a ObjC method
1858 that returns an object type.
1862 * bindings/objc/objc_utility.mm:
1863 (KJS::Bindings::convertObjcValueToValue):
1867 2004-06-15 Richard Williamson <rjw@apple.com>
1869 Fixed <rdar://problem/3695875>: Objective-C instances that are exported to JavaScript are too promiscuous
1871 No longer need to check respondsToSelector: for
1872 isSelectorExcludedFromWebScript: and isKeyExcludedFromWebScript:
1873 because these now have a default implementation on NSObject.
1877 * bindings/objc/objc_class.mm:
1878 (ObjcClass::methodsNamed):
1879 (ObjcClass::fieldNamed):
1881 2004-06-14 Darin Adler <darin@apple.com>
1885 - fixed some things for GC that Patrick missed, or that happened after the branch
1887 * bindings/objc/WebScriptObject.mm:
1888 (-[WebScriptObject dealloc]): Moved removeNativeReference call here from private object.
1889 (-[WebScriptObject finalize]): Added.
1891 - added some missing nil checks
1893 * bindings/objc/objc_instance.mm:
1894 (ObjcInstance::ObjcInstance): Check for nil.
1895 (ObjcInstance::~ObjcInstance): Check for nil.
1896 (ObjcInstance::operator=): Check for nil.
1898 2004-06-14 Darin Adler <darin@apple.com>
1900 Reviewed by me, code changes by Patrick Beard.
1902 - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
1904 * bindings/objc/objc_instance.mm:
1905 (ObjcInstance::ObjcInstance): Use CFRetain instead of retain.
1906 (ObjcInstance::~ObjcInstance): Use CFRelease instead of release.
1907 (ObjcInstance::operator=): More of the same.
1908 (ObjcInstance::end): Use [pool drain] if compiling on Tiger.
1910 * bindings/objc/objc_runtime.mm:
1911 (ObjcArray::ObjcArray): Use CFRetain instead of retain.
1912 (ObjcArray::~ObjcArray): Use CFRelease instead of release.
1913 (ObjcArray::operator=): More of the same.
1915 * bindings/testbindings.mm: Fixed incorrect license.
1916 (main): Use [pool drain] if compiling on Tiger.
1920 2004-06-10 Kevin Decker <kdecker@apple.com>
1926 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
1928 (KJS::Lexer::lineNo):
1929 - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
1931 === JavaScriptCore-143.2 ===
1933 2004-06-07 Darin Adler <darin@apple.com>
1935 - fixed <rdar://problem/3682489>: (JavaScriptGlue no longer compiles because Interpreter::evaluate parameters changed)
1937 * kjs/interpreter.h: Added an overload to make JavaScriptGlue compile.
1938 * kjs/interpreter.cpp: (KJS::Interpreter::evaluate): Implemented the overload.
1940 === JavaScriptCore-143.1 ===
1942 2004-06-04 Kevin Decker <kdecker@apple.com>
1946 - fixed <rdar://problem/3680594>
1949 (KJS::Error::create):
1953 2004-06-04 Darin Adler <darin@apple.com>
1955 * kjs/testkjs.cpp: (main): Fix build breakage by adding URL and line number parameters.
1957 2004-06-04 Kevin Decker <kdecker@apple.com>
1961 - ObjC bindings do not (yet) pass along sourceurl or line numbers
1962 - we don't have a way as of yet to accomidate line numbers and urls for dynamic javascript
1963 - changed the wording of an error message
1964 - the lexer, parser, and interpreter have been made "sourceURL aware"
1965 - stored the url into Error
1967 * bindings/NP_jsobject.cpp:
1969 * bindings/jni/jni_jsobject.cpp:
1971 * bindings/objc/WebScriptObject.mm:
1972 (-[WebScriptObject evaluateWebScript:]):
1974 (GlobalFuncImp::call):
1975 * kjs/function_object.cpp:
1976 (FunctionObjectImp::construct):
1979 (InterpreterImp::checkSyntax):
1980 (InterpreterImp::evaluate):
1982 * kjs/interpreter.cpp:
1983 (Interpreter::evaluate):
1984 * kjs/interpreter.h:
1988 (KJS::Lexer::sourceURL):
1992 (FunctionCallNode::evaluate):
1995 (KJS::Error::create):
1998 2004-06-04 Richard Williamson <rjw@apple.com>
2000 Fixed crash when attempting to access properties on nil
2005 * bindings/objc/objc_instance.mm:
2006 (ObjcInstance::getClass):
2007 * bindings/runtime_object.cpp:
2008 (RuntimeObjectImp::get):
2009 * bindings/testM.js:
2010 * bindings/testbindings.mm:
2011 (-[MyFirstInterface getString]):
2013 2004-05-27 Kevin Decker <kdecker@apple.com>
2017 -revised generated error message content
2019 * kjs/error_object.cpp:
2020 (ErrorProtoFuncImp::call):
2024 (KJS::Error::create):
2028 2004-05-27 Richard Williamson <rjw@apple.com>
2030 Renamed WebScriptMethods to WebScripting based on feedback from Nancy.
2034 * bindings/objc/WebScriptObject.h:
2036 2004-05-27 Darin Adler <darin@apple.com>
2040 - moved to new symlink technique for embedding frameworks
2042 * JavaScriptCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
2043 because we don't need it any more.
2045 2004-05-24 Richard Williamson <rjw@apple.com>
2047 Changed RuntimeArrayImp to inherit from ArrayInstanceImp and
2048 fixed ClassInfo to correctly reflect inheritance. This is required
2049 because of the runtime checks in JSC for arrays, i.e. in
2050 the Function objects apply method.
2054 * bindings/jni/jni_runtime.cpp:
2055 (JavaArray::convertJObjectToArray):
2056 * bindings/objc/objc_utility.mm:
2057 (KJS::Bindings::convertObjcValueToValue):
2058 * bindings/runtime_array.cpp:
2059 (RuntimeArrayImp::RuntimeArrayImp):
2060 * bindings/runtime_array.h:
2061 * bindings/testM.js: Added.
2062 * bindings/testbindings.mm:
2063 (+[MyFirstInterface webScriptNameForSelector:]):
2064 (-[MyFirstInterface logMessages:]):
2065 (-[MyFirstInterface logMessage:prefix:]):
2066 (-[MyFirstInterface callJSObject::]):
2068 2004-05-22 Darin Adler <darin@apple.com>
2072 - fixed <rdar://problem/3664260>: (JS needs to listen to timezone change notifications)
2074 * kjs/date_object.cpp: (CopyLocalTimeZone): As per Chris Kane and Jordan Hubbard, use <notify.h>
2075 with a hardcoded string of "com.apple.system.timezone", and do CFTimeZoneResetSystem since
2076 CoreFoundation doesn't do this itself. Turns out this affects the default time zone as long as
2077 it hasn't been set explicitly.
2081 2004-05-20 Richard Williamson <rjw@apple.com>
2083 Implemented WebScriptObject/DOM wrapper voodoo. DOM wrappers
2084 can now be referenced like any other WebScriptObject, meaning
2085 you can do JS operations on them.
2087 All added implementation of finalizeForWebScript.
2091 * bindings/objc/WebScriptObject.h:
2092 * bindings/objc/WebScriptObject.mm:
2093 (-[WebScriptObject _initializeWithObjectImp:KJS::root:Bindings::]):
2094 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
2095 (-[WebScriptObject KJS::]):
2096 (-[WebScriptObject dealloc]):
2097 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2098 (-[WebScriptObject evaluateWebScript:]):
2099 (-[WebScriptObject setValue:forKey:]):
2100 (-[WebScriptObject valueForKey:]):
2101 (-[WebScriptObject stringRepresentation]):
2102 * bindings/objc/WebScriptObjectPrivate.h:
2103 * bindings/objc/objc_instance.mm:
2104 (ObjcInstance::~ObjcInstance):
2106 2004-05-19 Richard Williamson <rjw@apple.com>
2108 Removed extraneous tabs that were added (by XCode?).
2110 * bindings/objc/WebScriptObject.h:
2112 2004-05-19 Darin Adler <darin@apple.com>
2114 - fixed headers with licenses mangled by Xcode auto-indenting
2116 * bindings/jni/jni_jsobject.cpp:
2117 * bindings/jni/jni_jsobject.h:
2118 * bindings/runtime_array.h:
2119 * bindings/runtime_root.cpp:
2120 * bindings/runtime_root.h:
2122 2004-05-18 Richard Williamson <rjw@apple.com>
2124 Added exception logging. Also check for exception and
2125 set results as appropriate.
2127 Reviewed by Maciej (partially reviewed).
2129 * bindings/objc/WebScriptObject.mm:
2130 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2131 (-[WebScriptObject evaluateWebScript:]):
2132 (-[WebScriptObject setValue:forKey:]):
2133 (-[WebScriptObject valueForKey:]):
2135 2004-05-18 Richard Williamson <rjw@apple.com>
2137 Finsished implementing support for windowScriptObject.
2138 Had to make WebScriptObjectPrivate.h accessible from
2143 * JavaScriptCore.pbproj/project.pbxproj:
2144 * bindings/objc/WebScriptObjectPrivate.h:
2146 2004-05-18 Richard Williamson <rjw@apple.com>
2148 Use KVC to set/get values instead of directly accessing
2153 * bindings/objc/WebScriptObject.mm:
2154 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2155 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2156 * bindings/objc/objc_runtime.mm:
2157 (ObjcField::valueFromInstance):
2158 (convertValueToObjcObject):
2159 (ObjcField::setValueToInstance):
2161 2004-05-17 Richard Williamson <rjw@apple.com>
2163 Implemented new API for WebScriptObject.
2165 Fixed <rdar://problem/3657145>: (objc to javascript method calls do not cause updates.)
2166 Fixed <rdar://problem/3654887>: (Update to JSC to refer to new JSObject LiveConnect object) (w/ help from Vicki)
2170 * JavaScriptCore.pbproj/project.pbxproj:
2171 * bindings/c/c_instance.cpp:
2172 (CInstance::invokeMethod):
2173 * bindings/jni/jni_instance.cpp:
2174 (JavaInstance::invokeMethod):
2175 * bindings/jni/jni_jsobject.cpp:
2176 (JSObject::convertValueToJObject):
2177 * bindings/jni/jni_utility.cpp:
2178 (KJS::Bindings::getJNIField):
2179 * bindings/objc/WebScriptObject.mm:
2181 (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
2182 (-[WebScriptObject KJS::]):
2183 (-[WebScriptObject dealloc]):
2184 (+[WebScriptObject throwException:]):
2186 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2187 (-[WebScriptObject evaluateWebScript:]):
2188 (-[WebScriptObject setValue:forKey:]):
2189 (-[WebScriptObject valueForKey:]):
2190 (-[WebScriptObject stringRepresentation]):
2191 (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2192 (+[WebUndefined undefined]):
2193 (-[WebUndefined initWithCoder:]):
2194 (-[WebUndefined encodeWithCoder:]):
2195 (-[WebUndefined copyWithZone:]):
2196 (-[WebUndefined retain]):
2197 (-[WebUndefined release]):
2198 (-[WebUndefined retainCount]):
2199 (-[WebUndefined autorelease]):
2200 (-[WebUndefined dealloc]):
2201 (-[WebUndefined copy]):
2202 (-[WebUndefined replacementObjectForPortCoder:]):
2203 * bindings/objc/WebScriptObjectPrivate.h: Added.
2204 * bindings/objc/objc_class.mm:
2205 (ObjcClass::methodsNamed):
2206 (ObjcClass::fieldNamed):
2207 * bindings/objc/objc_instance.mm:
2208 (ObjcInstance::invokeMethod):
2209 * bindings/objc/objc_jsobject.h:
2210 * bindings/objc/objc_jsobject.mm:
2211 * bindings/objc/objc_runtime.mm:
2212 (ObjcField::valueFromInstance):
2213 * bindings/objc/objc_utility.mm:
2214 (KJS::Bindings::JSMethodNameToObjCMethodName):
2215 (KJS::Bindings::convertValueToObjcValue):
2216 (KJS::Bindings::convertObjcValueToValue):
2217 * bindings/runtime.cpp:
2218 (Instance::setDidExecuteFunction):
2219 (Instance::didExecuteFunction):
2220 (Instance::setValueOfField):
2221 * bindings/runtime.h:
2222 * bindings/testbindings.mm:
2223 (+[MyFirstInterface webScriptNameForSelector:]):
2224 (-[MyFirstInterface callJSObject::]):
2226 2004-05-14 Vicki Murley <vicki@apple.com>
2230 <rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release
2232 * JavaScriptCore.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0
2236 2004-05-13 Richard Williamson <rjw@apple.com>
2243 * bindings/objc/WebScriptObject.h:
2245 2004-05-13 Richard Williamson <rjw@apple.com>
2247 Approved API changes. Currently unimplemented.
2252 * JavaScriptCore.pbproj/project.pbxproj:
2253 * bindings/objc/WebScriptObject.h: Added.
2254 * bindings/objc/WebScriptObject.mm: Added.
2255 (+[WebScriptObject throwException:]):
2256 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2257 (-[WebScriptObject evaluateWebScript:]):
2258 (-[WebScriptObject stringRepresentation]):
2259 (+[WebUndefined undefined]):
2260 (-[WebUndefined initWithCoder:]):
2261 (-[WebUndefined encodeWithCoder:]):
2262 (-[WebUndefined copyWithZone:]):
2264 2004-05-07 Vicki Murley <vicki@apple.com>
2268 Turn off GC since it uses ppc only instructions (which breaks
2271 * kjs/value.h: set USE_CONSERVATIVE_GC to 0
2275 2004-05-07 Maciej Stachowiak <mjs@apple.com>
2279 - add -funroll-loops=16 compiler option for approx .5% speedup on
2280 HTML iBench and .5-1% speedup on JS iBench.
2282 * JavaScriptCore.pbproj/project.pbxproj:
2284 2004-04-25 Maciej Stachowiak <mjs@apple.com>
2288 Enable full conservative GC mode in addition to test mode. When
2289 conservative GC is enabled, we now get an 11% speed improvement on
2290 the iBench. Also fix some spots I missed before.
2292 Specific noteworth changes:
2294 * kjs/collector.cpp:
2295 (KJS::Collector::markStackObjectsConservatively): Check possible
2296 cell pointers for 8-byte aligment and verify they are not 0.
2298 * kjs/protected_values.cpp:
2299 (KJS::ProtectedValues::increaseProtectCount): Move null-tolerance from here...
2300 (KJS::ProtectedValues::decreaseProtectCount): ...and here...
2302 (KJS::gcProtectNullTolerant): ...to here...
2303 (KJS::gcUnprotectNullTolerant): ...and here, because not all callers need the null
2304 tolerance, and doing the check is expensive.
2306 * kjs/protected_values.cpp:
2307 (KJS::ProtectedValues::computeHash): Replace hash function with a much faster one
2308 that is still very good.
2313 (KJS::ProtectedValue::ProtectedValue):
2314 (KJS::ProtectedValue::~ProtectedValue):
2315 (KJS::ProtectedValue::operator=):
2316 (KJS::ProtectedObject::ProtectedObject):
2317 (KJS::ProtectedObject::~ProtectedObject):
2318 (KJS::ProtectedObject::operator=):
2319 (KJS::ProtectedReference::ProtectedReference):
2320 (KJS::ProtectedReference::~ProtectedReference):
2321 (KJS::ProtectedReference::operator=):
2322 * kjs/protected_values.cpp:
2323 (KJS::ProtectedValues::getProtectCount):
2324 (KJS::ProtectedValues::increaseProtectCount):
2325 (KJS::ProtectedValues::decreaseProtectCount):
2326 (KJS::ProtectedValues::computeHash):
2327 * bindings/runtime_root.cpp:
2328 (KJS::Bindings::addNativeReference):
2329 (KJS::Bindings::removeNativeReference):
2330 (RootObject::removeAllNativeReferences):
2331 * bindings/runtime_root.h:
2332 (KJS::Bindings::RootObject::~RootObject):
2333 (KJS::Bindings::RootObject::setRootObjectImp):
2334 * kjs/collector.cpp:
2335 (KJS::Collector::allocate):
2336 (KJS::Collector::collect):
2339 (NumberImp::create):
2340 (InterpreterImp::globalInit):
2341 (InterpreterImp::globalClear):
2342 (InterpreterImp::mark):
2344 (KJS::List::derefValues):
2345 (KJS::List::refValues):
2346 (KJS::List::append):
2348 (KJS::ObjectImp::setInternalValue):
2349 (KJS::ObjectImp::putDirect):
2354 (KJS::ValueImp::ValueImp):
2355 (KJS::ValueImp::~ValueImp):
2357 (KJS::Value::Value):
2358 (KJS::Value::~Value):
2359 (KJS::Value::operator=):
2361 2004-04-30 Richard Williamson <rjw@apple.com>
2363 Asking an NSInvocation for it's return value when return type
2364 is void throws an exception. Added check for void return types
2365 to avoid this exception.
2369 * bindings/objc/objc_instance.mm:
2370 (ObjcInstance::invokeMethod):
2372 2004-04-29 Richard Williamson <rjw@apple.com>
2374 Fixed several bad problems with the ObjC bindings. In particular, conversion
2375 to/from JavaScriptObject (soon to be WebScriptObject) was completely broken.
2379 * bindings/objc/objc_jsobject.h:
2380 * bindings/objc/objc_jsobject.mm:
2381 (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
2382 (-[JavaScriptObject KJS::]):
2383 (+[JavaScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
2384 (-[JavaScriptObject call:arguments:]):
2385 (-[JavaScriptObject evaluate:]):
2386 (-[JavaScriptObject getMember:]):
2387 (-[JavaScriptObject getSlot:]):
2388 * bindings/objc/objc_runtime.mm:
2389 (ObjcField::valueFromInstance):
2390 (ObjcField::setValueToInstance):
2391 * bindings/objc/objc_utility.mm:
2392 (KJS::Bindings::convertValueToObjcValue):
2393 (KJS::Bindings::convertObjcValueToValue):
2394 * bindings/runtime.h:
2395 * bindings/runtime_root.cpp:
2396 (KJS::Bindings::rootForInterpreter):
2397 (KJS::Bindings::addNativeReference):
2398 (KJS::Bindings::removeNativeReference):
2399 * bindings/runtime_root.h:
2400 * bindings/testbindings.mm:
2401 (-[MyFirstInterface logMessage:]):
2402 (-[MyFirstInterface setJSObject:]):
2403 (-[MyFirstInterface callJSObject::]):
2405 2004-04-24 Darin Adler <darin@apple.com>
2409 * kjs/ustring.cpp: (KJS::UString::append): Fix one case that was allocating a buffer
2412 2004-04-23 Maciej Stachowiak <mjs@apple.com>
2416 Implementation of conservative GC, based partly on code from
2417 Darin. It's turned off for now, so it shouldn't have any effect on
2420 * JavaScriptCore.pbproj/project.pbxproj:
2421 * kjs/collector.cpp:
2422 (KJS::Collector::markStackObjectsConservatively):
2423 (KJS::Collector::markProtectedObjects):
2424 (KJS::Collector::collect):
2429 * kjs/protected_values.cpp: Added.
2430 (KJS::ProtectedValues::getProtectCount):
2431 (KJS::ProtectedValues::increaseProtectCount):
2432 (KJS::ProtectedValues::insert):
2433 (KJS::ProtectedValues::decreaseProtectCount):
2434 (KJS::ProtectedValues::expand):
2435 (KJS::ProtectedValues::shrink):
2436 (KJS::ProtectedValues::rehash):
2437 (KJS::ProtectedValues::computeHash):
2438 * kjs/protected_values.h: Added.
2440 (ValueImp::useConservativeMark):
2448 2004-04-22 Richard Williamson <rjw@apple.com>
2450 Fixed build snafu (re-declaration of NPBool in npruntime.h and
2453 * bindings/npruntime.h:
2455 2004-04-22 Richard Williamson <rjw@apple.com>
2457 Updated plugin binding API to reflect latest revision from
2460 Biggest change is the introduction of NPVariant used to represent
2461 value types. NPVariant replaces the use of NPObject for the
2462 exchange of values between scripting environment and native code.
2466 * JavaScriptCore.pbproj/project.pbxproj:
2467 * bindings/NP_jsobject.cpp:
2468 (identiferFromNPIdentifier):
2474 (NPN_GetPropertyAtIndex):
2475 (NPN_SetPropertyAtIndex):
2476 * bindings/c/c_class.cpp:
2477 (CClass::methodsNamed):
2478 (CClass::fieldNamed):
2479 * bindings/c/c_instance.cpp:
2480 (CInstance::invokeMethod):
2481 (CInstance::defaultValue):
2482 * bindings/c/c_runtime.cpp:
2483 (CField::valueFromInstance):
2484 (CField::setValueToInstance):
2485 * bindings/c/c_utility.cpp:
2486 (convertNPStringToUTF16):
2487 (convertUTF8ToUTF16):
2488 (coerceValueToNPVariantStringType):
2489 (convertValueToNPVariant):
2490 (convertNPVariantToValue):
2491 * bindings/c/c_utility.h:
2492 * bindings/npruntime.cpp:
2493 (NPN_GetIdentifier):
2494 (NPN_GetIdentifiers):
2495 (NPN_UTF8FromIdentifier):
2496 (NPN_VariantIsVoid):
2497 (NPN_VariantIsNull):
2498 (NPN_VariantIsUndefined):
2499 (NPN_VariantIsBool):
2500 (NPN_VariantIsInt32):
2501 (NPN_VariantIsDouble):
2502 (NPN_VariantIsString):
2503 (NPN_VariantIsObject):
2504 (NPN_VariantToBool):
2505 (NPN_VariantToString):
2506 (NPN_VariantToInt32):
2507 (NPN_VariantToDouble):
2508 (NPN_VariantToObject):
2509 (NPN_InitializeVariantAsVoid):
2510 (NPN_InitializeVariantAsNull):
2511 (NPN_InitializeVariantAsUndefined):
2512 (NPN_InitializeVariantWithBool):
2513 (NPN_InitializeVariantWithInt32):
2514 (NPN_InitializeVariantWithDouble):
2515 (NPN_InitializeVariantWithString):
2516 (NPN_InitializeVariantWithStringCopy):
2517 (NPN_InitializeVariantWithObject):
2518 (NPN_InitializeVariantWithVariant):
2519 (NPN_ReleaseVariantValue):
2522 (NPN_ReleaseObject):
2523 (NPN_IsKindOfClass):
2524 (NPN_SetExceptionWithUTF8):
2526 * bindings/npruntime.h:
2528 (_NPString::_NPVariant::):
2529 * bindings/testbindings.cpp:
2544 2004-04-22 Darin Adler <darin@apple.com>
2548 - fixed <rdar://problem/3627473>: "REGRESSION (125-137): memory trasher in UString::append, causing many different crashes"
2551 (KJS::UString::expandCapacity): Fix sizeof(UChar *) that should be sizeof(UChar).
2552 Was resulting in a buffer 2x the needed size.
2553 (KJS::UString::expandPreCapacity): Ditto.
2554 (KJS::UString::append): Fix malloc that is missing a sizeof(UChar).
2556 2004-04-21 Maciej Stachowiak <mjs@apple.com>
2560 Preliminary change for conservative GC. Create "protected"
2561 subclasses to GC-protect objects when on heap, since we will soon
2562 remove the built-in refcounting of the normal wrapper classes. Use
2565 * JavaScriptCore.pbproj/project.pbxproj:
2568 (KJS::InterpreterImp::globalObject):
2569 * kjs/interpreter.h:
2570 * kjs/property_map.cpp:
2572 * kjs/reference_list.cpp:
2574 2004-04-19 Maciej Stachowiak <mjs@apple.com>
2578 Optimize prepend using the shared substring optimization. Also,
2579 limit the applicability of shared append and shared prepend. If
2580 you overdo it, it does more harm than good, because you create a
2581 bunch of strings that are disqualified from future shared
2582 append/prepend, for not much immediate savings in allocate/copy
2587 (KJS::UString::Rep::create):
2588 (KJS::UString::expandedSize):
2589 (KJS::UString::usedPreCapacity):
2590 (KJS::UString::expandCapacity):
2591 (KJS::UString::expandPreCapacity):
2592 (KJS::UString::UString):
2593 (KJS::UString::append):
2594 (KJS::UString::operator=):
2596 (KJS::UString::Rep::data):
2598 2004-04-16 Maciej Stachowiak <mjs@apple.com>
2599 Reviewed by Richard.
2601 No more need for Completion or Reference to privately inherit from
2602 Value, none of the superclass functionality is used.
2609 2004-04-16 Richard Williamson <rjw@apple.com>
2611 Added interpreter lock protection around object creation.
2615 * bindings/runtime.cpp:
2616 (Instance::createRuntimeObject):
2618 2004-04-16 Maciej Stachowiak <mjs@apple.com>
2622 Another JavaScript speed improvement: use the mechanism from
2623 string append optimization to make taking a substring fast, again
2626 A further 22% improvement on the 24fun string speed test.
2630 (KJS::UString::Rep::create):
2631 (KJS::UString::UString):
2632 (KJS::UString::append):
2633 (KJS::UString::operator=):
2634 (KJS::UString::substr):
2636 (KJS::UString::Rep::data):
2638 2004-04-13 Maciej Stachowiak <mjs@apple.com>
2642 - fixed <rdar://problem/3600695>: String manipulation in JavaScript 24fun test is very slow (slow)
2643 - fixed <rdar://problem/3600691>: Table generation test is really slow
2644 - fixed <rdar://problem/3600661>: 24fun date test is really slow
2646 80% speedup on the string test, lesser speedups on the other two.
2648 Two different optimizations here:
2650 1) Avoid large overhead of scanning strings to see if they are all
2651 ASCII before numeric conversion.
2654 (AssignNode::evaluate): Don't convert to integer until we know for
2655 sure the operation will need it. Attempting to convert strings to
2656 numbers is a waste when they are being appended with +=.
2658 2) Avoid huge cost of appending strings.
2660 This is done by allowing multiple strings to share a buffer but
2661 actually use different ranges of it. The first time a string is
2662 appended to, we start leaving at least 10% extra space in the
2663 buffer, so doing N appends to the same string takes O(log N)
2664 mallocs instead of O(N).
2666 * kjs/identifier.cpp:
2667 (KJS::Identifier::equal):
2668 (KJS::Identifier::add):
2671 (KJS::UCharReference::operator=):
2672 (KJS::UCharReference::ref):
2673 (KJS::UString::Rep::create):
2674 (KJS::UString::Rep::destroy):
2675 (KJS::UString::expandedSize):
2676 (KJS::UString::usedCapacity):
2677 (KJS::UString::expandCapacity):
2678 (KJS::UString::UString):
2679 (KJS::UString::null):
2680 (KJS::UString::append):
2681 (KJS::UString::operator=):
2682 (KJS::UString::toStrictUInt32):
2683 (KJS::UString::detach):
2684 (KJS::KJS::operator==):
2686 (KJS::UString::Rep::data):
2687 (KJS::UString::Rep::hash):
2689 2004-04-09 Maciej Stachowiak <mjs@apple.com>
2693 - fix deployment build by avoiding deployment-only warning.
2695 * kjs/scope_chain.cpp:
2696 (KJS::ScopeChain::bottom):
2698 2004-04-09 Maciej Stachowiak <mjs@apple.com>
2702 Changed things so that newly created objects get a prototype based
2703 on the scope chain of the current function, rather than the
2704 interpreter that started execution. This fixes the following bugs:
2706 <rdar://problem/3368523>: ARCH: wrong prototype used to create new objects (hang on lookup.atomica.com)
2707 <rdar://problem/3559173>: ARCH: Cannot scan using a HP Jetdirect product (JS object prototypes bind incorrectly)
2709 * JavaScriptCore.pbproj/project.pbxproj:
2710 * kjs/array_object.cpp:
2711 (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
2712 (ArrayProtoFuncImp::ArrayProtoFuncImp):
2713 (ArrayProtoFuncImp::call):
2714 (ArrayObjectImp::construct):
2715 * kjs/bool_object.cpp:
2716 (BooleanObjectImp::construct):
2717 * kjs/date_object.cpp:
2718 (DateProtoFuncImp::DateProtoFuncImp):
2719 (DateProtoFuncImp::call):
2720 (DateObjectImp::construct):
2721 * kjs/error_object.cpp:
2722 (ErrorObjectImp::construct):
2724 (FunctionImp::FunctionImp):
2725 (FunctionImp::call):
2726 (DeclaredFunctionImp::construct):
2727 (ArgumentsImp::ArgumentsImp):
2728 (GlobalFuncImp::call):
2729 * kjs/function_object.cpp:
2730 (FunctionProtoFuncImp::call):
2731 (FunctionObjectImp::construct):
2733 (BooleanImp::toObject):
2734 (StringImp::toObject):
2735 (NumberImp::toObject):
2736 (InterpreterImp::InterpreterImp):
2737 (InterpreterImp::clear):
2738 (InterpreterImp::interpreterWithGlobalObject):
2740 * kjs/interpreter.cpp:
2741 (ExecState::lexicalInterpreter):
2742 * kjs/interpreter.h:
2743 (KJS::ExecState::dynamicInterpreter):
2744 (KJS::ExecState::interpreter):
2745 * kjs/math_object.cpp:
2746 (MathFuncImp::MathFuncImp):
2748 (StatementNode::hitStatement):
2749 (StatementNode::abortStatement):
2750 (RegExpNode::evaluate):
2751 (ElementNode::evaluate):
2752 (ArrayNode::evaluate):
2753 (ObjectLiteralNode::evaluate):
2754 (PropertyValueNode::evaluate):
2755 (FunctionCallNode::evaluate):
2756 (FuncDeclNode::processFuncDecl):
2757 (FuncExprNode::evaluate):
2758 * kjs/number_object.cpp:
2759 (NumberObjectImp::construct):
2761 (KJS::ObjectImp::defaultValue):
2762 (KJS::Error::create):
2763 * kjs/object_object.cpp:
2764 (ObjectObjectImp::construct):
2765 * kjs/reference.cpp:
2766 (Reference::putValue):
2767 * kjs/regexp_object.cpp:
2768 (RegExpProtoFuncImp::call):
2769 (RegExpObjectImp::arrayOfMatches):
2770 (RegExpObjectImp::construct):
2771 * kjs/scope_chain.cpp:
2772 (KJS::ScopeChain::bottom):
2773 * kjs/scope_chain.h:
2774 * kjs/string_object.cpp:
2775 (StringProtoFuncImp::StringProtoFuncImp):
2776 (StringProtoFuncImp::call):
2777 (StringObjectImp::construct):
2783 2004-03-31 Richard Williamson <rjw@apple.com>
2785 Tedious renames based on feedback from plugin-futures list.
2786 NP_ functions are renamed with NPN_ prefix.
2787 Types prefix renamed from NP_ to NP.
2788 NPN_CreateStringWithUTF8 and NPN_SetExceptionWithUTF8 now take a length, optionally -1 if string is null terminated.
2790 No review because this was just a renaming patch.
2792 * bindings/NP_jsobject.cpp:
2795 (identiferFromNPIdentifier):
2800 (NPN_RemoveProperty):
2802 (NPN_GetPropertyAtIndex):
2803 (NPN_SetPropertyAtIndex):
2804 * bindings/NP_jsobject.h:
2805 * bindings/c/c_class.cpp:
2806 (CClass::_commonInit):
2807 (CClass::classForIsA):
2809 (CClass::methodsNamed):
2810 (CClass::fieldNamed):
2811 * bindings/c/c_class.h:
2812 * bindings/c/c_instance.cpp:
2813 (CInstance::CInstance):
2814 (CInstance::~CInstance):
2815 (CInstance::operator=):
2816 (CInstance::invokeMethod):
2817 (CInstance::defaultValue):
2818 * bindings/c/c_instance.h:
2819 (KJS::Bindings::CInstance::getObject):
2820 * bindings/c/c_runtime.cpp:
2821 (CField::valueFromInstance):
2822 (CField::setValueToInstance):
2823 * bindings/c/c_runtime.h:
2824 (KJS::Bindings::CField::CField):
2825 (KJS::Bindings::CField::name):
2826 (KJS::Bindings::CMethod::CMethod):
2827 (KJS::Bindings::CMethod::name):
2828 * bindings/c/c_utility.cpp:
2829 (coerceValueToNPString):
2830 (convertValueToNPValueType):
2831 (convertNPValueTypeToValue):
2832 * bindings/c/c_utility.h:
2833 * bindings/npruntime.cpp:
2834 (NPN_IdentifierFromUTF8):
2835 (NPN_IsValidIdentifier):
2836 (NPN_GetIdentifiers):
2837 (NPN_UTF8FromIdentifier):
2840 (NPN_ReleaseObject):
2841 (NPN_IsKindOfClass):
2842 (NPN_SetExceptionWithUTF8):
2845 (NPN_CreateNumberWithInt):
2846 (NPN_CreateNumberWithFloat):
2847 (NPN_CreateNumberWithDouble):
2848 (NPN_IntFromNumber):
2849 (NPN_FloatFromNumber):
2850 (NPN_DoubleFromNumber):
2852 (NPN_CreateStringWithUTF8):
2853 (NPN_CreateStringWithUTF16):
2854 (NPN_DeallocateUTF8):
2855 (NPN_UTF8FromString):
2856 (NPN_UTF16FromString):
2859 (NPN_CreateBoolean):
2860 (NPN_BoolFromBoolean):
2863 (undefinedAllocate):
2869 (NPN_ObjectAtIndex):
2870 * bindings/npruntime.h:
2871 * bindings/runtime.cpp:
2872 (Instance::createBindingForLanguageInstance):
2873 * bindings/testbindings.cpp:
2874 (initializeIdentifiers):
2894 2004-03-31 Richard Williamson <rjw@apple.com>
2896 Changed references to NP_runtime.h to npruntime.h
2898 * JavaScriptCore.pbproj/project.pbxproj:
2899 * bindings/NP_jsobject.h:
2900 * bindings/c/c_class.h:
2901 * bindings/c/c_instance.h:
2902 * bindings/c/c_runtime.h:
2903 * bindings/c/c_utility.h:
2904 * bindings/npruntime.cpp:
2906 2004-03-31 Richard Williamson <rjw@apple.com>
2908 Renamed NP_runtime.h to npruntime.h to match Netscape SDK.
2910 * JavaScriptCore.pbproj/project.pbxproj:
2911 * bindings/NP_jsobject.h:
2912 * bindings/npruntime.cpp:
2916 2004-03-23 Richard Williamson <rjw@apple.com>
2918 Added implementation of KJS::Value <-> NP_Object conversion functions.
2919 Augmented test program for 'C' bindings.
2920 Added asserts and parameter checking to all public API.
2924 * JavaScriptCore.pbproj/project.pbxproj:
2925 * bindings/NP_jsobject.cpp:
2927 * bindings/NP_jsobject.h: Added.
2928 * bindings/NP_runtime.cpp:
2929 (NP_IdentifierFromUTF8):
2930 (NP_IsValidIdentifier):
2931 (NP_GetIdentifiers):
2936 (NP_SetExceptionWithUTF8):
2939 (NP_FloatFromNumber):
2940 (NP_DoubleFromNumber):
2941 (NP_CreateStringWithUTF8):
2942 (NP_CreateStringWithUTF16):
2943 (NP_DeallocateUTF8):
2944 (NP_UTF8FromString):
2945 (NP_UTF16FromString):
2947 (NP_BoolFromBoolean):
2948 * bindings/NP_runtime.h:
2949 * bindings/c/c_instance.cpp:
2950 (CInstance::invokeMethod):
2951 * bindings/c/c_utility.cpp:
2952 (coerceValueToNPString):
2953 (convertValueToNPValueType):
2954 (convertNPValueTypeToValue):
2955 * bindings/c/c_utility.h:
2957 * bindings/testC.js: Added.
2958 * bindings/testbindings.cpp:
2968 (myInterfaceInvoke):
2969 (myInterfaceAllocate):
2973 2004-03-19 Darin Adler <darin@apple.com>
2977 - fixed problem with methods like setUTCHour
2979 * kjs/date_object.cpp: (DateProtoFuncImp::call): Fix conversion back to time_t to use the appropriate
2980 GMT vs. local time function based on the utc flag.
2982 2004-03-17 Richard Williamson <rjw@apple.com>
2984 Added a context parameter to result callbacks use by JavaScriptObject functions. This was a change requested by Eric Carlson on the QT plugin team.
2988 * bindings/NP_jsobject.cpp:
2993 (NP_GetPropertyAtIndex):
2994 * bindings/NP_runtime.h:
2996 2004-03-16 Richard Williamson <rjw@apple.com>
2998 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.
3002 * bindings/jni/jni_class.cpp:
3003 (JavaClass::methodsNamed):
3005 2004-03-15 Richard Williamson <rjw@apple.com>
3007 Fixed 3570854. Don't attempt to convert Null to strings. We
3008 were incorrectly converting to "Null".
3010 Actually fixed by Scott Kovatch.
3012 Reviewed by Richard.
3014 * bindings/jni/jni_utility.cpp:
3015 (KJS::Bindings::convertValueToJValue):
3019 2004-03-11 Richard Williamson <rjw@apple.com>
3021 Stitched together the NP stuff to our language independent
3022 JavaScript binding stuff. Very close to being done.
3024 Added program to test C bindings (and NP stuff). Just tests
3025 properties. Will add methods and JavaScript access, etc.
3027 Updated Makefile.am to account for new bindings/c directory.
3029 Change NP_UTF8 from "const char *" to "char" to allow for
3030 declarations like "const NP_UTF8 *" and "NP_UTF8 *". Ditto
3033 Added NP_IsValidIdentifier().
3037 * JavaScriptCore.pbproj/project.pbxproj:
3039 * bindings/NP_jsobject.cpp:
3040 (identiferFromNPIdentifier):
3042 * bindings/NP_runtime.cpp:
3043 (NP_IdentifierFromUTF8):
3044 (NP_IsValidIdentifier):
3045 (NP_GetIdentifiers):
3046 (NP_UTF8FromIdentifier):
3047 (NP_SetExceptionWithUTF8):
3049 (NP_CreateStringWithUTF8):
3050 (NP_CreateStringWithUTF16):
3051 (NP_UTF8FromString):
3052 (NP_UTF16FromString):
3053 * bindings/NP_runtime.h:
3054 * bindings/c/c_class.cpp: Added.
3055 (CClass::_commonDelete):
3056 (CClass::_commonCopy):
3057 (CClass::_commonInit):
3058 (_createClassesByIsAIfNecessary):
3059 (CClass::classForIsA):
3062 (CClass::methodsNamed):
3063 (CClass::fieldNamed):
3064 * bindings/c/c_class.h: Added.
3065 (KJS::Bindings::CClass::~CClass):
3066 (KJS::Bindings::CClass::CClass):
3067 (KJS::Bindings::CClass::operator=):
3068 (KJS::Bindings::CClass::constructorAt):
3069 (KJS::Bindings::CClass::numConstructors):
3070 * bindings/c/c_instance.cpp: Added.
3071 (CInstance::CInstance):
3072 (CInstance::~CInstance):
3073 (CInstance::operator=):
3074 (CInstance::getClass):
3077 (CInstance::invokeMethod):
3078 (CInstance::defaultValue):
3079 (CInstance::stringValue):
3080 (CInstance::numberValue):
3081 (CInstance::booleanValue):
3082 (CInstance::valueOf):
3083 * bindings/c/c_instance.h: Added.
3084 (KJS::Bindings::CInstance::getObject):
3085 * bindings/c/c_runtime.cpp: Added.
3086 (CField::valueFromInstance):
3087 (CField::setValueToInstance):
3088 * bindings/c/c_runtime.h: Added.
3089 (KJS::Bindings::CField::CField):
3090 (KJS::Bindings::CField::name):
3091 (KJS::Bindings::CField::type):
3092 (KJS::Bindings::CMethod::CMethod):
3093 (KJS::Bindings::CMethod::name):
3094 (KJS::Bindings::CMethod::numParameters):
3095 * bindings/c/c_utility.cpp: Added.
3096 (coerceValueToNPValueType):
3097 (convertValueToNPValueType):
3098 (convertNPValueTypeToValue):
3099 * bindings/c/c_utility.h: Added.
3100 * bindings/make_testbindings:
3101 * bindings/runtime.cpp:
3102 (Instance::createBindingForLanguageInstance):
3103 * bindings/runtime.h:
3104 (KJS::Bindings::Instance::):
3105 * bindings/testbindings.cpp: Added.
3106 (initializeIdentifiers):
3107 (myInterfaceHasProperty):
3108 (myInterfaceHasMethod):
3109 (myInterfaceGetProperty):
3110 (myInterfaceSetProperty):
3111 (myInterfaceInvoke):
3112 (myInterfaceAllocate):
3113 (myInterfaceInvalidate):
3114 (myInterfaceDeallocate):
3115 (GlobalImp::className):
3116 (readJavaScriptFromFile):
3119 2004-03-10 Richard Williamson <rjw@apple.com>
3121 Made changes to support new asychronous approach to calls from
3122 plugin to JavaScript
3126 * bindings/NP_jsobject.cpp:
3131 (NP_GetPropertyAtIndex):
3132 * bindings/NP_runtime.h:
3133 * bindings/make_testbindings:
3134 * bindings/runtime.cpp:
3135 (Instance::createBindingForLanguageInstance):
3137 2004-03-10 Richard Williamson <rjw@apple.com>
3139 Updated header to include proposed changes from
3140 plugin-futures list. Calls from plugin to JavaScript
3141 are now asynchronous.
3145 * bindings/NP_runtime.h:
3149 2004-03-04 Richard Williamson <rjw@apple.com>
3151 Implementation of NP_JavaScriptObject. This is the 'C' class
3152 that wraps a JavaScript object.
3156 * JavaScriptCore.pbproj/project.pbxproj:
3157 * bindings/NP_jsobject.cpp: Added.
3158 (coerceValueToNPValueType):
3159 (convertValueToNPValueType):
3160 (convertNPValueTypeToValue):
3164 (identiferFromNPIdentifier):
3169 (NP_RemoveProperty):
3171 (NP_GetPropertyAtIndex):
3172 (NP_SetPropertyAtIndex):
3173 * bindings/NP_runtime.cpp:
3175 * bindings/NP_runtime.h:
3176 * bindings/runtime_object.h:
3178 2004-03-04 Richard Williamson <rjw@apple.com>
3180 Added NP_Array implementation.
3182 Changed NP_Boolean to just depend on two static instances, no
3183 space is required for values.
3187 * bindings/NP_runtime.cpp:
3189 (NP_BoolFromBoolean):
3195 * bindings/NP_runtime.h:
3197 2004-03-03 Darin Adler <darin@apple.com>
3201 * English.lproj/InfoPlist.strings: Removed. No need to localize the version and
3202 copyright string, and that's all that was in here.
3203 * JavaScriptCore.pbproj/project.pbxproj: Removed InfoPlist.strings from build.
3205 2004-03-03 Richard Williamson <rjw@apple.com>
3207 More 'C' binding implementation. Fleshed out all the
3208 'primitive' data types.
3212 * bindings/NP_runtime.cpp:
3217 (NP_CreateStringWithUTF8):
3218 (NP_CreateStringWithUTF16):
3219 (NP_UTF8FromString):
3220 (NP_UTF16FromString):
3223 (booleanDeallocate):
3225 (NP_BoolFromBoolean):
3229 (undefinedAllocate):
3230 (undefinedDeallocate):
3232 * bindings/NP_runtime.h:
3234 2004-03-03 Richard Williamson <rjw@apple.com>
3236 More 'C' binding implementation.
3240 * bindings/NP_runtime.cpp:
3243 (getIdentifierDictionary):
3244 (NP_IdentifierFromUTF8):
3245 (NP_UTF8FromIdentifier):
3250 (NP_CreateNumberWithInt):
3251 (NP_CreateNumberWithFloat):
3252 (NP_CreateNumberWithDouble):
3254 (NP_FloatFromNumber):
3255 (NP_DoubleFromNumber):
3256 * bindings/NP_runtime.h:
3258 2004-03-02 Richard Williamson <rjw@apple.com>
3260 Removed retain/release from NP_Class. Classes will not be allowed to implement their
3261 own customer retain/release scheme.
3265 * bindings/NP_runtime.cpp:
3268 * bindings/NP_runtime.h:
3270 2004-03-02 Richard Williamson <rjw@apple.com>
3272 C binding API. Partial implementation.
3274 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.
3276 Factored root object reference counting scheme. It is now useful independent
3281 * JavaScriptCore.pbproj/project.pbxproj:
3282 * bindings/NP_runtime.cpp: Added.
3283 (NP_IdentifierFromUTF8):
3284 (NP_GetIdentifiers):
3285 (NP_UTF8FromIdentifier):
3295 (NP_RemoveProperty):
3297 (NP_GetPropertyAtIndex):
3298 (NP_SetPropertyAtIndex):
3299 (NP_CreateNumberWithInt):
3300 (NP_CreateNumberWithFloat):
3301 (NP_CreateNumberWithDouble):
3303 (NP_FloatFromNumber):
3304 (NP_DoubleFromNumber):
3305 (NP_CreateStringWithUTF8):
3306 (NP_CreateStringWithUTF16):
3307 (NP_UTF8FromString):
3308 (NP_UTF16FromString):
3310 (NP_BoolFromBoolean):
3316 * bindings/NP_runtime.h: Added.
3317 * bindings/jni/jni_jsobject.cpp:
3319 (JSObject::finalize):
3320 (JSObject::createNative):
3321 (JSObject::convertValueToJObject):
3322 * bindings/jni/jni_jsobject.h:
3323 * bindings/objc/objc_jsobject.h:
3324 * bindings/objc/objc_jsobject.mm:
3326 (windowJavaScriptObject):
3327 (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
3328 (-[JavaScriptObject dealloc]):
3329 (-[JavaScriptObject _convertValueToObjcValue:KJS::]):
3330 (-[JavaScriptObject call:arguments:]):
3331 (-[JavaScriptObject evaluate:]):
3332 (-[JavaScriptObject getMember:]):
3333 (-[JavaScriptObject setMember:value:]):
3334 (-[JavaScriptObject removeMember:]):
3335 (-[JavaScriptObject toString]):
3336 (-[JavaScriptObject getSlot:]):
3337 (-[JavaScriptObject setSlot:value:]):
3338 * bindings/objc/objc_utility.h:
3339 * bindings/objc/objc_utility.mm:
3340 (KJS::Bindings::convertValueToObjcValue):
3341 * bindings/runtime_root.cpp: Added.
3342 (getReferencesByRootDictionary):
3343 (getReferencesDictionary):
3344 (KJS::Bindings::findReferenceDictionary):
3345 (KJS::Bindings::rootForImp):
3346 (KJS::Bindings::addNativeReference):
3347 (KJS::Bindings::removeNativeReference):
3348 (completedJavaScriptAccess):
3349 (initializeJavaScriptAccessLock):
3350 (lockJavaScriptAccess):
3351 (unlockJavaScriptAccess):
3352 (RootObject::dispatchToJavaScriptThread):
3353 (performJavaScriptAccess):
3354 (RootObject::setFindRootObjectForNativeHandleFunction):
3355 (RootObject::removeAllNativeReferences):
3356 * bindings/runtime_root.h: Added.
3357 (KJS::Bindings::RootObject::RootObject):
3358 (KJS::Bindings::RootObject::~RootObject):
3359 (KJS::Bindings::RootObject::setRootObjectImp):
3360 (KJS::Bindings::RootObject::rootObjectImp):
3361 (KJS::Bindings::RootObject::setInterpreter):
3362 (KJS::Bindings::RootObject::interpreter):
3363 (KJS::Bindings::RootObject::findRootObjectForNativeHandleFunction):
3364 (KJS::Bindings::RootObject::runLoop):
3365 (KJS::Bindings::RootObject::performJavaScriptSource):
3371 2004-02-18 Richard Williamson <rjw@apple.com>
3373 Added NSNumber/Number conversion.
3375 Removed some unnecessary KJS:: namespace specifiers.
3379 * bindings/objc/objc_utility.mm:
3380 (KJS::Bindings::convertValueToObjcValue):
3381 (KJS::Bindings::convertObjcValueToValue):
3382 * bindings/runtime_array.h:
3384 2004-02-18 Richard Williamson <rjw@apple.com>
3386 Added support for export NSArrays.
3388 Updated valueAt() to take an ExecState so we can throw
3391 Implemented excludeSelectorFromJavaScript: in ObjcClass. This allows
3392 ObjectiveC classes to control the visibility of their methods in
3397 * bindings/jni/jni_runtime.cpp:
3398 (JavaField::valueFromInstance):
3399 (JavaArray::valueAt):
3400 * bindings/jni/jni_runtime.h:
3401 * bindings/objc/objc_class.mm:
3402 (ObjcClass::methodsNamed):
3403 * bindings/objc/objc_runtime.h:
3404 (KJS::Bindings::ObjcArray::getObjcArray):
3405 * bindings/objc/objc_runtime.mm:
3406 (ObjcField::valueFromInstance):
3407 (ObjcField::setValueToInstance):
3408 (ObjcArray::ObjcArray):
3409 (ObjcArray::~ObjcArray):
3410 (ObjcArray::operator=):
3411 (ObjcArray::setValueAt):
3412 (ObjcArray::valueAt):
3413 (ObjcArray::getLength):
3414 * bindings/objc/objc_utility.mm:
3415 (KJS::Bindings::convertValueToObjcValue):
3416 (KJS::Bindings::convertObjcValueToValue):
3417 * bindings/runtime.cpp:
3418 (Instance::getValueOfField):
3419 * bindings/runtime.h:
3420 * bindings/runtime_array.cpp:
3421 (RuntimeArrayImp::get):
3422 * bindings/runtime_object.cpp:
3423 (RuntimeObjectImp::get):
3425 2004-02-17 Richard Williamson <rjw@apple.com>
3427 Added String <-> NSString conversion.
3428 Added tests of String <-> NSString conversion to test program.
3432 * bindings/objc/objc_utility.mm:
3433 (KJS::Bindings::convertValueToObjcValue):
3434 (KJS::Bindings::convertObjcValueToValue):
3436 * bindings/testbindings.mm:
3437 (-[MyFirstInterface getString]):
3439 2004-02-15 Darin Adler <darin@apple.com>
3443 * JavaScriptCore.pbproj/project.pbxproj: Tweak build styles a bit, fixing OptimizedWithSymbols,
3444 and removing redundant settings of things that match defaults in other build styles.
3446 2004-02-13 Richard Williamson <rjw@apple.com>
3448 Work towards the JavaScript ObjC bindings. The bindings now work for
3449 simple scalar types. testbindings.mm is an illustration of how the
3454 * JavaScriptCore.pbproj/project.pbxproj:
3456 * bindings/jni/jni_class.cpp:
3457 (JavaClass::methodsNamed):
3458 * bindings/jni/jni_class.h:
3459 * bindings/jni/jni_instance.cpp:
3460 (JavaInstance::invokeMethod):
3461 * bindings/jni/jni_instance.h:
3462 * bindings/jni/jni_runtime.h:
3463 (KJS::Bindings::JavaMethod::returnType):
3464 * bindings/make_testbindings: Added.
3465 * bindings/objc/objc_class.h: Added.
3466 (KJS::Bindings::ObjcClass::~ObjcClass):
3467 (KJS::Bindings::ObjcClass::ObjcClass):
3468 (KJS::Bindings::ObjcClass::operator=):
3469 (KJS::Bindings::ObjcClass::constructorAt):
3470 (KJS::Bindings::ObjcClass::numConstructors):
3471 * bindings/objc/objc_class.mm: Added.
3472 (ObjcClass::_commonDelete):
3473 (ObjcClass::_commonCopy):
3474 (ObjcClass::_commonInit):
3475 (_createClassesByIsAIfNecessary):
3476 (ObjcClass::classForIsA):
3477 (ObjcClass::ObjcClass):
3479 (ObjcClass::methodsNamed):
3480 (ObjcClass::fieldNamed):
3481 * bindings/objc/objc_header.h: Added.
3482 * bindings/objc/objc_instance.h: Added.
3483 (KJS::Bindings::ObjcInstance::getObject):
3484 * bindings/objc/objc_instance.mm: Added.
3485 (ObjcInstance::ObjcInstance):
3486 (ObjcInstance::~ObjcInstance):
3487 (ObjcInstance::operator=):
3488 (ObjcInstance::begin):
3489 (ObjcInstance::end):
3490 (ObjcInstance::getClass):
3491 (ObjcInstance::invokeMethod):
3492 (ObjcInstance::defaultValue):
3493 (ObjcInstance::stringValue):
3494 (ObjcInstance::numberValue):
3495 (ObjcInstance::booleanValue):
3496 (ObjcInstance::valueOf):
3497 * bindings/objc/objc_jsobject.h: Added.
3498 * bindings/objc/objc_jsobject.mm: Added.
3499 * bindings/objc/objc_runtime.h:
3500 (KJS::Bindings::ObjcField::~ObjcField):
3501 (KJS::Bindings::ObjcField::ObjcField):
3502 (KJS::Bindings::ObjcField::operator=):
3503 (KJS::Bindings::ObjcMethod::ObjcMethod):
3504 (KJS::Bindings::ObjcMethod::~ObjcMethod):
3505 (KJS::Bindings::ObjcMethod::operator=):
3506 * bindings/objc/objc_runtime.mm: Added.
3507 (ObjcMethod::ObjcMethod):
3509 (ObjcMethod::numParameters):
3510 (ObjcMethod::getMethodSignature):
3511 (ObjcField::ObjcField):
3514 (ObjcField::valueFromInstance):
3515 (ObjcField::setValueToInstance):
3516 * bindings/objc/objc_utility.h: Added.
3518 * bindings/objc/objc_utility.mm: Added.
3519 (KJS::Bindings::JSMethodNameToObjCMethodName):
3520 (KJS::Bindings::convertValueToObjcValue):
3521 (KJS::Bindings::convertObjcValueToValue):
3522 (KJS::Bindings::objcValueTypeForType):
3523 * bindings/runtime.cpp:
3524 (MethodList::MethodList):
3525 (MethodList::operator=):
3526 (Instance::setValueOfField):
3527 (Instance::createBindingForLanguageInstance):
3528 (Instance::createRuntimeObject):
3529 * bindings/runtime.h:
3530 * bindings/runtime_method.cpp:
3531 (RuntimeMethodImp::RuntimeMethodImp):
3532 (RuntimeMethodImp::get):
3533 (RuntimeMethodImp::call):
3534 * bindings/runtime_method.h:
3535 * bindings/runtime_object.cpp:
3536 (RuntimeObjectImp::get):
3537 (RuntimeObjectImp::hasProperty):
3538 * bindings/test.js: Added.
3539 * bindings/testbindings.mm: Added.
3540 (-[MySecondInterface init]):
3541 (-[MyFirstInterface init]):
3542 (-[MyFirstInterface dealloc]):
3543 (+[MyFirstInterface JavaScriptNameForSelector:]):
3544 (-[MyFirstInterface getInt]):
3545 (-[MyFirstInterface setInt:]):
3546 (-[MyFirstInterface getMySecondInterface]):
3547 (-[MyFirstInterface logMessage:]):
3548 (GlobalImp::className):
3549 (readJavaScriptFromFile):
3554 2004-02-08 Darin Adler <darin@apple.com>
3558 - fixed things seen in the profile, for a total speedup of 4% on cvs-base (including changes across all projects)
3560 * JavaScriptCorePrefix.h: Add a workaround for a bug in our system headers that prevents the <ctype.h>
3561 macros from working right in C++ code that uses the <cctype> header.
3564 (KJS::inlineUTF8SequenceLengthNonASCII): Added.
3565 (KJS::UTF8SequenceLengthNonASCII): Added.
3566 (KJS::inlineUTF8SequenceLength): Added.
3567 (KJS::UTF8SequenceLength): Calls inlineUTF8SequenceLengthNonASCII now.
3568 (KJS::decodeUTF8Sequence): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3569 (KJS::createSortedOffsetsArray): Add special case for 1, 2, and 3 offsets, so we don't do qsort for those.
3570 (KJS::convertUTF16OffsetsToUTF8Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3571 (KJS::convertUTF8OffsetsToUTF16Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
3573 - fixed the test program so it won't hit the interpreter lock assertion
3575 * kjs/testkjs.cpp: (main): Just lock around the whole thing, since the test is singly threaded.
3579 2004-02-06 Richard Williamson <rjw@apple.com>
3581 Fixed 3550242 and 3546977. The first diff prevents an assert from firing. The second diff prevents a JavaScript exception, caused be an invalid conversion, which has a downstream consequence of preventing a valid conversion.
3585 * bindings/jni/jni_jsobject.cpp:
3586 (JSObject::toString):
3587 * bindings/jni/jni_utility.cpp:
3588 (KJS::Bindings::convertValueToJValue):
3590 2004-02-02 Darin Adler <darin@apple.com>
3594 - fixed <rdar://problem/3546613>: array of negative size leads to crash (test page at oscar.the-rileys.net)
3596 * kjs/array_object.cpp:
3597 (ArrayInstanceImp::ArrayInstanceImp): If the length is greater than 10,000, don't allocate an array until
3598 we start putting values in. This prevents new Array(2147483647) from causing trouble.
3599 (ArrayObjectImp::construct): Check number as described in specification, and raise a range error if the
3600 number is out of range. This prevents new Array(-1) from causing trouble.
3602 - fixed <rdar://problem/3545756>: Math.round screws up on numbers bigger than 2^31 (incorrect results on HP-35 calculator page)
3604 * kjs/math_object.cpp: (MathFuncImp::call): Change implementation to be much simpler and not involve
3605 casting to int. Results now match those in other browsers.
3607 2004-02-02 Darin Adler <darin@apple.com>
3611 - fixed <rdar://problem/3519285>: integer operations on large negative numbers yield bad results (discovered with "HTMLCrypt")
3612 - fixed other related overflow issues
3614 * kjs/value.h: Changed return types of toInteger, toInt32, toUInt32, and toUInt16.
3616 (ValueImp::toInteger): Change to return a double, since this operation, from the ECMA specification,
3617 must not restrict values to the range of a particular integer type.
3618 (ValueImp::toInt32): Used a sized integer type for the result of this function, and also added
3619 proper handling for negative results from fmod.
3620 (ValueImp::toUInt32): Ditto.
3621 (ValueImp::toUInt16): Ditto.
3622 (ValueImp::dispatchToUInt32): Changed result type from unsigned to uint32_t.
3624 * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Use a double instead of an int to handle
3625 out-of-integer-range values better in the slice function.
3626 * kjs/internal.cpp: (KJS::roundValue): Streamline the function, handling NAN and infinity properly.
3627 * kjs/number_object.cpp: (NumberProtoFuncImp::call): Use a double instead of an int to handle
3628 out-of-integer-range values better in the toString function.
3629 * kjs/string_object.cpp: (StringProtoFuncImp::call): Use a double instead of an int to handle
3630 out-of-integer-range values better in the charAt, charCodeAt, indexOf, lastIndexOf, slice,
3631 and substr functions.
3635 2004-01-30 Richard Williamson <rjw@apple.com>
3637 Fixed 3542044. Create KJS::String using UString constructor instead of passing UTF8 string to char* constructor.
3641 * bindings/jni/jni_instance.cpp:
3642 (JavaInstance::stringValue):
3644 2004-01-26 Darin Adler <darin@apple.com>
3646 * Makefile.am: Switch from pbxbuild to xcodebuild.
3648 2004-01-22 Richard Williamson <rjw@apple.com>
3650 Added stubs for ObjC language binding to JavaScript.
3652 * JavaScriptCore.pbproj/project.pbxproj:
3653 * bindings/jni/jni_runtime.h:
3654 * bindings/objc/objc_runtime.h: Added.
3655 (KJS::Bindings::ObjcParameter::ObjcParameter):
3656 (KJS::Bindings::ObjcParameter::~ObjcParameter):
3657 (KJS::Bindings::ObjcParameter::operator=):
3658 (KJS::Bindings::ObjcParameter::type):
3659 (KJS::Bindings::ObjcConstructor::ObjcConstructor):
3660 (KJS::Bindings::ObjcConstructor::~ObjcConstructor):
3661 (KJS::Bindings::ObjcConstructor::_commonCopy):
3662 (KJS::Bindings::ObjcConstructor::operator=):
3663 (KJS::Bindings::ObjcConstructor::value):
3664 (KJS::Bindings::ObjcConstructor::parameterAt):
3665 (KJS::Bindings::ObjcConstructor::numParameters):
3666 (KJS::Bindings::ObjcField::ObjcField):
3667 (KJS::Bindings::ObjcField::~ObjcField):
3668 * bindings/runtime.h:
3670 2004-01-22 Richard Williamson <rjw@apple.com>
3672 Simplified JavaString by using UString as backing store. This
3673 revealed a bug in CString's assignment operator which I fixed.
3675 Removed some dead code.
3679 * bindings/jni/jni_runtime.h:
3680 (KJS::Bindings::JavaString::JavaString):
3681 (KJS::Bindings::JavaString::_commonInit):
3682 (KJS::Bindings::JavaString::UTF8String):
3683 (KJS::Bindings::JavaString::uchars):
3684 (KJS::Bindings::JavaString::length):
3685 (KJS::Bindings::JavaString::ustring):
3686 * bindings/runtime_object.cpp:
3687 (RuntimeObjectImp::RuntimeObjectImp):
3688 * bindings/runtime_object.h:
3690 (KJS::CString::CString):
3691 (KJS::CString::operator=):
3697 2004-01-16 Richard Williamson <rjw@apple.com>
3699 Fixed 3525853. We weren't handling mapping to overloaded Java
3700 methods very well. Even though this is undefined the other
3701 browsers support it. Also fixed a bug with returning arrays
3702 from Java functions.
3706 * bindings/jni/jni_class.cpp:
3707 (JavaClass::_commonInit):
3708 (JavaClass::methodsNamed):
3709 * bindings/jni/jni_class.h:
3710 * bindings/jni/jni_instance.cpp:
3711 (JavaInstance::invokeMethod):
3712 * bindings/jni/jni_instance.h:
3713 * bindings/jni/jni_runtime.cpp:
3714 (JavaArray::convertJObjectToArray):
3715 (JavaField::valueFromInstance):
3716 (JavaMethod::signature):
3717 (JavaArray::valueAt):
3718 * bindings/jni/jni_runtime.h:
3719 * bindings/jni_jsobject.cpp:
3721 (JSObject::convertJObjectToValue):
3722 * bindings/runtime.cpp:
3723 (MethodList::addMethod):
3724 (MethodList::length):
3725 (MethodList::methodAt):
3726 (MethodList::~MethodList):
3727 * bindings/runtime.h:
3728 (KJS::Bindings::MethodList::MethodList):
3729 * bindings/runtime_method.cpp:
3730 (RuntimeMethodImp::RuntimeMethodImp):
3731 (RuntimeMethodImp::get):
3732 (RuntimeMethodImp::call):
3733 * bindings/runtime_method.h:
3734 * bindings/runtime_object.cpp:
3735 (RuntimeObjectImp::get):
3736 (RuntimeObjectImp::hasProperty):
3738 2004-01-16 Richard Williamson <rjw@apple.com>
3740 Fixed 3531229. Another place that needs the Push/PopLocalFrame
3741 protection implemented for 3530401.
3745 * bindings/runtime_method.cpp:
3746 (RuntimeMethodImp::call):
3748 2004-01-15 Richard Williamson <rjw@apple.com>
3750 Fixed 3530401. JNI doesn't cleanup local refs created on the
3751 main thread. IMO this is a bad bug in our JMI implementation.
3753 To work-around the problem I explicitly delete all local refs.
3754 Further, I've added Push/PopLocalFrame calls to catch any refs
3755 that I may have missed. This will guarantee that we don't leak
3756 any Java references.
3760 * bindings/jni/jni_class.cpp:
3761 (JavaClass::_commonInit):
3762 (JavaClass::JavaClass):
3763 * bindings/jni/jni_instance.cpp:
3764 (JavaInstance::begin):
3765 (JavaInstance::end):
3766 * bindings/jni/jni_instance.h:
3767 * bindings/jni/jni_runtime.cpp:
3768 (JavaConstructor::JavaConstructor):
3769 (JavaMethod::JavaMethod):
3770 * bindings/jni_jsobject.cpp:
3771 (JSObject::listFromJArray):
3772 * bindings/runtime.h:
3773 (KJS::Bindings::Instance::begin):
3774 (KJS::Bindings::Instance::end):
3775 * bindings/runtime_object.cpp:
3776 (RuntimeObjectImp::get):
3777 (RuntimeObjectImp::put):
3778 (RuntimeObjectImp::canPut):
3779 (RuntimeObjectImp::hasProperty):
3780 (RuntimeObjectImp::defaultValue):
3782 2004-01-15 Vicki Murley <vicki@apple.com>
3786 * JavaScriptCore.pbproj/project.pbxproj: Update copyright date to 2004.
3788 2004-01-14 Richard Williamson <rjw@apple.com>
3790 Fixed 3529466. With recent changes to Java plugin we must no
3791 longer call DeleteLocalRef(). Not a problem, it was an optimization anyway.
3795 * bindings/jni/jni_instance.cpp:
3796 (JObjectWrapper::JObjectWrapper):
3800 2004-01-14 Richard Williamson <rjw@apple.com>
3804 Finalize may be called on an JSObject after we've already remove all our references. The assert in this case is firing because we've received a finalize call from Java for an instance that we no longer know about. The fix is to check in finalize that we're getting a call on an instance that we still care about.
3808 * bindings/jni_jsobject.cpp:
3810 (removeJavaReference):
3811 (RootObject::removeAllJavaReferencesForRoot):
3814 2004-01-13 Richard Williamson <rjw@apple.com>
3818 The run loop that is used to execute JavaScript (in practice, always the main run loop) is held in a class variable. It is set and retained once and should not be released. Unfortunately is it being released when the 'root' object on a LiveConnect applet is released. This has the symptom of eventually causing an deallocation of the main run loop! Usually after about 5 instantiations/destructions of a LiveConnect applet. The CFRelease of the run loop was removed.
3822 * bindings/jni_jsobject.h:
3823 (KJS::Bindings::RootObject::~RootObject):
3829 2004-01-06 Richard Williamson <rjw@apple.com>
3831 Fixed 3521814. Finalize messages weren't being dispatched!
3835 * bindings/jni_jsobject.cpp:
3838 2004-01-05 Richard Williamson <rjw@apple.com>
3840 Added cache of JNI method IDs to minimize allocations. This mitigates the problem
3841 described by 3515579.
3843 Also cleanup up logging of Java exceptions.
3847 * bindings/jni/jni_class.cpp:
3848 (JavaClass::classForInstance):
3849 * bindings/jni/jni_instance.cpp:
3850 (JavaInstance::JavaInstance):
3851 (JavaInstance::getClass):
3852 (JavaInstance::invokeMethod):
3853 (JObjectWrapper::JObjectWrapper):
3854 (JObjectWrapper::~JObjectWrapper):
3855 * bindings/jni/jni_instance.h:
3856 (KJS::Bindings::JavaInstance::operator=):
3857 * bindings/jni/jni_runtime.cpp:
3858 (JavaMethod::JavaMethod):
3859 (JavaMethod::methodID):
3860 * bindings/jni/jni_runtime.h:
3861 (KJS::Bindings::JavaMethod::JavaMethod):
3862 * bindings/jni/jni_utility.cpp:
3866 (KJS::Bindings::getMethodID):
3867 (KJS::Bindings::callJNIVoidMethodIDA):
3868 (KJS::Bindings::callJNIObjectMethodIDA):
3869 (KJS::Bindings::callJNIByteMethodIDA):
3870 (KJS::Bindings::callJNICharMethodIDA):
3871 (KJS::Bindings::callJNIShortMethodIDA):
3872 (KJS::Bindings::callJNIIntMethodIDA):
3873 (KJS::Bindings::callJNILongMethodIDA):
3874 (KJS::Bindings::callJNIFloatMethodIDA):
3875 (KJS::Bindings::callJNIDoubleMethodIDA):
3876 (KJS::Bindings::callJNIBooleanMethodIDA):
3877 (KJS::Bindings::getCharactersFromJStringInEnv):
3878 (KJS::Bindings::getUCharactersFromJStringInEnv):
3879 (KJS::Bindings::getJNIField):
3880 * bindings/jni/jni_utility.h:
3882 l2003-12-23 John Sullivan <sullivan@apple.com>
3884 * JavaScriptCore.pbproj/project.pbxproj:
3885 Xcode version wars, harmless
3887 2003-12-23 Darin Adler <darin@apple.com>
3889 Reviewed by John (concept, not code, which is just the old code coming back).
3891 - fixed 3518092: REGRESSION (100-119): getting NaN instead of HH:MM times
3893 * kjs/date_object.cpp: Added back our CF-based implementations of gmtime, localtime,
3894 mktime, timegm, and time, because mktime, at least, won't handle a year of 0.
3896 2003-12-19 Richard Williamson <rjw@apple.com>
3898 Fixed 3515597. When an error occurs we need
3899 to make sure result values are zeroed.
3901 Cleaned up logs by adding a newline.
3905 * bindings/jni/jni_utility.cpp:
3906 (KJS::Bindings::getJavaVM):
3907 (KJS::Bindings::getJNIEnv):
3910 (KJS::Bindings::getJNIField):
3911 * bindings/jni_jsobject.cpp:
3912 (JSObject::convertValueToJObject):
3916 2003-12-17 Richard Williamson <rjw@apple.com>
3918 Ensure that all the symbols we export are in the KJS
3919 namespace (3512245).
3921 Also renamed JavaString.characters() to JavaString.UTF8String()
3922 for enhanced clarity.
3924 Added some sanity checking to constructor of JObjectWrapper.
3929 * bindings/jni/jni_class.cpp:
3930 * bindings/jni/jni_class.h:
3931 * bindings/jni/jni_instance.cpp:
3932 (JavaInstance::invokeMethod):
3933 (JObjectWrapper::JObjectWrapper):
3934 * bindings/jni/jni_instance.h:
3935 * bindings/jni/jni_runtime.cpp:
3936 (JavaParameter::JavaParameter):
3937 (JavaField::JavaField):
3938 (JavaMethod::JavaMethod):
3939 (JavaMethod::signature):
3940 * bindings/jni/jni_runtime.h:
3941 (KJS::Bindings::JavaString::ascii):
3942 (KJS::Bindings::JavaString::UTF8String):
3943 (KJS::Bindings::JavaString::JavaString):
3944 (KJS::Bindings::JavaString::_commonInit):
3945 (KJS::Bindings::JavaString::uchars):
3946 (KJS::Bindings::JavaString::length):
3947 (KJS::Bindings::JavaString::ustring):
3948 (KJS::Bindings::JavaParameter::type):
3949 (KJS::Bindings::JavaField::name):
3950 (KJS::Bindings::JavaField::type):
3951 (KJS::Bindings::JavaMethod::name):
3952 (KJS::Bindings::JavaMethod::returnType):
3953 * bindings/jni/jni_utility.cpp:
3954 (KJS::Bindings::getJavaVM):
3955 (KJS::Bindings::getJNIEnv):
3956 (KJS::Bindings::callJNIVoidMethod):
3957 (KJS::Bindings::callJNIObjectMethod):
3958 (KJS::Bindings::callJNIBooleanMethod):
3959 (KJS::Bindings::callJNIByteMethod):
3960 (KJS::Bindings::callJNICharMethod):
3961 (KJS::Bindings::callJNIShortMethod):
3962 (KJS::Bindings::callJNIIntMethod):
3963 (KJS::Bindings::callJNILongMethod):
3964 (KJS::Bindings::callJNIFloatMethod):
3965 (KJS::Bindings::callJNIDoubleMethod):
3966 (KJS::Bindings::callJNIVoidMethodA):
3967 (KJS::Bindings::callJNIObjectMethodA):
3968 (KJS::Bindings::callJNIByteMethodA):
3969 (KJS::Bindings::callJNICharMethodA):
3970 (KJS::Bindings::callJNIShortMethodA):
3971 (KJS::Bindings::callJNIIntMethodA):
3972 (KJS::Bindings::callJNILongMethodA):
3973 (KJS::Bindings::callJNIFloatMethodA):
3974 (KJS::Bindings::callJNIDoubleMethodA):
3975 (KJS::Bindings::callJNIBooleanMethodA):
3976 (KJS::Bindings::getCharactersFromJString):
3977 (KJS::Bindings::releaseCharactersForJString):
3978 (KJS::Bindings::getCharactersFromJStringInEnv):
3979 (KJS::Bindings::releaseCharactersForJStringInEnv):
3980 (KJS::Bindings::getUCharactersFromJStringInEnv):
3981 (KJS::Bindings::releaseUCharactersForJStringInEnv):
3982 (KJS::Bindings::JNITypeFromClassName):
3983 (KJS::Bindings::signatureFromPrimitiveType):
3984 (KJS::Bindings::JNITypeFromPrimitiveType):
3985 (KJS::Bindings::getJNIField):
3986 (KJS::Bindings::convertValueToJValue):
3987 * bindings/jni/jni_utility.h:
3988 * bindings/jni_jsobject.cpp:
3989 (KJS::Bindings::JSObject::invoke):
3990 (KJS::Bindings::JSObject::JSObject):
3991 (KJS::Bindings::JSObject::call):
3992 (KJS::Bindings::JSObject::eval):
3993 (KJS::Bindings::JSObject::getMember):
3994 (KJS::Bindings::JSObject::setMember):
3995 (KJS::Bindings::JSObject::removeMember):
3996 (KJS::Bindings::JSObject::getSlot):
3997 (KJS::Bindings::JSObject::setSlot):
3998 (KJS::Bindings::JSObject::toString):
3999 (KJS::Bindings::JSObject::finalize):
4000 (KJS::Bindings::JSObject::createNative):
4001 (KJS::Bindings::JSObject::convertValueToJObject):
4002 (KJS::Bindings::JSObject::convertJObjectToValue):
4003 (KJS::Bindings::JSObject::listFromJArray):
4004 * bindings/jni_jsobject.h:
4005 * bindings/runtime.cpp:
4006 * bindings/runtime.h:
4007 * bindings/runtime_method.cpp:
4008 * bindings/runtime_method.h:
4012 2003-12-16 Richard Williamson <rjw@apple.com>
4014 Ack! More assertions. Lock ALL entry points into the interpreter!
4019 * bindings/jni_jsobject.cpp:
4020 (Bindings::JSObject::call):
4021 (Bindings::JSObject::eval):
4022 (Bindings::JSObject::getMember):
4023 (Bindings::JSObject::setMember):
4024 (Bindings::JSObject::removeMember):
4025 (Bindings::JSObject::getSlot):
4026 (Bindings::JSObject::setSlot):
4027 (Bindings::JSObject::convertJObjectToValue):
4029 2003-12-15 Richard Williamson <rjw@apple.com>
4031 Fixed a couple of snafus and removed some logging.
4035 * bindings/jni_jsobject.cpp:
4036 (Bindings::performJavaScriptAccess):
4037 (Bindings::completedJavaScriptAccess):
4038 (Bindings::dispatchToJavaScriptThread):
4039 Removed some annoying JS_LOG clutter.
4041 (Bindings::RootObject::removeAllJavaReferencesForRoot):
4042 Fixed allocation of key buffer that was called after it was needed.
4044 (Bindings::JSObject::invoke):
4045 (Bindings::JSObject::JSObject):
4046 (Bindings::JSObject::getMember):
4047 (Bindings::JSObject::getSlot):
4048 Added additional interpreter locks around getMember and getSlot.
4049 These functions may cause allocation of JS impls.
4051 2003-12-15 Richard Williamson <rjw@apple.com>
4053 args weren't passed to 'call' invocation. d'oh.
4054 lock interpreter when we create instances of JS impls.
4058 * bindings/jni_jsobject.cpp:
4059 (Bindings::JSObject::call):
4060 (Bindings::JSObject::eval):
4061 (Bindings::JSObject::getMember):
4062 (Bindings::JSObject::setMember):
4063 (Bindings::JSObject::getSlot):
4064 (Bindings::JSObject::convertValueToJObject):
4065 (Bindings::JSObject::convertJObjectToValue):
4066 (Bindings::JSObject::listFromJArray):
4067 * bindings/jni_jsobject.h:
4069 2003-12-15 Richard Williamson <rjw@apple.com>
4071 Last piece of LiveConnect! This checkin adds implementation
4072 of the Java to JavaScript object conversion functions.
4076 * bindings/jni/jni_instance.cpp:
4077 (JavaInstance::invokeMethod):
4078 * bindings/jni/jni_utility.cpp:
4079 * bindings/jni/jni_utility.h:
4080 * bindings/jni_jsobject.cpp:
4081 (Bindings::JSObject::invoke):
4082 (Bindings::JSObject::call):
4083 (Bindings::JSObject::eval):
4084 (Bindings::JSObject::getMember):
4085 (Bindings::JSObject::setMember):
4086 (Bindings::JSObject::getSlot):
4087 (Bindings::JSObject::setSlot):
4088 (Bindings::JSObject::createNative):
4089 (Bindings::JSObject::convertValueToJObject):
4090 (Bindings::JSObject::convertJObjectToValue):
4091 (Bindings::JSObject::listFromJArray):
4092 * bindings/jni_jsobject.h:
4094 * bindings/runtime_method.cpp:
4095 (RuntimeMethodImp::get):
4096 (RuntimeMethodImp::codeType):
4097 (RuntimeMethodImp::execute):
4099 2003-12-12 Richard Williamson <rjw@apple.com>
4101 Added implementation of stubs in JSObject. All that
4102 remains is a couple of simple conversion functions stubs and
4103 we're done with LiveConnect. Also, changed string passing to
4104 JS to use uchars instead of chars.
4108 * bindings/jni/jni_runtime.h:
4109 (Bindings::JavaString::JavaString):
4110 (Bindings::JavaString::_commonInit):
4111 (Bindings::JavaString::_commonCopy):
4112 (Bindings::JavaString::_commonDelete):
4113 (Bindings::JavaString::~JavaString):
4114 (Bindings::JavaString::operator=):
4115 (Bindings::JavaString::uchars):
4116 (Bindings::JavaString::length):
4117 (Bindings::JavaString::ustring):
4118 * bindings/jni/jni_utility.cpp:
4119 (getUCharactersFromJStringInEnv):
4120 (releaseUCharactersForJStringInEnv):
4121 (convertValueToJObject):
4122 (convertJObjectToValue):
4123 * bindings/jni/jni_utility.h:
4124 * bindings/jni_jsobject.cpp:
4125 (Bindings::JSObject::invoke):
4126 (Bindings::JSObject::call):
4127 (Bindings::JSObject::eval):
4128 (Bindings::JSObject::getMember):
4129 (Bindings::JSObject::setMember):
4130 (Bindings::JSObject::removeMember):
4131 (Bindings::JSObject::getSlot):
4132 (Bindings::JSObject::setSlot):
4133 * bindings/jni_jsobject.h:
4135 2003-12-12 Richard Williamson <rjw@apple.com>
4137 Ensure that all calls from Java into JavaScript are
4138 performed on a designated thread (the main thread).
4142 * bindings/jni_jsobject.cpp:
4143 (isJavaScriptThread):
4145 (Bindings::performJavaScriptAccess):
4146 (Bindings::completedJavaScriptAccess):
4147 (Bindings::initializeJavaScriptAccessLock):
4148 (Bindings::lockJavaScriptAccess):
4149 (Bindings::unlockJavaScriptAccess):
4150 (Bindings::dispatchToJavaScriptThread):
4151 (Bindings::RootObject::setFindRootObjectForNativeHandleFunction):
4152 (Bindings::RootObject::removeAllJavaReferencesForRoot):
4153 (Bindings::JSObject::invoke):
4154 (Bindings::JSObject::JSObject):
4155 (Bindings::JSObject::call):
4156 (Bindings::JSObject::eval):
4157 (Bindings::JSObject::getMember):
4158 (Bindings::JSObject::setMember):
4159 (Bindings::JSObject::removeMember):
4160 (Bindings::JSObject::getSlot):
4161 (Bindings::JSObject::setSlot):
4162 (Bindings::JSObject::toString):
4163 (Bindings::JSObject::finalize):
4164 (Bindings::JSObject::getWindow):
4165 * bindings/jni_jsobject.h:
4166 (Bindings::RootObject::~RootObject):
4167 (Bindings::RootObject::findRootObjectForNativeHandleFunction):
4168 (Bindings::RootObject::runLoop):
4169 (Bindings::RootObject::performJavaScriptSource):
4172 2003-12-11 Richard Williamson <rjw@apple.com>
4174 Added support for calling a JavaScript function from
4175 Java. Right now this only works for void func(void)
4176 functions, but the conversion of args and return values
4179 Cleaned up and verified reference counting scheme, and
4180 dereferencing of vended JavaScript objects when applet is
4181 destroyed (actually when part is destroyed).
4183 Removed link hack for testkjs now that the Java folks think
4184 they have a solution for the 1.4.2 JavaVM link problem. Although
4185 Greg B. thinks his solution may cause problems for the 1.3.1
4186 version of the VM!?!
4191 * bindings/jni/jni_runtime.h:
4192 (Bindings::JavaString::JavaString):
4193 * bindings/jni/jni_utility.cpp:
4194 (convertValueToJValue):
4195 (convertValueToJObject):
4197 * bindings/jni/jni_utility.h:
4198 * bindings/jni_jsobject.cpp:
4199 (KJS_setFindRootObjectForNativeHandleFunction):
4200 (KJS_findRootObjectForNativeHandleFunction):
4201 (getReferencesByRootDictionary):
4202 (getReferencesDictionary):
4203 (findReferenceDictionary):
4206 (removeJavaReference):