Chromium Code Reviews| Index: src/parsing/parser.cc |
| diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc |
| index d2f9c74e58b3246e2228d17b1c6c4ee47a59541f..ff409bd8e14aac8d649e19fb20a665d719eec95e 100644 |
| --- a/src/parsing/parser.cc |
| +++ b/src/parsing/parser.cc |
| @@ -706,6 +706,7 @@ FunctionLiteral* Parser::DoParseProgram(ParseInfo* info) { |
| var->AllocateTo(VariableLocation::PARAMETER, 0); |
| PrepareGeneratorVariables(); |
| + scope->ForceContextAllocation(); |
| Expression* initial_yield = |
| BuildInitialYield(kNoSourcePosition, kGeneratorFunction); |
| body->Add( |
| @@ -2536,7 +2537,7 @@ void Parser::PrepareGeneratorVariables() { |
| // it minimizes the work needed to suspend and resume an activation. The |
|
adamk
2017/05/23 20:20:38
This first sentence is now obsolete, and should be
Jarin
2017/05/24 05:03:27
Done.
|
| // code produced for generators relies on this forced context allocation (it |
| // does not restore the frame's parameters upon resume). |
| - function_state_->scope()->ForceContextAllocation(); |
| + function_state_->scope()->ForceContextAllocationForParameters(); |
| // Calling a generator returns a generator object. That object is stored |
| // in a temporary variable, a definition that is used by "yield" |