Chromium Code Reviews| Index: src/parser.cc |
| diff --git a/src/parser.cc b/src/parser.cc |
| index abd06591c4057e6c91e130ccee7f7d43821544da..4371093e8669768686fd80418b886b35f6fa4494 100644 |
| --- a/src/parser.cc |
| +++ b/src/parser.cc |
| @@ -1587,19 +1587,11 @@ Block* Parser::ParseScopedBlock(ZoneStringList* labels, bool* ok) { |
| body->set_block_scope(block_scope); |
| if (block_scope != NULL) { |
| - // Create exit block. |
| - Block* exit = new(zone()) Block(isolate(), NULL, 1, false); |
| + // Rewrite the block { B } to a block: { { B } ExitContext; } |
| + Block* exit = new(zone()) Block(isolate(), NULL, 2, false); |
| + exit->AddStatement(body); |
| exit->AddStatement(new(zone()) ExitContextStatement()); |
|
Kevin Millikin (Chromium)
2011/09/02 15:17:44
Now we're no longer making essential use of ExitCo
Steven
2011/09/05 08:54:50
Will do it.
On 2011/09/02 15:17:44, Kevin Millikin
|
| - |
| - // Create a try-finally statement. |
| - TryFinallyStatement* try_finally = |
| - new(zone()) TryFinallyStatement(body, exit); |
| - try_finally->set_escaping_targets(collector.targets()); |
| - |
| - // Create a result block. |
| - Block* result = new(zone()) Block(isolate(), NULL, 1, false); |
| - result->AddStatement(try_finally); |
| - return result; |
| + return exit; |
| } else { |
| return body; |
| } |