blob: 17b465b70ef59e83f3a42cd0c51cd08e589dc19c [file] [log] [blame]
keith_miller@apple.combcc77f22016-07-15 06:03:25 +00001// Copyright (C) 2013 the V8 project authors. All rights reserved.
2// This code is governed by the BSD license found in the LICENSE file.
3/*---
4es6id: 13.6.4.13 S5.n
5description: >
6 Control flow during body evaluation should honor `continue` statements
7 within `try` blocks.
8features: [generators]
9---*/
10
11function* values() {
12 yield 1;
13 yield 1;
14}
15var iterator = values();
16var i = 0;
17
18for (var x of iterator) {
19 try {
20 i++;
21 continue;
22
23 $ERROR('This code is unreachable (following `continue` statement).');
24 } catch (err) {}
25
26 $ERROR('This code is unreachable (following `try` statement).');
27}
28
29assert.sameValue(i, 2);