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

Unified Diff: src/ast/scopes.cc

Issue 2232343002: [ast] Never declare non-lexical variables as kNeedsInitialization. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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/ast/variables.h » ('j') | 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 c6ec5640bc3aae6ab04cf47a43c1ef22bb5b8d3c..4d7ddd2ca8c10a03882cc84119ab01d51e37069e 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -1249,9 +1249,9 @@ Variable* Scope::NonLocal(const AstRawString* name, VariableMode mode) {
Variable* var = map->Lookup(name);
if (var == NULL) {
// Declare a new non-local.
- InitializationFlag init_flag = (mode == VAR)
- ? kCreatedInitialized : kNeedsInitialization;
- var = map->Declare(zone(), NULL, name, mode, Variable::NORMAL, init_flag);
+ DCHECK(!IsLexicalVariableMode(mode));
+ var = map->Declare(zone(), NULL, name, mode, Variable::NORMAL,
+ kCreatedInitialized);
// Allocate it by giving it a dynamic lookup.
var->AllocateTo(VariableLocation::LOOKUP, -1);
}
« no previous file with comments | « no previous file | src/ast/variables.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698