diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-04-12 09:18:04 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-04-25 17:50:33 +0000 |
commit | 9f731b6841bbc9b7425a95303369d05be895f949 (patch) | |
tree | b3a34152a06f5066d0b60b4d0e3f30333e6c2d0e /src/qml/compiler/qv4compilerscanfunctions_p.h | |
parent | e2ed846dd4710268a208962f3217b79994e8cb31 (diff) |
Fix crashes when parsing some invalid JS
function foo() { let x; function x() {} }
would crash. Throw an error instead now.
Change-Id: I5e5588deb21c1777be15a6656baefc422d59ff0c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compilerscanfunctions_p.h')
-rw-r--r-- | src/qml/compiler/qv4compilerscanfunctions_p.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4compilerscanfunctions_p.h b/src/qml/compiler/qv4compilerscanfunctions_p.h index 940bd9f73a..cf79da2203 100644 --- a/src/qml/compiler/qv4compilerscanfunctions_p.h +++ b/src/qml/compiler/qv4compilerscanfunctions_p.h @@ -111,7 +111,7 @@ protected: bool visit(AST::FunctionExpression *ast) override; bool visit(AST::TemplateLiteral *ast) override; - void enterFunction(AST::FunctionExpression *ast, bool enterName); + bool enterFunction(AST::FunctionExpression *ast, bool enterName); void endVisit(AST::FunctionExpression *) override; @@ -136,7 +136,7 @@ protected: bool visit(AST::Block *ast) override; protected: - void enterFunction(AST::Node *ast, const QString &name, AST::FormalParameterList *formals, AST::StatementList *body, AST::FunctionExpression *expr); + bool enterFunction(AST::Node *ast, const QString &name, AST::FormalParameterList *formals, AST::StatementList *body, AST::FunctionExpression *expr); void calcEscapingVariables(); // fields: |