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

Unified Diff: src/parsing/preparser.cc

Issue 2662183002: [parser] Remove hoist_scope from DeclarationDescriptor (Closed)
Patch Set: Factored out helper function Created 3 years, 11 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
« src/parsing/pattern-rewriter.cc ('K') | « src/parsing/pattern-rewriter.cc ('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 95c12c698545c70e7a763d42c16a238f3d33106c..170feb570f486c684793ca7add05f34459cfcf5f 100644
--- a/src/parsing/preparser.cc
+++ b/src/parsing/preparser.cc
@@ -307,14 +307,10 @@ void PreParser::DeclareAndInitializeVariables(
ZoneList<const AstRawString*>* names, bool* ok) {
if (declaration->pattern.variables_ != nullptr) {
DCHECK(FLAG_lazy_inner_functions);
- Scope* scope = declaration_descriptor->hoist_scope;
- if (scope == nullptr) {
- scope = this->scope();
- }
for (auto variable : *(declaration->pattern.variables_)) {
declaration_descriptor->scope->RemoveUnresolved(variable);
- scope->DeclareVariableName(variable->raw_name(),
- declaration_descriptor->mode);
+ scope()->DeclareVariableName(variable->raw_name(),
+ declaration_descriptor->mode);
}
}
}
« src/parsing/pattern-rewriter.cc ('K') | « src/parsing/pattern-rewriter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698