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

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: All ports done 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') | src/preparser.h » ('J')
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 26771e4e347830c81c13377cbd24c7d1d5897213..403b6dc4a3525291a24ebcca1b2e9a92a2fdaec0 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -748,8 +748,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);
}
@@ -1136,7 +1141,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());
FormalParameterErrorLocations error_locs;
bool has_rest = false;
« no previous file with comments | « src/parser.h ('k') | src/preparser.h » ('j') | src/preparser.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698