michael@0: // Copyright 2009 the Sputnik authors. All rights reserved. michael@0: // This code is governed by the BSD license found in the LICENSE file. michael@0: michael@0: /** michael@0: * Using "try" with "catch" or "finally" statement within/without a "for-in" statement michael@0: * michael@0: * @path ch12/12.14/S12.14_A12_T1.js michael@0: * @description Loop inside try Block, where throw exception michael@0: */ michael@0: michael@0: var x; michael@0: var mycars = new Array(); michael@0: mycars[0] = "Saab"; michael@0: mycars[1] = "Volvo"; michael@0: mycars[2] = "BMW"; michael@0: michael@0: // CHECK#1 michael@0: try{ michael@0: for (x in mycars){ michael@0: if (mycars[x]==="BMW") throw "ex"; michael@0: } michael@0: } michael@0: catch(e){ michael@0: if(e!=="ex")$ERROR('#1: Exception ==="ex". Actual: Exception ==='+ e ); michael@0: } michael@0: michael@0: michael@0: