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

Unified Diff: src/parsing/preparser.h

Issue 1906793002: Synchronize scopes between parser/preparser (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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/parsing/preparser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/preparser.h
diff --git a/src/parsing/preparser.h b/src/parsing/preparser.h
index c803928fd8e30582acf74c3657e3f40f05660241..ecc63c740577789b54aa2465f96861584587e6bc 100644
--- a/src/parsing/preparser.h
+++ b/src/parsing/preparser.h
@@ -1149,8 +1149,14 @@ PreParserStatementList PreParser::ParseEagerFunctionBody(
FunctionLiteral::FunctionType function_type, bool* ok) {
ParsingModeScope parsing_mode(this, PARSE_EAGERLY);
- ParseStatementList(Token::RBRACE, ok);
- if (!*ok) return PreParserStatementList();
+ Scope* inner_scope = scope_;
+ if (!parameters.is_simple) inner_scope = NewScope(scope_, BLOCK_SCOPE);
+
+ {
+ BlockState block_state(&scope_, inner_scope);
+ ParseStatementList(Token::RBRACE, ok);
+ if (!*ok) return PreParserStatementList();
+ }
Expect(Token::RBRACE, ok);
return PreParserStatementList();
« no previous file with comments | « no previous file | src/parsing/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698