Thu, 15 Jan 2015 15:55:04 +0100
Back out 97036ab72558 which inappropriately compared turds to third parties.
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 | * StatementList: StatementList Statement inside the Block is evaluated from left to right |
michael@0 | 6 | * |
michael@0 | 7 | * @path ch12/12.1/S12.1_A5.js |
michael@0 | 8 | * @description Throwing exceptions within embedded/sequence Blocks |
michael@0 | 9 | */ |
michael@0 | 10 | |
michael@0 | 11 | ////////////////////////////////////////////////////////////////////////////// |
michael@0 | 12 | //CHECK#1 |
michael@0 | 13 | try { |
michael@0 | 14 | throw 1; |
michael@0 | 15 | throw 2; |
michael@0 | 16 | throw 3; |
michael@0 | 17 | $ERROR('1.1: throw 1 lead to throwing exception'); |
michael@0 | 18 | } catch (e) { |
michael@0 | 19 | if (e!==1) { |
michael@0 | 20 | $ERROR('#1.2: Exception === 1. Actual: Exception ==='+ e); |
michael@0 | 21 | } |
michael@0 | 22 | } |
michael@0 | 23 | //////////////////////////////////////////////////////////////////////////////// |
michael@0 | 24 | |
michael@0 | 25 | ////////////////////////////////////////////////////////////////////////////// |
michael@0 | 26 | //CHECK#2 |
michael@0 | 27 | try { |
michael@0 | 28 | { |
michael@0 | 29 | throw 1; |
michael@0 | 30 | throw 2; |
michael@0 | 31 | } |
michael@0 | 32 | throw 3; |
michael@0 | 33 | $ERROR('#2.1: throw 1 lead to throwing exception'); |
michael@0 | 34 | } catch (e) { |
michael@0 | 35 | if (e!==1) { |
michael@0 | 36 | $ERROR('#2.2: Exception === 1. Actual: Exception ==='+ e); |
michael@0 | 37 | } |
michael@0 | 38 | } |
michael@0 | 39 | //////////////////////////////////////////////////////////////////////////////// |
michael@0 | 40 | |
michael@0 | 41 | ////////////////////////////////////////////////////////////////////////////// |
michael@0 | 42 | //CHECK#3 |
michael@0 | 43 | try { |
michael@0 | 44 | throw 1; |
michael@0 | 45 | { |
michael@0 | 46 | throw 2; |
michael@0 | 47 | throw 3; |
michael@0 | 48 | } |
michael@0 | 49 | $ERROR('#3.1: throw 1 lead to throwing exception'); |
michael@0 | 50 | } catch (e) { |
michael@0 | 51 | if (e!==1) { |
michael@0 | 52 | $ERROR('#3.2: Exception === 1. Actual: Exception ==='+ e); |
michael@0 | 53 | } |
michael@0 | 54 | } |
michael@0 | 55 | //////////////////////////////////////////////////////////////////////////////// |
michael@0 | 56 | |
michael@0 | 57 |