aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index f849403cd8..eb9b05e764 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -363,6 +363,7 @@ private slots:
void templateStringTerminator();
void arrayAndException();
void numberToStringWithRadix();
+ void tailCallWithArguments();
private:
// static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter);
@@ -8894,6 +8895,18 @@ void tst_qqmlecmascript::numberToStringWithRadix()
}
}
+void tst_qqmlecmascript::tailCallWithArguments()
+{
+ QJSEngine engine;
+ const QJSValue value = engine.evaluate(
+ "'use strict';\n"
+ "[[1, 2]].map(function (a) {\n"
+ " return (function() { return Math.min.apply(this, arguments); })(a[0], a[1]);\n"
+ "})[0];");
+ QVERIFY(!value.isError());
+ QCOMPARE(value.toInt(), 1);
+}
+
QTEST_MAIN(tst_qqmlecmascript)
#include "tst_qqmlecmascript.moc"