From 16c0c3d4312a55f9bdabd3faee854ebd965d37c7 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 15 Sep 2009 15:06:20 +0200 Subject: Fix QScriptValue::strictlyEquals strictlyEquals has to continue to work if one of the values has an engine and the other one doesn't. Use the other value's engine to construct a JSValue if possible and use JSC::JSValue::strictEqual. Reviewed-by: Kent Hansen --- src/script/api/qscriptvalue.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp index a1f5878..6a6381e 100644 --- a/src/script/api/qscriptvalue.cpp +++ b/src/script/api/qscriptvalue.cpp @@ -1197,8 +1197,15 @@ bool QScriptValue::strictlyEquals(const QScriptValue &other) const "a different engine"); return false; } - if (d->type != other.d_ptr->type) + + 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); + return false; + } switch (d->type) { case QScriptValuePrivate::JavaScriptCore: return JSC::JSValue::strictEqual(d->jscValue, other.d_ptr->jscValue); -- cgit v0.12