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

Unified Diff: src/ast/ast.h

Issue 2223843002: [ast][parsing] Variable declaration cleanups. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase and make DefaultInitializationFlag static. 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/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast.h
diff --git a/src/ast/ast.h b/src/ast/ast.h
index 8172cf888658b71c10dbd9dc7fbe4867f1653c37..cd6285700e0b05c2bd8bacc1f49dff19225b1308 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -497,7 +497,6 @@ class Declaration : public AstNode {
VariableProxy* proxy() const { return proxy_; }
VariableMode mode() const { return mode_; }
Scope* scope() const { return scope_; }
- InitializationFlag initialization() const;
protected:
Declaration(VariableProxy* proxy, VariableMode mode, Scope* scope, int pos,
@@ -516,18 +515,12 @@ class Declaration : public AstNode {
class VariableDeclaration final : public Declaration {
- public:
- InitializationFlag initialization() const { return initialization_; }
-
private:
friend class AstNodeFactory;
VariableDeclaration(VariableProxy* proxy, VariableMode mode, Scope* scope,
- InitializationFlag initialization, int pos)
- : Declaration(proxy, mode, scope, pos, kVariableDeclaration),
- initialization_(initialization) {}
-
- InitializationFlag initialization_;
+ int pos)
+ : Declaration(proxy, mode, scope, pos, kVariableDeclaration) {}
};
@@ -535,7 +528,6 @@ class FunctionDeclaration final : public Declaration {
public:
FunctionLiteral* fun() const { return fun_; }
void set_fun(FunctionLiteral* f) { fun_ = f; }
- InitializationFlag initialization() const { return kCreatedInitialized; }
private:
friend class AstNodeFactory;
@@ -3012,16 +3004,7 @@ class AstNodeFactory final BASE_EMBEDDED {
VariableDeclaration* NewVariableDeclaration(VariableProxy* proxy,
VariableMode mode, Scope* scope,
int pos) {
- return NewVariableDeclaration(
- proxy, mode, scope,
- mode == VAR ? kCreatedInitialized : kNeedsInitialization, pos);
- }
-
- VariableDeclaration* NewVariableDeclaration(VariableProxy* proxy,
- VariableMode mode, Scope* scope,
- InitializationFlag init,
- int pos) {
- return new (zone_) VariableDeclaration(proxy, mode, scope, init, pos);
+ return new (zone_) VariableDeclaration(proxy, mode, scope, pos);
}
FunctionDeclaration* NewFunctionDeclaration(VariableProxy* proxy,
« no previous file with comments | « no previous file | src/ast/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698