aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp')
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 64cf27ae1f..8913fa2f2e 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -347,6 +347,7 @@ private slots:
void manyArguments();
void forInIterator();
void localForInIterator();
+ void shadowedFunctionName();
private:
// static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter);
@@ -8423,6 +8424,20 @@ void tst_qqmlecmascript::localForInIterator()
QCOMPARE(ret.toString(), QStringLiteral("3"));
}
+void tst_qqmlecmascript::shadowedFunctionName()
+{
+ // verify that arguments shadow the function name
+ QJSEngine engine;
+ QJSValue v = engine.evaluate(QString::fromLatin1(
+ "function f(f) { return f; }\n"
+ "f(true)\n"
+ ));
+ QVERIFY(!v.isError());
+ QVERIFY(v.isBool());
+ QCOMPARE(v.toBool(), true);
+}
+
+
QTEST_MAIN(tst_qqmlecmascript)