summaryrefslogtreecommitdiffstats
path: root/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qscriptvalue/tst_qscriptvalue.cpp')
-rw-r--r--tests/auto/qscriptvalue/tst_qscriptvalue.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
index 5de0116..c7f496b 100644
--- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
+++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
@@ -1599,6 +1599,15 @@ void tst_QScriptValue::toRegExp()
QVERIFY(eng.undefinedValue().toRegExp().isEmpty());
}
+void tst_QScriptValue::instanceOf_twoEngines()
+{
+ QScriptEngine eng;
+ QScriptValue obj = eng.newObject();
+ QScriptEngine otherEngine;
+ QTest::ignoreMessage(QtWarningMsg, "QScriptValue::instanceof: cannot perform operation on a value created in a different engine");
+ QCOMPARE(obj.instanceOf(otherEngine.globalObject().property("Object")), false);
+}
+
void tst_QScriptValue::instanceOf()
{
QScriptEngine eng;
@@ -1629,10 +1638,6 @@ void tst_QScriptValue::instanceOf()
QCOMPARE(arr.instanceOf(eng.evaluate("QObject")), false);
QCOMPARE(QScriptValue().instanceOf(arr), false);
-
- QScriptEngine otherEngine;
- QTest::ignoreMessage(QtWarningMsg, "QScriptValue::instanceof: cannot perform operation on a value created in a different engine");
- QCOMPARE(obj.instanceOf(otherEngine.globalObject().property("Object")), false);
}
void tst_QScriptValue::isArray_data()