S12.5_A12_T1.js (1876B)
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_T1 7 description: Using embedded "if/else" 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 else 15 ; 16 else 17 if (true) 18 throw new Test262Error('#1.2: At embedded "if/else" constructions engine must select right branches'); 19 else 20 throw new Test262Error('#1.3: At embedded "if/else" constructions engine must select right branches'); 21 22 //CHECK# 2 23 if(true) 24 if (true) 25 ; 26 else 27 throw new Test262Error('#2.1: At embedded "if/else" constructions engine must select right branches'); 28 else 29 if (true) 30 throw new Test262Error('#2.2: At embedded "if/else" constructions engine must select right branches'); 31 else 32 throw new Test262Error('#2.3: At embedded "if/else" constructions engine must select right branches'); 33 34 //CHECK# 3 35 if(false) 36 if (true) 37 throw new Test262Error('#3.1: At embedded "if/else" constructions engine must select right branches'); 38 else 39 throw new Test262Error('#3.2: At embedded "if/else" constructions engine must select right branches'); 40 else 41 if (true) 42 ; 43 else 44 throw new Test262Error('#3.3: At embedded "if/else" constructions engine must select right branches'); 45 46 //CHECK# 4 47 if(false) 48 if (true) 49 throw new Test262Error('#4.1: At embedded "if/else" constructions engine must select right branches'); 50 else 51 throw new Test262Error('#4.2: At embedded "if/else" constructions engine must select right branches'); 52 else 53 if (false) 54 throw new Test262Error('#4.3: At embedded "if/else" constructions engine must select right branches'); 55 else 56 ; 57 58 reportCompare(0, 0);