Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
michael@0 | 1 | // Copyright 2009 the Sputnik authors. All rights reserved. |
michael@0 | 2 | // This code is governed by the BSD license found in the LICENSE file. |
michael@0 | 3 | |
michael@0 | 4 | /** |
michael@0 | 5 | * The production TryStatement : try Block Catch is evaluated as follows: 2. If Result(1).type is not throw, return Result(1) |
michael@0 | 6 | * |
michael@0 | 7 | * @path ch12/12.14/S12.14_A1.js |
michael@0 | 8 | * @description Executing TryStatement : try Block Catch. The statements doesn't cause actual exceptions |
michael@0 | 9 | */ |
michael@0 | 10 | |
michael@0 | 11 | // CHECK#1 |
michael@0 | 12 | try { |
michael@0 | 13 | var x=0; |
michael@0 | 14 | } |
michael@0 | 15 | catch (e) { |
michael@0 | 16 | $ERROR('#1: If Result(1).type is not throw, return Result(1). Actual: 4 Return(Result(3))'); |
michael@0 | 17 | } |
michael@0 | 18 | |
michael@0 | 19 | // CHECK#2 |
michael@0 | 20 | var c1=0; |
michael@0 | 21 | try{ |
michael@0 | 22 | var x1=1; |
michael@0 | 23 | } |
michael@0 | 24 | finally |
michael@0 | 25 | { |
michael@0 | 26 | c1=1; |
michael@0 | 27 | } |
michael@0 | 28 | if(x1!==1){ |
michael@0 | 29 | $ERROR('#2.1: "try" block must be evaluated. Actual: try Block has not been evaluated'); |
michael@0 | 30 | } |
michael@0 | 31 | if (c1!==1){ |
michael@0 | 32 | $ERROR('#2.2: "finally" block must be evaluated. Actual: finally Block has not been evaluated'); |
michael@0 | 33 | } |
michael@0 | 34 | |
michael@0 | 35 | // CHECK#3 |
michael@0 | 36 | var c2=0; |
michael@0 | 37 | try{ |
michael@0 | 38 | var x2=1; |
michael@0 | 39 | } |
michael@0 | 40 | catch(e){ |
michael@0 | 41 | $ERROR('#3.1: If Result(1).type is not throw, return Result(1). Actual: 4 Return(Result(3))'); |
michael@0 | 42 | } |
michael@0 | 43 | finally{ |
michael@0 | 44 | c2=1; |
michael@0 | 45 | } |
michael@0 | 46 | if(x2!==1){ |
michael@0 | 47 | $ERROR('#3.2: "try" block must be evaluated. Actual: try Block has not been evaluated'); |
michael@0 | 48 | } |
michael@0 | 49 | if (c2!==1){ |
michael@0 | 50 | $ERROR('#3.3: "finally" block must be evaluated. Actual: finally Block has not been evaluated'); |
michael@0 | 51 | } |
michael@0 | 52 |