Debian Codegraph @

js/src/tests/test262/language/statements/while/S12.6.2_A4_T5.js

raw
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 info: |
6 "break" within a "while" Statement is allowed and performed as described
7 in 12.8
8 es5id: 12.6.2_A4_T5
9 description: Using labeled "break" in order to continue a "while" loop
10 ---*/
11
12 //CHECK#1
13 var i = 0;
14 woohoo:{
15 while(true){
16 i++;
17 if ( i == 10 ) {
18 break woohoo;
19 throw new Test262Error('#1.1: "break woohoo" must break loop');
20 }
21 }
22 throw new Test262Error('This code should be unreacheable');
23 }
24 assert.sameValue(i, 10);
25
26 reportCompare(0, 0);