aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/parser/qqmljsast_p.h
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/parser/qqmljsast_p.h
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/parser/qqmljsast_p.h')
-rw-r--r--src/qml/parser/qqmljsast_p.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/qml/parser/qqmljsast_p.h b/src/qml/parser/qqmljsast_p.h
index 61ee89ad2f..51f3d78588 100644
--- a/src/qml/parser/qqmljsast_p.h
+++ b/src/qml/parser/qqmljsast_p.h
@@ -2099,6 +2099,18 @@ public:
return n;
}
+ bool isSimpleParameterList()
+ {
+ AST::FormalParameterList *formals = this;
+ while (formals) {
+ if (formals->isRest || formals->defaultExpression)
+ return false;
+ formals = formals->next;
+ }
+ return true;
+ }
+
+
void accept0(Visitor *visitor) override;
SourceLocation firstSourceLocation() const override