From 9f731b6841bbc9b7425a95303369d05be895f949 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 12 Apr 2018 09:18:04 +0200 Subject: 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 --- src/qml/compiler/qv4compilerscanfunctions_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/qml/compiler/qv4compilerscanfunctions_p.h') 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: -- cgit v1.2.3