diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-09-08 13:10:21 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-09-08 13:10:21 +0200 |
commit | 38fe461e2cc4bf3aebcb98d25c643bfe6653120a (patch) | |
tree | b625415f33791ce0202538396509379fd04b111a /tests/auto/qml/qqmlecmascript | |
parent | f9ee33f9683a4cd4d1a2e41efa6e8d124e9d731d (diff) | |
parent | f7c3035fa1d965dceb36892122683a5ceb6cab89 (diff) |
Merge remote-tracking branch 'origin/5.3' into 5.4
Conflicts:
.qmake.conf
src/qml/jsruntime/qv4arraydata.cpp
src/quick/scenegraph/util/qsgatlastexture.cpp
Change-Id: Ic4c96066d5c37dcf0d5446baed590ea005d445ce
Diffstat (limited to 'tests/auto/qml/qqmlecmascript')
4 files changed, 29 insertions, 1 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/importScriptsWithoutQmlMode.js b/tests/auto/qml/qqmlecmascript/data/importScriptsWithoutQmlMode.js new file mode 100644 index 0000000000..aabcc9f3b8 --- /dev/null +++ b/tests/auto/qml/qqmlecmascript/data/importScriptsWithoutQmlMode.js @@ -0,0 +1,7 @@ +.pragma library + +var as = undefined +function isLegal() { + var as = true; + return as; +} diff --git a/tests/auto/qml/qqmlecmascript/data/importScriptsWithoutQmlMode.qml b/tests/auto/qml/qqmlecmascript/data/importScriptsWithoutQmlMode.qml new file mode 100644 index 0000000000..17d12199d7 --- /dev/null +++ b/tests/auto/qml/qqmlecmascript/data/importScriptsWithoutQmlMode.qml @@ -0,0 +1,10 @@ +import QtQuick 2.0 + +import "importScriptsWithoutQmlMode.js" as Export + +Rectangle { + id: root + property bool success: false + + Component.onCompleted: success = Export.isLegal() +} diff --git a/tests/auto/qml/qqmlecmascript/data/sequenceSort.qml b/tests/auto/qml/qqmlecmascript/data/sequenceSort.qml index 5e2892a31d..b130408c18 100644 --- a/tests/auto/qml/qqmlecmascript/data/sequenceSort.qml +++ b/tests/auto/qml/qqmlecmascript/data/sequenceSort.qml @@ -23,7 +23,7 @@ Item { } function compareStrings(a, b) { - return (a < b) ? 1 : -1; + return (a == b) ? 0 : ((a < b) ? 1 : -1); } function compareNumbers(a, b) { diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 7273cfbe5d..06d061a9fa 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -315,6 +315,7 @@ private slots: void lazyBindingEvaluation(); void varPropertyAccessOnObjectWithInvalidContext(); void importedScriptsAccessOnObjectWithInvalidContext(); + void importedScriptsWithoutQmlMode(); void contextObjectOnLazyBindings(); void garbageCollectionDuringCreation(); void qtbug_39520(); @@ -7636,6 +7637,16 @@ void tst_qqmlecmascript::importedScriptsAccessOnObjectWithInvalidContext() QTRY_VERIFY(obj->property("success") == true); } +void tst_qqmlecmascript::importedScriptsWithoutQmlMode() +{ + QQmlComponent component(&engine, testFileUrl("importScriptsWithoutQmlMode.qml")); + QScopedPointer<QObject> obj(component.create()); + if (obj.isNull()) + qDebug() << component.errors().first().toString(); + QVERIFY(!obj.isNull()); + QTRY_VERIFY(obj->property("success") == true); +} + void tst_qqmlecmascript::contextObjectOnLazyBindings() { QQmlComponent component(&engine, testFileUrl("contextObjectOnLazyBindings.qml")); |