Debian Codegraph @

js/src/tests/test262/language/statements/do-while/S12.6.1_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 "do-while" Statement is allowed and performed as
7 described in 12.8
8 es5id: 12.6.1_A4_T5
9 description: Using labeled "break" in order to continue a loop
10 ---*/
11
12 var i = 0;
13 woohoo:{
14 do {
15 i++;
16 if ( i == 10 ) {
17 break woohoo;
18 throw new Test262Error('#1.1: "break woohoo" must break loop');
19 }
20 } while ( true );
21 throw new Test262Error('This code should be unreacheable');
22 }
23 assert.sameValue(i, 10);
24
25 reportCompare(0, 0);