Debian Codegraph @

js/src/tests/test262/language/statements/for-of/continue-label.js

raw
1 // 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 /*---
4 es6id: 13.6.4.13 S5.n
5 description: >
6 Control flow during body evaluation should honor labeled `continue`
7 statements.
8 features: [generators]
9 ---*/
10
11 function* values() {
12 yield 1;
13 }
14 var iterator = values();
15 var i = 0;
16 var loop = true;
17
18 outer:
19 while (loop) {
20 loop = false;
21
22 for (var x of iterator) {
23 i++;
24 continue outer;
25
26 throw new Test262Error('This code is unreachable (inside for-of).');
27 }
28 throw new Test262Error('This code is unreachable (inside while).');
29 }
30
31 assert.sameValue(i, 1);
32
33 reportCompare(0, 0);