]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - API/APICast.h
JavaScriptCore-1097.13.tar.gz
[apple/javascriptcore.git] / API / APICast.h
index ba00d02e1071888e34422544356ae3d6644a5eff..f019a7a4b9695dff8bccd7d489e7653ec9501487 100644 (file)
@@ -69,7 +69,7 @@ inline JSC::JSValue toJS(JSC::ExecState* exec, JSValueRef v)
     if (!jsCell)
         return JSC::JSValue();
     if (jsCell->isAPIValueWrapper())
-        return static_cast<JSC::JSAPIValueWrapper*>(jsCell)->value();
+        return JSC::jsCast<JSC::JSAPIValueWrapper*>(jsCell)->value();
     return jsCell;
 #else
     return JSC::JSValue::decode(reinterpret_cast<JSC::EncodedJSValue>(const_cast<OpaqueJSValue*>(v)));
@@ -111,8 +111,8 @@ inline JSValueRef toRef(JSC::ExecState* exec, JSC::JSValue v)
     if (!v)
         return 0;
     if (!v.isCell())
-        return reinterpret_cast<JSValueRef>(asCell(JSC::jsAPIValueWrapper(exec, v)));
-    return reinterpret_cast<JSValueRef>(asCell(v));
+        return reinterpret_cast<JSValueRef>(JSC::jsAPIValueWrapper(exec, v).asCell());
+    return reinterpret_cast<JSValueRef>(v.asCell());
 #else
     UNUSED_PARAM(exec);
     return reinterpret_cast<JSValueRef>(JSC::JSValue::encode(v));