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

Unified Diff: src/ast/ast.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 | « no previous file | src/ast/scopes.h » ('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 4885379c9a60f3f0bbdb04fee9dddde2f455a1ed..a274c10dbc0292dfe50d8be1d48df95e1e9edb8a 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -1176,6 +1176,10 @@ class SloppyBlockFunctionStatement final : public Statement {
public:
Statement* statement() const { return statement_; }
void set_statement(Statement* statement) { statement_ = statement; }
+ VariableProxy* from() const { return from_; }
+ void set_from(VariableProxy* from) { from_ = from; }
+ VariableProxy* to() const { return to_; }
+ void set_to(VariableProxy* to) { to_ = to; }
Scope* scope() const { return scope_; }
SloppyBlockFunctionStatement* next() { return next_; }
void set_next(SloppyBlockFunctionStatement* next) { next_ = next; }
@@ -1186,10 +1190,14 @@ class SloppyBlockFunctionStatement final : public Statement {
SloppyBlockFunctionStatement(Statement* statement, Scope* scope)
: Statement(kNoSourcePosition, kSloppyBlockFunctionStatement),
statement_(statement),
+ from_(nullptr),
+ to_(nullptr),
scope_(scope),
next_(nullptr) {}
Statement* statement_;
+ VariableProxy* from_;
+ VariableProxy* to_;
Scope* const scope_;
SloppyBlockFunctionStatement* next_;
};
@@ -3149,9 +3157,9 @@ class AstNodeFactory final BASE_EMBEDDED {
return new (zone_) EmptyStatement(pos);
}
- SloppyBlockFunctionStatement* NewSloppyBlockFunctionStatement(
- Statement* statement, Scope* scope) {
- return new (zone_) SloppyBlockFunctionStatement(statement, scope);
+ SloppyBlockFunctionStatement* NewSloppyBlockFunctionStatement(Scope* scope) {
+ return new (zone_) SloppyBlockFunctionStatement(
+ NewEmptyStatement(kNoSourcePosition), scope);
}
CaseClause* NewCaseClause(
« no previous file with comments | « no previous file | src/ast/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698