parse-failure-3.js (1014B)
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: | 6 If Result(3).type is not normal, then Result(3).type must be throw. 7 Throw Result(3).value as an exception 8 es5id: 15.1.2.1_A3.3_T1 9 description: Continue statement 10 ---*/ 11 12 //CHECK#1 13 try { 14 eval("continue;"); 15 throw new Test262Error('#1.1: continue must throw SyntaxError. Actual: ' + (eval("continue;"))); 16 } catch(e) { 17 if ((e instanceof SyntaxError) !== true) { 18 throw new Test262Error('#1.2: continue must throw SyntaxError. Actual ' + (e)); 19 } 20 } 21 22 //CHECK#2 23 try { 24 for (var i = 0; i <= 1; i++) { 25 for (var j = 0; j <= 1; j++) { 26 eval("continue;"); 27 } 28 } 29 throw new Test262Error('#2.1: continue must throw SyntaxError. Actual: ' + (eval("continue;"))); 30 } catch(e) { 31 if ((e instanceof SyntaxError) !== true) { 32 throw new Test262Error('#2.2: continue must throw SyntaxError. Actual: ' + (e)); 33 } 34 } 35 36 reportCompare(0, 0);