|
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 * Sanity test for "catch(Indetifier) statement" |
|
6 * |
|
7 * @path ch12/12.14/S12.14_A4.js |
|
8 * @description Checking if deleting an exception fails |
|
9 * @noStrict |
|
10 */ |
|
11 |
|
12 // CHECK#1 |
|
13 try { |
|
14 throw "catchme"; |
|
15 $ERROR('#1.1: throw "catchme" lead to throwing exception'); |
|
16 } |
|
17 catch (e) { |
|
18 if (delete e){ |
|
19 $ERROR('#1.2: Exception has DontDelete property'); |
|
20 } |
|
21 if (e!=="catchme") { |
|
22 $ERROR('#1.3: Exception === "catchme". Actual: Exception ==='+ e ); |
|
23 } |
|
24 } |
|
25 |
|
26 // CHECK#2 |
|
27 try { |
|
28 throw "catchme"; |
|
29 $ERROR('#2.1: throw "catchme" lead to throwing exception'); |
|
30 } |
|
31 catch(e){} |
|
32 try{ |
|
33 e; |
|
34 $ERROR('#2.2: Deleting catching exception after ending "catch" block'); |
|
35 } |
|
36 catch(err){} |
|
37 |