diff options
author | Arnaud Vrac <avrac@freebox.fr> | 2016-09-14 11:21:36 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2016-10-10 09:41:55 +0000 |
commit | 4b14c4b4da2294926d649ea767cc22b14bc3061e (patch) | |
tree | 4bb172deb7b7713c6d5ad0313020505a43bb1b8a /tests | |
parent | 376077a8e73100ccada6f2bb81c6664817bb44ba (diff) |
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 <ulf.hermann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/qjsengine/tst_qjsengine.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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" |