continue.js (519B)
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 `continue` statements. 7 features: [generators] 8 ---*/ 9 10 function* values() { 11 yield 1; 12 yield 1; 13 } 14 var iterator = values(); 15 var i = 0; 16 17 for (var x of iterator) { 18 i++; 19 continue; 20 21 throw new Test262Error('This code is unreachable.'); 22 } 23 24 assert.sameValue(i, 2); 25 26 reportCompare(0, 0);