|
1 /// Copyright (c) 2012 Ecma International. All rights reserved. |
|
2 /// Ecma International makes this code available under the terms and conditions set |
|
3 /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the |
|
4 /// "Use Terms"). Any redistribution of this code must retain the above |
|
5 /// copyright and this notice and otherwise comply with the Use Terms. |
|
6 /** |
|
7 * local vars must not be visible outside with block |
|
8 * local functions must not be visible outside with block |
|
9 * local function expresssions should not be visible outside with block |
|
10 * local vars must shadow outer vars |
|
11 * local functions must shadow outer functions |
|
12 * local function expresssions must shadow outer function expressions |
|
13 * eval should use the appended object to the scope chain |
|
14 * |
|
15 * @path ch12/12.14/12.14-7.js |
|
16 * @description catch introduces scope - scope removed when exiting catch block |
|
17 */ |
|
18 |
|
19 |
|
20 function testcase() { |
|
21 var o = {foo: 1}; |
|
22 var catchAccessed = false; |
|
23 |
|
24 try { |
|
25 throw o; |
|
26 } |
|
27 catch (expObj) { |
|
28 catchAccessed = (expObj.foo == 1); |
|
29 } |
|
30 |
|
31 try { |
|
32 expObj; |
|
33 } |
|
34 catch (e) { |
|
35 return catchAccessed && e instanceof ReferenceError |
|
36 } |
|
37 return false; |
|
38 } |
|
39 runTestCase(testcase); |