diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-09-25 20:56:51 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-09-25 20:56:51 +0200 |
commit | f9ef039ad955db67dc3ab6e9056afc4a325aa9a3 (patch) | |
tree | 4928ff85fb630639e306ea4eb7137a2064a80c8b /tests/auto/qml/qqmlecmascript | |
parent | 0238c739f81911f0963cf2c40b27dcfc8e3d38b7 (diff) | |
parent | 52fb4685e95e5b44e54d2d0f8ea27dea866c75e9 (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
src/qml/debugger/qqmldebug.cpp
Change-Id: I93de5a81b18cdece475870cf7cfba1b9baef2304
Diffstat (limited to 'tests/auto/qml/qqmlecmascript')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/data/qtbug_46022.js | 21 | ||||
-rw-r--r-- | tests/auto/qml/qqmlecmascript/data/qtbug_46022.qml | 7 | ||||
-rw-r--r-- | tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 11 |
3 files changed, 39 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/qtbug_46022.js b/tests/auto/qml/qqmlecmascript/data/qtbug_46022.js new file mode 100644 index 0000000000..385d7f9e97 --- /dev/null +++ b/tests/auto/qml/qqmlecmascript/data/qtbug_46022.js @@ -0,0 +1,21 @@ +var obj = {} +obj[5289] = 0 +obj[5290] = 0 +obj[5288] = 0 +obj[5287] = 0 +delete obj[5288] + +var a = Object.getOwnPropertyNames(obj) +var test1 = a.every(function(key) { + return obj.hasOwnProperty(key) +}) + +obj = {} +obj[8187] = 0 +obj[8188] = 0 +delete obj[8187] + +var b = Object.getOwnPropertyNames(obj) +var test2 = b.every(function(key) { + return obj.hasOwnProperty(key) +}) diff --git a/tests/auto/qml/qqmlecmascript/data/qtbug_46022.qml b/tests/auto/qml/qqmlecmascript/data/qtbug_46022.qml new file mode 100644 index 0000000000..2d2375de3e --- /dev/null +++ b/tests/auto/qml/qqmlecmascript/data/qtbug_46022.qml @@ -0,0 +1,7 @@ +import "qtbug_46022.js" as Test +import QtQuick 2.0 + +QtObject { + property bool test1: Test.test1 + property bool test2: Test.test2 +} diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index a1038b0f52..e186c364c3 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -326,6 +326,7 @@ private slots: void readUnregisteredQObjectProperty(); void writeUnregisteredQObjectProperty(); void switchExpression(); + void qtbug_46022(); private: // static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter); @@ -7876,6 +7877,16 @@ void tst_qqmlecmascript::switchExpression() QCOMPARE(v.toBool(), true); } +void tst_qqmlecmascript::qtbug_46022() +{ + QQmlComponent component(&engine, testFileUrl("qtbug_46022.qml")); + + QScopedPointer<QObject> obj(component.create()); + QVERIFY(obj != 0); + QCOMPARE(obj->property("test1").toBool(), true); + QCOMPARE(obj->property("test2").toBool(), true); +} + QTEST_MAIN(tst_qqmlecmascript) #include "tst_qqmlecmascript.moc" |