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

Unified Diff: src/parsing/preparser.cc

Issue 2370713003: Preparse functions in the scope that was created when parsing of the function was started (Closed)
Patch Set: Addressed comments Created 4 years, 3 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 | « src/parsing/preparser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/preparser.cc
diff --git a/src/parsing/preparser.cc b/src/parsing/preparser.cc
index 0eea0e66181149e75cae1c52cb3622ef1326ea03..4fd1914bbfdbf7c90cc84773f4a11c938c181d64 100644
--- a/src/parsing/preparser.cc
+++ b/src/parsing/preparser.cc
@@ -84,9 +84,9 @@ PreParserIdentifier PreParser::GetSymbol() const {
}
PreParser::PreParseResult PreParser::PreParseLazyFunction(
- FunctionKind kind, DeclarationScope* function_scope, bool parsing_module,
- ParserRecorder* log, bool is_inner_function, bool may_abort,
- int* use_counts) {
+ DeclarationScope* function_scope, bool parsing_module, ParserRecorder* log,
+ bool is_inner_function, bool may_abort, int* use_counts) {
+ DCHECK_EQ(FUNCTION_SCOPE, function_scope->scope_type());
parsing_module_ = parsing_module;
log_ = log;
use_counts_ = use_counts;
@@ -98,7 +98,7 @@ PreParser::PreParseResult PreParser::PreParseLazyFunction(
// PreParser.
DCHECK_NULL(scope_state_);
FunctionState function_state(&function_state_, &scope_state_, function_scope,
- kind);
+ function_scope->function_kind());
DCHECK_EQ(Token::LBRACE, scanner()->current_token());
bool ok = true;
int start_position = peek_position();
@@ -113,7 +113,7 @@ PreParser::PreParseResult PreParser::PreParseLazyFunction(
ReportUnexpectedToken(scanner()->current_token());
} else {
DCHECK_EQ(Token::RBRACE, scanner()->peek());
- if (is_strict(scope()->language_mode())) {
+ if (is_strict(function_scope->language_mode())) {
int end_pos = scanner()->location().end_pos;
CheckStrictOctalLiteral(start_position, end_pos, &ok);
CheckDecimalLiteralWithLeadingZero(start_position, end_pos);
« no previous file with comments | « src/parsing/preparser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698