Chromium Code Reviews| Index: src/parser.cc |
| diff --git a/src/parser.cc b/src/parser.cc |
| index 2b3f482a265c17e99d4202fa2bb798cc4972a0bd..d9b058f5c20adf1b596440fe07c4b2c69a7000d4 100644 |
| --- a/src/parser.cc |
| +++ b/src/parser.cc |
| @@ -5931,16 +5931,16 @@ Expression* Parser::SpreadCall(Expression* function, |
| int pos) { |
| if (function->IsSuperCallReference()) { |
| // Super calls |
| - // %_CallSuperWithSpread(%ReflectConstruct(<super>, args, new.target)) |
| - args->InsertAt(0, function, zone()); |
| + // %ReflectConstruct(%GetPrototype(<this-function>), args, new.target)) |
| + ZoneList<Expression*>* tmp = new (zone()) ZoneList<Expression*>(1, zone()); |
| + tmp->Add(function->AsSuperCallReference()->this_function_var(), zone()); |
| + Expression* get_prototype = factory()->NewCallRuntime( |
| + ast_value_factory()->empty_string(), |
| + Runtime::FunctionForId(Runtime::kGetPrototype), tmp, pos); |
| + args->InsertAt(0, get_prototype, zone()); |
|
caitp (gmail)
2015/07/16 11:47:19
Don't you need to also initialize `this` after the
rossberg
2015/07/16 11:59:34
Indeed, it seems like we have zero test coverage f
caitp (gmail)
2015/07/16 12:08:14
Looks like https://crrev.com/1226123010 handles th
rossberg
2015/07/16 12:11:23
I was looking at the generic super.js test, which
Michael Starzinger
2015/07/16 12:11:48
This is done by the CL that is based on. Sorry, I
Michael Starzinger
2015/07/16 14:58:43
Done. I added test coverage in another CL already.
|
| args->Add(function->AsSuperCallReference()->new_target_var(), zone()); |
| - Expression* result = factory()->NewCallRuntime( |
| - ast_value_factory()->reflect_construct_string(), NULL, args, pos); |
| - args = new (zone()) ZoneList<Expression*>(1, zone()); |
| - args->Add(result, zone()); |
| return factory()->NewCallRuntime( |
| - ast_value_factory()->empty_string(), |
| - Runtime::FunctionForId(Runtime::kInlineCallSuperWithSpread), args, pos); |
| + ast_value_factory()->reflect_construct_string(), NULL, args, pos); |
| } else { |
| if (function->IsProperty()) { |
| // Method calls |