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()); |