diff options
Diffstat (limited to 'tests/auto/qml/qqmlecmascript')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/BLACKLIST | 2 | ||||
-rw-r--r-- | tests/auto/qml/qqmlecmascript/data/functionAsDefaultArgument.qml | 8 | ||||
-rw-r--r-- | tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 10 |
3 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/BLACKLIST b/tests/auto/qml/qqmlecmascript/BLACKLIST new file mode 100644 index 0000000000..bd25566eef --- /dev/null +++ b/tests/auto/qml/qqmlecmascript/BLACKLIST @@ -0,0 +1,2 @@ +[gcCrashRegressionTest] +macos arm diff --git a/tests/auto/qml/qqmlecmascript/data/functionAsDefaultArgument.qml b/tests/auto/qml/qqmlecmascript/data/functionAsDefaultArgument.qml new file mode 100644 index 0000000000..9f576d1af8 --- /dev/null +++ b/tests/auto/qml/qqmlecmascript/data/functionAsDefaultArgument.qml @@ -0,0 +1,8 @@ +import QtQml 2.15 + +QtObject { + id: root + + function f(inner=function(){ root.objectName = "didRun" } ){ inner() } + Component.onCompleted: f() +} diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 7da1b2c500..696566d987 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -387,6 +387,7 @@ private slots: void proxyIteration(); void proxyHandlerTraps(); void gcCrashRegressionTest(); + void functionAsDefaultArgument(); private: // static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter); @@ -9371,6 +9372,15 @@ void tst_qqmlecmascript::proxyHandlerTraps() QVERIFY(value.isString() && value.toString() == QStringLiteral("SUCCESS")); } +void tst_qqmlecmascript::functionAsDefaultArgument() +{ + QQmlEngine engine; + QQmlComponent component(&engine, testFileUrl("functionAsDefaultArgument.qml")); + QScopedPointer<QObject> root(component.create()); + QVERIFY(root); + QCOMPARE(root->objectName(), "didRun"); +} + QTEST_MAIN(tst_qqmlecmascript) #include "tst_qqmlecmascript.moc" |