Debian Codegraph @

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