src/script/api/qscriptvalue.cpp
branchRCL_3
changeset 5 d3bac044e0f0
parent 4 3b1da2848fc7
child 7 3f74d0d4af4c
--- a/src/script/api/qscriptvalue.cpp	Fri Feb 19 23:40:16 2010 +0200
+++ b/src/script/api/qscriptvalue.cpp	Fri Mar 12 15:46:37 2010 +0200
@@ -1148,10 +1148,15 @@
     }
 
     if (d->type != other.d_ptr->type) {
-        if (d->type == QScriptValuePrivate::JavaScriptCore)
-            return JSC::JSValue::strictEqual(d->jscValue, d->engine->scriptValueToJSCValue(other));
-        else if (other.d_ptr->type == QScriptValuePrivate::JavaScriptCore)
-            return JSC::JSValue::strictEqual(other.d_ptr->engine->scriptValueToJSCValue(*this), other.d_ptr->jscValue);
+        if (d->type == QScriptValuePrivate::JavaScriptCore) {
+            QScriptEnginePrivate *eng_p = d->engine ? d->engine : other.d_ptr->engine;
+            if (eng_p)
+                return JSC::JSValue::strictEqual(d->jscValue, eng_p->scriptValueToJSCValue(other));
+        } else if (other.d_ptr->type == QScriptValuePrivate::JavaScriptCore) {
+            QScriptEnginePrivate *eng_p = other.d_ptr->engine ? other.d_ptr->engine : d->engine;
+            if (eng_p)
+                return JSC::JSValue::strictEqual(eng_p->scriptValueToJSCValue(*this), other.d_ptr->jscValue);
+        }
 
         return false;
     }