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

Unified Diff: src/ast/scopes.cc

Issue 2677653003: [ast] Minor cleanup in scopes.cc. (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/ast/scopes.cc
diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc
index ad5a8505d78696d6fa13837bfbf32679eb3fbfd6..bd91e16a5220cccfab9ccb59f7eee7464dedac52 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -994,9 +994,8 @@ Variable* Scope::DeclareVariable(
// with this new binding by doing the following:
// The proxy is bound to a lookup variable to force a dynamic declaration
// using the DeclareEvalVar or DeclareEvalFunction runtime functions.
- VariableKind kind = NORMAL_VARIABLE;
- // TODO(sigurds) figure out if kNotAssigned is OK here
- var = new (zone()) Variable(this, name, mode, kind, init, kNotAssigned);
+ var = new (zone())
+ Variable(this, name, mode, NORMAL_VARIABLE, init, kMaybeAssigned);
var->AllocateTo(VariableLocation::LOOKUP, -1);
} else {
// Declare the variable in the declaration scope.
@@ -1096,9 +1095,8 @@ Variable* Scope::DeclareVariableName(const AstRawString* name,
DCHECK_NE(var, kDummyPreParserVariable);
if (var == nullptr) {
var = DeclareLocal(name, mode);
- } else if (!IsLexicalVariableMode(var->mode()) &&
- !IsLexicalVariableMode(mode)) {
- DCHECK_EQ(mode, VAR);
+ } else if (mode == VAR) {
+ DCHECK_EQ(var->mode(), VAR);
var->set_maybe_assigned();
}
var->set_is_used();
« 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