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

Unified Diff: src/parsing/preparser.cc

Issue 2521513004: Preparse inner functions: fix maybe_assigned (Closed)
Patch Set: even better Created 4 years, 1 month 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/ast/scopes.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 7f95164412209f2e6c20cda76c9528457dcf91ee..c7b2e1b5d25d6e9537e62989e4a610d6ee47ee68 100644
--- a/src/parsing/preparser.cc
+++ b/src/parsing/preparser.cc
@@ -266,8 +266,11 @@ PreParserExpression PreParser::ExpressionFromIdentifier(
// AstValueFactory doesn't know about it.
factory.set_zone(zone());
DCHECK_NOT_NULL(name.string_);
- scope()->NewUnresolved(&factory, name.string_, start_position,
- NORMAL_VARIABLE);
+ VariableProxy* proxy = scope()->NewUnresolved(
+ &factory, name.string_, start_position, NORMAL_VARIABLE);
+ // We don't know whether the preparsed function assigns or not, so we set
+ // is_assigned pessimistically.
+ proxy->set_is_assigned();
}
return PreParserExpression::FromIdentifier(name, zone());
}
« no previous file with comments | « src/ast/scopes.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698