|
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 * "throw Expression" returns (throw, GetValue(Result(1)), empty), where 1 evaluates Expression |
|
6 * |
|
7 * @path ch12/12.13/S12.13_A2_T3.js |
|
8 * @description Throwing boolean |
|
9 */ |
|
10 |
|
11 // CHECK#1 |
|
12 try{ |
|
13 throw true; |
|
14 } |
|
15 catch(e){ |
|
16 if (e!==true) $ERROR('#1: Exception ===true. Actual: Exception ==='+ e ); |
|
17 } |
|
18 |
|
19 // CHECK#2 |
|
20 try{ |
|
21 throw false; |
|
22 } |
|
23 catch(e){ |
|
24 if (e!==false) $ERROR('#2: Exception ===false. Actual: Exception ==='+ e ); |
|
25 } |
|
26 |
|
27 // CHECK#3 |
|
28 var b=false; |
|
29 try{ |
|
30 throw b; |
|
31 } |
|
32 catch(e){ |
|
33 if (e!==false) $ERROR('#3: Exception ===false. Actual: Exception ==='+ e ); |
|
34 } |
|
35 |
|
36 // CHECK#4 |
|
37 var b=true; |
|
38 try{ |
|
39 throw b; |
|
40 } |
|
41 catch(e){ |
|
42 if (e!==true) $ERROR('#4: Exception ===true. Actual: Exception ==='+ e ); |
|
43 } |
|
44 |