From 4b14c4b4da2294926d649ea767cc22b14bc3061e Mon Sep 17 00:00:00 2001 From: Arnaud Vrac Date: Wed, 14 Sep 2016 11:21:36 +0200 Subject: Fix corruption when adding or changing properties of JS objects Commit 833c99db20 introduced this regression by only moving part of the value data to the proper offset. Task-number: QTBUG-53261 Change-Id: I11241c57057a57794bc3ca60ee437206e524f355 Reviewed-by: Ulf Hermann Reviewed-by: Lars Knoll --- tests/auto/qml/qjsengine/tst_qjsengine.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp index acaa6604f9..6cbafbf055 100644 --- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp +++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp @@ -195,6 +195,7 @@ private slots: void v4FunctionWithoutQML(); void withNoContext(); + void holeInPropertyData(); signals: void testSignal(); @@ -3858,6 +3859,19 @@ void tst_QJSEngine::withNoContext() engine.evaluate("with (noContext) true"); } +void tst_QJSEngine::holeInPropertyData() +{ + QJSEngine engine; + QJSValue ok = engine.evaluate( + "var o = {};\n" + "o.bar = 0xcccccccc;\n" + "o.foo = 0x55555555;\n" + "Object.defineProperty(o, 'bar', { get: function() { return 0xffffffff }});\n" + "o.bar === 0xffffffff && o.foo === 0x55555555;"); + QVERIFY(ok.isBool()); + QVERIFY(ok.toBool()); +} + QTEST_MAIN(tst_QJSEngine) #include "tst_qjsengine.moc" -- cgit v1.2.3