OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Flags: --harmony-do-expressions |
| 6 |
| 7 (function testCatchScopeInDoExpression() { |
| 8 var f = (s = 17, y = do { try { throw 25; } catch(e) { s += e; }; }) => s; |
| 9 var result = f(); |
| 10 assertEquals(result, 42); |
| 11 })(); |
| 12 |
| 13 (function testCatchScopeInDoExpression() { |
| 14 var f = (s = 17, y = do { let t; try { throw 25; } catch(e) { s += e; }; }) =>
s; |
| 15 var result = f(); |
| 16 assertEquals(result, 42); |
| 17 })(); |
| 18 |
| 19 (function testCatchScopeInDoExpression() { |
| 20 let t1; |
| 21 var f = (s = 17, y = do { let t2; try { throw 25; } catch(e) { s += e; }; }) =
> s; |
| 22 var result = f(); |
| 23 assertEquals(result, 42); |
| 24 })(); |
OLD | NEW |