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

Unified Diff: src/ast/variables.h

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 | « 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/ast/variables.h
diff --git a/src/ast/variables.h b/src/ast/variables.h
index 950db3c0021263f93209609d24cfd61de8a2d58f..9dae9e634abdf59d2123893b52d20919aa96e91f 100644
--- a/src/ast/variables.h
+++ b/src/ast/variables.h
@@ -73,6 +73,8 @@ class Variable: public ZoneObject {
bool is_dynamic() const { return IsDynamicVariableMode(mode_); }
bool is_const_mode() const { return IsImmutableVariableMode(mode_); }
bool binding_needs_init() const {
+ DCHECK(initialization_flag_ != kNeedsInitialization ||
+ IsLexicalVariableMode(mode_));
return initialization_flag_ == kNeedsInitialization;
}
« 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