|
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 * Embedded "if/else" constructions are allowed |
|
6 * |
|
7 * @path ch12/12.5/S12.5_A12_T2.js |
|
8 * @description Using embedded "if" into "if/else" constructions |
|
9 */ |
|
10 |
|
11 //CHECK# 1 |
|
12 if(true){ |
|
13 if (false) |
|
14 $ERROR('#1.1: At embedded "if/else" constructions engine must select right branches'); |
|
15 } |
|
16 else{ |
|
17 if (true) |
|
18 $ERROR('#1.2: At embedded "if/else" constructions engine must select right branches'); |
|
19 } |
|
20 |
|
21 //CHECK# 2 |
|
22 if(true){ |
|
23 if (true) |
|
24 ; |
|
25 } |
|
26 else{ |
|
27 if (true) |
|
28 $ERROR('#2.2: At embedded "if/else" constructions engine must select right branches'); |
|
29 } |
|
30 |
|
31 //CHECK# 3 |
|
32 if(false){ |
|
33 if (true) |
|
34 $ERROR('#3.1: At embedded "if/else" constructions engine must select right branches'); |
|
35 } |
|
36 else{ |
|
37 if (true) |
|
38 ; |
|
39 } |
|
40 |
|
41 //CHECK# 4 |
|
42 if(false){ |
|
43 if (true) |
|
44 $ERROR('#4.1: At embedded "if/else" constructions engine must select right branches'); |
|
45 } |
|
46 else{ |
|
47 if (false) |
|
48 $ERROR('#4.3: At embedded "if/else" constructions engine must select right branches'); |
|
49 } |
|
50 |