|
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 * When the production "IfStatement: if ( Expression ) Statement else Statement" is evaluated, Expression is evaluated first |
|
6 * |
|
7 * @path ch12/12.5/S12.5_A3.js |
|
8 * @description The Expression is "(function(){throw 1})()" |
|
9 */ |
|
10 |
|
11 ////////////////////////////////////////////////////////////////////////////// |
|
12 //CHECK#1 |
|
13 try { |
|
14 if ((function(){throw 1})()) abracadabra |
|
15 } catch (e) { |
|
16 if (e !== 1) { |
|
17 $ERROR('#1: Exception === 1. Actual: Exception ==='+ e); |
|
18 } |
|
19 } |
|
20 // |
|
21 ////////////////////////////////////////////////////////////////////////////// |
|
22 |
|
23 ////////////////////////////////////////////////////////////////////////////// |
|
24 //CHECK#2 |
|
25 try { |
|
26 if ((function(){throw 1})()) abracadabra; else blablachat; |
|
27 } catch (e) { |
|
28 if (e !== 1) { |
|
29 $ERROR('#2: Exception === 1. Actual: Exception ==='+ e); |
|
30 } |
|
31 } |
|
32 // |
|
33 ////////////////////////////////////////////////////////////////////////////// |
|
34 |
|
35 |