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

Unified Diff: src/parser.cc

Issue 1135243004: [es6] Support super.property in eval and arrow functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Code review cleanup Created 5 years, 7 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 | « src/parser.h ('k') | src/preparser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index ee0f7dc6804848109197ed9878835d791e3d77f4..196853c0236e3b8fca9d2dca5f67481138d9fa17 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -749,8 +749,13 @@ Expression* ParserTraits::ThisExpression(Scope* scope, AstNodeFactory* factory,
Expression* ParserTraits::SuperReference(Scope* scope, AstNodeFactory* factory,
int pos) {
+ // TODO(arv): Split into SuperProperty and SuperCall?
+ VariableProxy* home_object_proxy = scope->NewUnresolved(
+ factory, parser_->ast_value_factory()->home_object_string(),
+ Variable::NORMAL, pos);
+
return factory->NewSuperReference(
- ThisExpression(scope, factory, pos)->AsVariableProxy(),
+ ThisExpression(scope, factory, pos)->AsVariableProxy(), home_object_proxy,
pos);
}
@@ -1138,7 +1143,8 @@ FunctionLiteral* Parser::ParseLazy(Isolate* isolate, ParseInfo* info,
bool ok = true;
if (shared_info->is_arrow()) {
- Scope* scope = NewScope(scope_, ARROW_SCOPE);
+ Scope* scope =
+ NewScope(scope_, ARROW_SCOPE, FunctionKind::kArrowFunction);
scope->set_start_position(shared_info->start_position());
ExpressionClassifier formals_classifier;
bool has_rest = false;
« no previous file with comments | « src/parser.h ('k') | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698