S12.14_A10_T1.js (556B)
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 "try" with "catch" or "finally" statement within/without a "while" 7 statement 8 es5id: 12.14_A10_T1 9 description: > 10 Throwing exception while executing iteration statement placed into 11 try Block 12 ---*/ 13 14 // CHECK#1 15 var i=0; 16 try{ 17 while(i<10){ 18 if(i===5) throw i; 19 i++; 20 } 21 } 22 catch(e){ 23 if(e!==5)throw new Test262Error('#1: Exception === 5. Actual: Exception ==='+ e ); 24 } 25 26 reportCompare(0, 0);