aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp')
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 86bd32ccbe..5f5f30a307 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -400,6 +400,7 @@ private slots:
void proxyIteration();
void proxyHandlerTraps();
void gcCrashRegressionTest();
+ void cmpInThrows();
private:
// static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter);
@@ -9693,6 +9694,18 @@ void tst_qqmlecmascript::proxyHandlerTraps()
QVERIFY(value.isString() && value.toString() == QStringLiteral("SUCCESS"));
}
+void tst_qqmlecmascript::cmpInThrows()
+{
+ QJSEngine engine;
+ QStringList stacktrace;
+ QJSValue value = engine.evaluate(QStringLiteral("\n\n'foo' in 1"), QStringLiteral("foo.js"), 12,
+ &stacktrace);
+ QVERIFY(value.isError());
+ QCOMPARE(value.errorType(), QJSValue::TypeError);
+ QVERIFY(!stacktrace.isEmpty());
+ QCOMPARE(stacktrace.at(0), QStringLiteral("%entry:14:-1:file:foo.js"));
+}
+
QTEST_MAIN(tst_qqmlecmascript)
#include "tst_qqmlecmascript.moc"