S12.8_A9_T1.js (742B)
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 Using "break" within "try/catch" statement that is nested in a loop is 7 allowed 8 es5id: 12.8_A9_T1 9 description: Using "continue Identifier" within "catch" statement 10 ---*/ 11 12 var x=0,y=0; 13 14 (function(){ 15 FOR : for(;;){ 16 try{ 17 x++; 18 if(x===10)return; 19 throw 1; 20 } catch(e){ 21 break FOR; 22 } 23 } 24 })(); 25 26 ////////////////////////////////////////////////////////////////////////////// 27 //CHECK#1 28 if (x!==1) { 29 throw new Test262Error('#1: break inside of try-catch nested in loop is allowed'); 30 } 31 // 32 ////////////////////////////////////////////////////////////////////////////// 33 34 reportCompare(0, 0);