Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(888)

Unified Diff: src/parser.h

Issue 1234213004: [parser] use-strict directives in function body affect init block (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arrow-function failures Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698