S12.11_A3_T1.js (550B)
1 // |reftest| error:SyntaxError 2 // Copyright 2009 the Sputnik authors. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 5 /*--- 6 info: Syntax constructions of switch statement 7 es5id: 12.11_A3_T1 8 description: Checking if execution of "switch() {}" fails 9 negative: 10 phase: parse 11 type: SyntaxError 12 ---*/ 13 14 $DONOTEVALUATE(); 15 16 function SwitchTest(value){ 17 var result = 0; 18 19 switch() { 20 case 0: 21 result += 2; 22 default: 23 result += 32; 24 break; 25 } 26 27 return result; 28 } 29 30 var x = SwitchTest(0);