Index: src/parser.h |
diff --git a/src/parser.h b/src/parser.h |
index 6caa91159070382aed76b5c8f4db9f9ba3dd5a7f..1b138112f39542f4f38b62aadd608a586b40e143 100644 |
--- a/src/parser.h |
+++ b/src/parser.h |
@@ -1155,6 +1155,8 @@ class Parser : public ParserBase<ParserTraits> { |
PreParser::PreParseResult ParseLazyFunctionBodyWithPreParser( |
SingletonLogger* logger, Scanner::BookmarkScope* bookmark = nullptr); |
+ bool IsSimpleParameterList( |
+ const ParserFormalParameterParsingState& formal_parameters); |
Block* BuildParameterInitializationBlock( |
const ParserFormalParameterParsingState& formal_parameters, bool* ok); |
@@ -1338,6 +1340,7 @@ void ParserTraits::DeclareFormalParameter( |
void ParserTraits::AddParameterInitializationBlock( |
const ParserFormalParameterParsingState& formal_parameters, |
ZoneList<v8::internal::Statement*>* body, bool* ok) { |
+ if (parser_->IsSimpleParameterList(formal_parameters)) return; |
auto* init_block = |
parser_->BuildParameterInitializationBlock(formal_parameters, ok); |
if (!*ok) return; |