summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/statements/try/12.14-13.js
blob: b04aae5e59c03dde662c0b8a02f8131a9c465031 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 2012 Ecma International.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
es5id: 12.14-13
description: catch introduces scope - updates are based on scope
flags: [noStrict]
---*/

        var res1 = false;
        var res2 = false;
        var res3 = false;

(function() {
        var x_12_14_13 = 'local';

            function foo() {
                this.x_12_14_13 = 'instance';
            }

            try {
                throw foo;
            }
            catch (e) {
                res1 = (x_12_14_13 === 'local');
                e();
                res2 = (x_12_14_13 === 'local');
            }
            res3 = (x_12_14_13 === 'local');
})();

assert(res1, 'res1 !== true');
assert(res2, 'res2 !== true');
assert(res3, 'res3 !== true');

reportCompare(0, 0);