|
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 * "break" within a "do-while" Statement is allowed and performed as described in 12.8 |
|
6 * |
|
7 * @path ch12/12.6/12.6.1/S12.6.1_A4_T1.js |
|
8 * @description Using "break" within a "do-while" loop |
|
9 */ |
|
10 |
|
11 do { |
|
12 __in__do__before__break="reached"; |
|
13 break; |
|
14 __in__do__after__break="where am i"; |
|
15 } while(2===1); |
|
16 |
|
17 ////////////////////////////////////////////////////////////////////////////// |
|
18 //CHECK#1 |
|
19 if (__in__do__before__break !== "reached") { |
|
20 $ERROR('#1: __in__do__before__break === "reached". Actual: __in__do__before__break ==='+ __in__do__before__break ); |
|
21 } |
|
22 // |
|
23 ////////////////////////////////////////////////////////////////////////////// |
|
24 |
|
25 ////////////////////////////////////////////////////////////////////////////// |
|
26 //CHECK#2 |
|
27 if (typeof __in__do__after__break !== "undefined") { |
|
28 $ERROR('#2: typeof __in__do__after__break === "undefined". Actual: typeof __in__do__after__break ==='+ typeof __in__do__after__break ); |
|
29 } |
|
30 // |
|
31 ////////////////////////////////////////////////////////////////////////////// |
|
32 |