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

Unified Diff: src/ast/ast.h

Issue 2226223002: [ast][parser] Remove redundant Declaration::mode_. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase 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/prettyprinter.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 cd6285700e0b05c2bd8bacc1f49dff19225b1308..d0af9ef1138172c4011163da493f0be58bc085f0 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -495,18 +495,13 @@ class DoExpression final : public Expression {
class Declaration : public AstNode {
public:
VariableProxy* proxy() const { return proxy_; }
- VariableMode mode() const { return mode_; }
Scope* scope() const { return scope_; }
protected:
- Declaration(VariableProxy* proxy, VariableMode mode, Scope* scope, int pos,
- NodeType type)
- : AstNode(pos, type), mode_(mode), proxy_(proxy), scope_(scope) {
- DCHECK(IsDeclaredVariableMode(mode));
- }
+ Declaration(VariableProxy* proxy, Scope* scope, int pos, NodeType type)
+ : AstNode(pos, type), proxy_(proxy), scope_(scope) {}
private:
- VariableMode mode_;
VariableProxy* proxy_;
// Nested scope from which the declaration originated.
@@ -518,9 +513,8 @@ class VariableDeclaration final : public Declaration {
private:
friend class AstNodeFactory;
- VariableDeclaration(VariableProxy* proxy, VariableMode mode, Scope* scope,
- int pos)
- : Declaration(proxy, mode, scope, pos, kVariableDeclaration) {}
+ VariableDeclaration(VariableProxy* proxy, Scope* scope, int pos)
+ : Declaration(proxy, scope, pos, kVariableDeclaration) {}
};
@@ -532,10 +526,9 @@ class FunctionDeclaration final : public Declaration {
private:
friend class AstNodeFactory;
- FunctionDeclaration(VariableProxy* proxy, VariableMode mode,
- FunctionLiteral* fun, Scope* scope, int pos)
- : Declaration(proxy, mode, scope, pos, kFunctionDeclaration), fun_(fun) {
- DCHECK(mode == VAR || mode == LET || mode == CONST);
+ FunctionDeclaration(VariableProxy* proxy, FunctionLiteral* fun, Scope* scope,
+ int pos)
+ : Declaration(proxy, scope, pos, kFunctionDeclaration), fun_(fun) {
DCHECK(fun != NULL);
}
@@ -3002,17 +2995,14 @@ class AstNodeFactory final BASE_EMBEDDED {
}
VariableDeclaration* NewVariableDeclaration(VariableProxy* proxy,
- VariableMode mode, Scope* scope,
- int pos) {
- return new (zone_) VariableDeclaration(proxy, mode, scope, pos);
+ Scope* scope, int pos) {
+ return new (zone_) VariableDeclaration(proxy, scope, pos);
}
FunctionDeclaration* NewFunctionDeclaration(VariableProxy* proxy,
- VariableMode mode,
FunctionLiteral* fun,
- Scope* scope,
- int pos) {
- return new (zone_) FunctionDeclaration(proxy, mode, fun, scope, pos);
+ Scope* scope, int pos) {
+ return new (zone_) FunctionDeclaration(proxy, fun, scope, pos);
}
Block* NewBlock(ZoneList<const AstRawString*>* labels, int capacity,
« no previous file with comments | « no previous file | src/ast/prettyprinter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698