S12.11_A4_T1.js (790B)
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 syntax constructions of switch statement 6 es5id: 12.11_A4_T1 7 description: Nesting one "switch" statement into StatementList of the other's 8 ---*/ 9 10 function SwitchTest(value){ 11 var result = 0; 12 13 switch(value) { 14 case 0: 15 switch(value) { 16 case 0: 17 result += 3; 18 break; 19 default: 20 result += 32; 21 break; 22 } 23 result *= 2; 24 break; 25 result=3; 26 default: 27 result += 32; 28 break; 29 } 30 return result; 31 } 32 33 var x = SwitchTest(0); 34 if(x!==6) throw new Test262Error("#1: SwitchTest(0) === 6. Actual: SwitchTest(0) ==="+ SwitchTest(0) ); 35 36 reportCompare(0, 0);