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: * The production TryStatement : try Block Catch is evaluated as follows: 2. If Result(1).type is not throw, return Result(1) michael@0: * michael@0: * @path ch12/12.14/S12.14_A1.js michael@0: * @description Executing TryStatement : try Block Catch. The statements doesn't cause actual exceptions michael@0: */ michael@0: michael@0: // CHECK#1 michael@0: try { michael@0: var x=0; michael@0: } michael@0: catch (e) { michael@0: $ERROR('#1: If Result(1).type is not throw, return Result(1). Actual: 4 Return(Result(3))'); michael@0: } michael@0: michael@0: // CHECK#2 michael@0: var c1=0; michael@0: try{ michael@0: var x1=1; michael@0: } michael@0: finally michael@0: { michael@0: c1=1; michael@0: } michael@0: if(x1!==1){ michael@0: $ERROR('#2.1: "try" block must be evaluated. Actual: try Block has not been evaluated'); michael@0: } michael@0: if (c1!==1){ michael@0: $ERROR('#2.2: "finally" block must be evaluated. Actual: finally Block has not been evaluated'); michael@0: } michael@0: michael@0: // CHECK#3 michael@0: var c2=0; michael@0: try{ michael@0: var x2=1; michael@0: } michael@0: catch(e){ michael@0: $ERROR('#3.1: If Result(1).type is not throw, return Result(1). Actual: 4 Return(Result(3))'); michael@0: } michael@0: finally{ michael@0: c2=1; michael@0: } michael@0: if(x2!==1){ michael@0: $ERROR('#3.2: "try" block must be evaluated. Actual: try Block has not been evaluated'); michael@0: } michael@0: if (c2!==1){ michael@0: $ERROR('#3.3: "finally" block must be evaluated. Actual: finally Block has not been evaluated'); michael@0: } michael@0: