js/src/tests/test262/ch12/12.5/S12.5_A5.js

branch
TOR_BUG_3246
changeset 6
8bccb770b82d
equal deleted inserted replaced
-1:000000000000 0:11038d3fe314
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 * FunctionDeclaration inside the "if" Expression is evaluated as true and function will not be declarated
6 *
7 * @path ch12/12.5/S12.5_A5.js
8 * @description The "if" Expression is "function __func(){throw "FunctionExpression";}"
9 */
10
11 //////////////////////////////////////////////////////////////////////////////
12 //CHECK#1
13 try {
14 __func=__func;
15 $ERROR('#1: "__func=__func" lead to throwing exception');
16 } catch (e) {
17 ;
18 }
19 //
20 //////////////////////////////////////////////////////////////////////////////
21
22
23 //////////////////////////////////////////////////////////////////////////////
24 //CHECK#2
25 try {
26 if(function __func(){throw "FunctionExpression";}) (function(){throw "TrueBranch"})(); else (function(){"MissBranch"})();
27 } catch (e) {
28 if (e !== "TrueBranch") {
29 $ERROR('#2: Exception ==="TrueBranch". Actual: Exception ==='+ e);
30 }
31 }
32 //
33 //////////////////////////////////////////////////////////////////////////////
34
35 //////////////////////////////////////////////////////////////////////////////
36 //CHECK#3
37 try {
38 __func=__func;
39 $ERROR('#3: "__func=__func" lead to throwing exception');
40 } catch (e) {
41 ;
42 }
43 //
44 //////////////////////////////////////////////////////////////////////////////
45
46
47
48

mercurial