S12.11_A3_T4.js (611B)
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_T4 8 description: > 9 Using "case" that has no Expresson after it. "CaseClause: case 10 Expression : [StatementList]" 11 negative: 12 phase: parse 13 type: SyntaxError 14 ---*/ 15 16 $DONOTEVALUATE(); 17 18 function SwitchTest(value){ 19 var result = 0; 20 21 switch(value) { 22 case: 23 result += 2; 24 default: 25 result += 32; 26 break; 27 } 28 29 return result; 30 } 31 32 var x = SwitchTest(0);