Fixed <rdar://problem/3972905> CrashTracer: ...36 crashes at com.apple.WebCore:...
authorrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Feb 2005 01:41:27 +0000 (01:41 +0000)
committerrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Feb 2005 01:41:27 +0000 (01:41 +0000)
Revert to old (and correct) behavior of returning runtime object
when passed as a parameter, rather than it's corresponding DOM
object.

        Reviewed by Chris.

        * bindings/objc/WebScriptObject.mm:
        (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8519 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/bindings/objc/WebScriptObject.mm

index e35f2af3f6d11ac8436ffc9b06e149499aba60b2..1a61eb5e5e185c569513a42dd998fe4ff4b0808c 100644 (file)
@@ -1,3 +1,16 @@
+2005-02-03  Richard Williamson   <rjw@apple.com>
+
+       Fixed <rdar://problem/3972905> CrashTracer: ...36 crashes at com.apple.WebCore: khtml::CSSStyleSelector::applyDeclarations + 120
+
+       Revert to old (and correct) behavior of returning runtime object
+       when passed as a parameter, rather than it's corresponding DOM
+       object.
+
+        Reviewed by Chris.
+
+        * bindings/objc/WebScriptObject.mm:
+        (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
+
 === Safari-183 ===
 
 === Safari-182 ===
index b91d415ec5bcf2d7d5ec69337eda0a2f85c0b71e..9a9405f1d2453a1659a90c48bbf63df8fc76aaf2 100644 (file)
@@ -412,8 +412,15 @@ static KJS::List listFromNSArray(ExecState *exec, NSArray *array)
     // First see if we have a ObjC instance.
     if (value.type() == KJS::ObjectType){
         ObjectImp *objectImp = static_cast<ObjectImp*>(value.imp());
+
+       if (objectImp->classInfo() != &KJS::RuntimeObjectImp::info) {
+           Value runtimeObject = objectImp->get(root->interpreter()->globalExec(), "__apple_runtime_object");
+           if (!runtimeObject.isNull() && runtimeObject.type() == KJS::ObjectType)
+               objectImp = static_cast<RuntimeObjectImp*>(runtimeObject.imp());
+       }
+
         if (objectImp->classInfo() == &KJS::RuntimeObjectImp::info) {
-            RuntimeObjectImp *imp = static_cast<RuntimeObjectImp *>(value.imp());
+            RuntimeObjectImp *imp = static_cast<RuntimeObjectImp *>(objectImp);
             ObjcInstance *instance = static_cast<ObjcInstance*>(imp->getInternalInstance());
             if (instance)
                 result = instance->getObject();