|
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 * Function's scope chain is started when it is declared |
|
6 * |
|
7 * @path ch13/13.2/S13.2.2_A19_T4.js |
|
8 * @description Function is declared in the hierarchical object scope and then an exception is thrown |
|
9 */ |
|
10 |
|
11 var a = 1; |
|
12 |
|
13 var __obj = {a:2,__obj:{a:3}}; |
|
14 |
|
15 try { |
|
16 with (__obj) |
|
17 { |
|
18 with(__obj){ |
|
19 var __func = function(){return a;}; |
|
20 throw 5; |
|
21 } |
|
22 } |
|
23 } catch (e) { |
|
24 ; |
|
25 } |
|
26 |
|
27 result = __func(); |
|
28 |
|
29 ////////////////////////////////////////////////////////////////////////////// |
|
30 //CHECK#1 |
|
31 if (result !== 3) { |
|
32 $ERROR('#1: result === 3. Actual: result ==='+result); |
|
33 } |
|
34 // |
|
35 ////////////////////////////////////////////////////////////////////////////// |
|
36 |
|
37 |
|
38 |
|
39 |