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

Unified Diff: src/parser.cc

Issue 1132933003: [es6] support spread-calling Super-accessing properties (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « no previous file | test/mjsunit/harmony/spread-call-super-property.js » ('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 87a74a4c7bba3c56ae7da85c8d565dd1292c5bbf..ceeab6cfb175d474254380db190168bea7333b38 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -5708,17 +5708,25 @@ Expression* Parser::SpreadCall(Expression* function,
} else {
if (function->IsProperty()) {
// Method calls
- Variable* temp =
- scope_->NewTemporary(ast_value_factory()->empty_string());
- VariableProxy* obj = factory()->NewVariableProxy(temp);
- Assignment* assign_obj = factory()->NewAssignment(
- Token::ASSIGN, obj, function->AsProperty()->obj(),
- RelocInfo::kNoPosition);
- function = factory()->NewProperty(
- assign_obj, function->AsProperty()->key(), RelocInfo::kNoPosition);
- args->InsertAt(0, function, zone());
- obj = factory()->NewVariableProxy(temp);
- args->InsertAt(1, obj, zone());
+ if (function->AsProperty()->IsSuperAccess()) {
+ VariableProxy* original_home =
+ function->AsProperty()->obj()->AsSuperReference()->this_var();
+ VariableProxy* home = factory()->NewVariableProxy(original_home->var());
arv (Not doing code reviews) 2015/05/14 21:54:56 It is not clear why you need a new VariableProxy h
+ args->InsertAt(0, function, zone());
+ args->InsertAt(1, home, zone());
+ } else {
+ Variable* temp =
+ scope_->NewTemporary(ast_value_factory()->empty_string());
+ VariableProxy* obj = factory()->NewVariableProxy(temp);
+ Assignment* assign_obj = factory()->NewAssignment(
+ Token::ASSIGN, obj, function->AsProperty()->obj(),
+ RelocInfo::kNoPosition);
+ function = factory()->NewProperty(
+ assign_obj, function->AsProperty()->key(), RelocInfo::kNoPosition);
+ args->InsertAt(0, function, zone());
+ obj = factory()->NewVariableProxy(temp);
+ args->InsertAt(1, obj, zone());
+ }
} else {
// Non-method calls
args->InsertAt(0, function, zone());
« no previous file with comments | « no previous file | test/mjsunit/harmony/spread-call-super-property.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698