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

Unified Diff: src/ast/ast.h

Issue 2301183003: Move sloppy block function hoisting logic from Parser to Scope. (Closed)
Patch Set: 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') | src/ast/scopes.cc » ('J')
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 f3e335bd571fd41763ff089a0cce9cbce8f757c4..a096b67f2f274108985c171bc194fe76768a528c 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; }
+ void set_from(VariableProxy* from) { from_ = from; }
+ VariableProxy* from() const { return from_; }
adamk 2016/09/02 18:16:27 Nit: swap order of these? (first getter, then sett
marja 2016/09/05 09:23:43 Done.
+ void set_to(VariableProxy* to) { to_ = to; }
+ VariableProxy* to() const { return 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_;
};
@@ -3124,9 +3132,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') | src/ast/scopes.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698