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

Unified Diff: src/ast/variables.h

Issue 2301183003: Move sloppy block function hoisting logic from Parser to Scope. (Closed)
Patch Set: code review (nikolaos@) Created 4 years, 3 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') | src/parsing/parser.h » ('j') | 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 b56fb5b3483bb94bf758a41360ee148788e38ec0..460bb3801253e59f364102337cf283755fbb2d22 100644
--- a/src/ast/variables.h
+++ b/src/ast/variables.h
@@ -121,6 +121,11 @@ class Variable final : public ZoneObject {
index_ = index;
}
+ static InitializationFlag DefaultInitializationFlag(VariableMode mode) {
+ DCHECK(IsDeclaredVariableMode(mode));
+ return mode == VAR ? kCreatedInitialized : kNeedsInitialization;
+ }
+
private:
Scope* scope_;
const AstRawString* name_;
« no previous file with comments | « src/ast/scopes.cc ('k') | src/parsing/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698