diff options
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 13 |
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 99fe262cb4..44582817d5 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -337,6 +337,7 @@ private slots: void constkw_data(); void constkw(); void redefineGlobalProp(); + void freeze_empty_object(); private: // static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter); @@ -8289,6 +8290,18 @@ void tst_qqmlecmascript::redefineGlobalProp() } } +void tst_qqmlecmascript::freeze_empty_object() +{ + // this shouldn't crash + QJSEngine engine; + QJSValue v = engine.evaluate(QString::fromLatin1( + "var obj = {};\n" + "Object.freeze(obj);\n" + )); + QVERIFY(!v.isError()); + QCOMPARE(v.toBool(), true); +} + QTEST_MAIN(tst_qqmlecmascript) |