Chromium Code Reviews

Unified Diff: src/preparser.cc

Issue 160073006: Implement handling of arrow functions in the parser (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed ParamListFinder Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: src/preparser.cc
diff --git a/src/preparser.cc b/src/preparser.cc
index 688962d1d4855b4575b04bfa9ebbeb27ed875ca9..310d66c327a2ae5473325dc88c4408e1f2ed04ad 100644
--- a/src/preparser.cc
+++ b/src/preparser.cc
@@ -108,10 +108,12 @@ PreParser::PreParseResult PreParser::PreParseLazyFunction(
log_ = log;
// Lazy functions always have trivial outer scopes (no with/catch scopes).
PreParserScope top_scope(scope_, GLOBAL_SCOPE);
- FunctionState top_state(&function_state_, &scope_, &top_scope);
+ FunctionState top_state(&function_state_, &scope_, &top_scope,
+ NULL, this->ast_value_factory());
marja 2014/06/26 14:38:13 this->ast_value_factory is always NULL, right? So
scope_->SetStrictMode(strict_mode);
PreParserScope function_scope(scope_, FUNCTION_SCOPE);
- FunctionState function_state(&function_state_, &scope_, &function_scope);
+ FunctionState function_state(&function_state_, &scope_, &function_scope,
+ NULL, this->ast_value_factory());
function_state.set_is_generator(is_generator);
ASSERT_EQ(Token::LBRACE, scanner()->current_token());
bool ok = true;
@@ -809,7 +811,8 @@ PreParser::Expression PreParser::ParseFunctionLiteral(
// Parse function body.
ScopeType outer_scope_type = scope_->type();
PreParserScope function_scope(scope_, FUNCTION_SCOPE);
- FunctionState function_state(&function_state_, &scope_, &function_scope);
+ FunctionState function_state(&function_state_, &scope_, &function_scope,
+ NULL, this->ast_value_factory());
function_state.set_is_generator(is_generator);
// FormalParameterList ::
// '(' (Identifier)*[','] ')'

Powered by Google App Engine