aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlecmascript')
-rw-r--r--tests/auto/qml/qqmlecmascript/data/qtbug_54589.qml16
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp18
2 files changed, 34 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/qtbug_54589.qml b/tests/auto/qml/qqmlecmascript/data/qtbug_54589.qml
new file mode 100644
index 0000000000..8f7d5f2a70
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/qtbug_54589.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+
+QtObject {
+ function checkPropertyDeletion() {
+ var o = {
+ x: 1,
+ y: 2
+ };
+ o.z = 3
+ delete o.y;
+
+ return (o.x === 1 && o.y === undefined && o.z === 3)
+ }
+
+ property bool result: checkPropertyDeletion()
+}
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 07b5e55384..de3ead917f 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -324,6 +324,8 @@ private slots:
void switchExpression();
void qtbug_46022();
void qtbug_52340();
+ void qtbug_54589();
+ void qtbug_54687();
private:
// static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter);
@@ -7965,6 +7967,22 @@ void tst_qqmlecmascript::qtbug_52340()
QVERIFY(returnValue.toBool());
}
+void tst_qqmlecmascript::qtbug_54589()
+{
+ QQmlComponent component(&engine, testFileUrl("qtbug_54589.qml"));
+
+ QScopedPointer<QObject> obj(component.create());
+ QVERIFY(obj != 0);
+ QCOMPARE(obj->property("result").toBool(), true);
+}
+
+void tst_qqmlecmascript::qtbug_54687()
+{
+ QJSEngine e;
+ // it's simple: this shouldn't crash.
+ engine.evaluate("12\n----12");
+}
+
QTEST_MAIN(tst_qqmlecmascript)
#include "tst_qqmlecmascript.moc"