Debian Codegraph @

js/src/tests/test262/language/statements/break/S12.8_A4_T2.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 When "break Identifier" is evaluated, (break, empty, Identifier) is
7 returned
8 es5id: 12.8_A4_T2
9 description: Using embedded and labeled loops, breaking to nested loop
10 ---*/
11
12 LABEL_OUT : var x=0, y=0, xx=0, yy=0;
13 (function(){
14 LABEL_DO_LOOP : do {
15 LABEL_IN : x++;
16 if(x===10)return;
17 LABEL_NESTED_LOOP : do {
18 LABEL_IN_NESTED : xx++;
19 if(xx===10)return;
20 break LABEL_NESTED_LOOP;
21 LABEL_IN_NESTED_2 : yy++;
22 } while (0);
23
24 LABEL_IN_2 : y++;
25
26 function IN_DO_FUNC(){}
27 } while(0);
28
29 LABEL_ANOTHER_LOOP : do {
30 ;
31 } while(0);
32
33 function OUT_FUNC(){}
34 })();
35 //////////////////////////////////////////////////////////////////////////////
36 //CHECK#1
37 if ((x!==1)&&(y!==1)&&(xx!==1)&(yy!==0)) {
38 throw new Test262Error('#1: x === 1 and y === 1 and xx === 1 and yy === 0. Actual: x==='+x+' and y==='+y+' and xx==='+xx+' and yy==='+yy );
39 }
40 //
41 //////////////////////////////////////////////////////////////////////////////
42
43 reportCompare(0, 0);