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

Unified Diff: src/parsing/parser.cc

Issue 2680443002: [parsing] Make maybe-assigned more precise for sloppy block functions. (Closed)
Patch Set: Created 3 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index efb76fd5d8ac0eccf8b14e223ab4e3b0bae84ae1..750648a3d1444754a3b2761fd9e52aae28566060 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -1488,8 +1488,7 @@ Statement* Parser::DeclareFunction(const AstRawString* variable_name,
VariableProxy* proxy =
factory()->NewVariableProxy(variable_name, NORMAL_VARIABLE);
- DeclarationScope* target_scope = GetDeclarationScope();
- MarkTopLevelVariableAsAssigned(target_scope, proxy);
+ MarkTopLevelVariableAsAssigned(scope(), proxy);
Declaration* declaration =
factory()->NewFunctionDeclaration(proxy, function, scope(), pos);
@@ -1499,7 +1498,8 @@ Statement* Parser::DeclareFunction(const AstRawString* variable_name,
if (is_sloppy_block_function) {
SloppyBlockFunctionStatement* statement =
factory()->NewSloppyBlockFunctionStatement();
- target_scope->DeclareSloppyBlockFunction(variable_name, scope(), statement);
+ GetDeclarationScope()->DeclareSloppyBlockFunction(variable_name, scope(),
+ statement);
return statement;
}
return factory()->NewEmptyStatement(kNoSourcePosition);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698