aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4runtimecodegen.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-02-10 19:17:40 +0100
committerLars Knoll <lars.knoll@qt.io>2018-04-25 17:49:21 +0000
commit31026b2e83ac338ebfb59ce0fede268e9ce51fed (patch)
tree0a9bdf078db659cbed8c923bc04c8b6352bdf925 /src/qml/jsruntime/qv4runtimecodegen.cpp
parent219485d898556368a833576f1c55e210c1cf7189 (diff)
Correctly check for duplicate parameter names
Those are not allowed as soon as we have default values for parameters or rest arguments. Change-Id: I7dec826c37e6045e4dd1f6b0adb90301efe33daf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4runtimecodegen.cpp')
-rw-r--r--src/qml/jsruntime/qv4runtimecodegen.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4runtimecodegen.cpp b/src/qml/jsruntime/qv4runtimecodegen.cpp
index fe18ddf9ed..8080ef7344 100644
--- a/src/qml/jsruntime/qv4runtimecodegen.cpp
+++ b/src/qml/jsruntime/qv4runtimecodegen.cpp
@@ -58,6 +58,9 @@ void RuntimeCodegen::generateFromFunctionExpression(const QString &fileName,
scan(ast);
scan.leaveEnvironment();
+ if (hasError)
+ return;
+
int index = defineFunction(ast->name.toString(), ast, ast->formals, ast->body ? ast->body->elements : nullptr);
_module->rootContext = _module->functions.at(index);
}