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

Unified Diff: src/preparser.h

Issue 1423613002: Fix eval calls in initializers of arrow function parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add comment, rebase Created 5 years, 2 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/scopes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index 5c80b9d80a807eb3dbc636b2f15f9a618e61374d..8bbd9e688ccb6adcf2b8e80a890e17fb5c4e71e8 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -2942,6 +2942,10 @@ ParserBase<Traits>::ParseAssignmentExpression(bool accept_IN,
Scanner::Location loc(lhs_beg_pos, scanner()->location().end_pos);
Scope* scope =
this->NewScope(scope_, FUNCTION_SCOPE, FunctionKind::kArrowFunction);
+ // Because the arrow's parameters were parsed in the outer scope, any
+ // usage flags that might have been triggered there need to be copied
+ // to the arrow scope.
+ scope_->PropagateUsageFlagsToScope(scope);
FormalParametersT parameters(scope);
if (!arrow_formals_classifier.is_simple_parameter_list()) {
scope->SetHasNonSimpleParameters();
« no previous file with comments | « no previous file | src/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698