|
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 * When "break Identifier" is evaluated, (break, empty, Identifier) is returned |
|
6 * |
|
7 * @path ch12/12.8/S12.8_A4_T1.js |
|
8 * @description Using "break Identifier" within labaeled loop |
|
9 */ |
|
10 |
|
11 LABEL_OUT : var x=0, y=0; |
|
12 (function(){ |
|
13 LABEL_DO_LOOP : do { |
|
14 LABEL_IN : x++; |
|
15 if(x===10)return; |
|
16 break LABEL_DO_LOOP; |
|
17 LABEL_IN_2 : y++; |
|
18 |
|
19 function IN_DO_FUNC(){} |
|
20 } while(0); |
|
21 |
|
22 LABEL_ANOTHER_LOOP : do { |
|
23 ; |
|
24 } while(0); |
|
25 |
|
26 function OUT_FUNC(){} |
|
27 })(); |
|
28 ////////////////////////////////////////////////////////////////////////////// |
|
29 //CHECK#1 |
|
30 if ((x!==1)&&(y!==0)) { |
|
31 $ERROR('#1: x === 1 and y === 0. Actual: x === '+x+' and y ==='+ y ); |
|
32 } |
|
33 // |
|
34 ////////////////////////////////////////////////////////////////////////////// |
|
35 |