Debian Codegraph @

js/src/tests/test262/language/statements/try/12.14-16.js

raw
1 // Copyright (c) 2012 Ecma International. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 es5id: 12.14-16
6 description: >
7 Exception object is a function which update in catch block, when
8 an exception parameter is called as a function in catch block,
9 global object is passed as the this value
10 flags: [noStrict]
11 ---*/
12
13 var global = this;
14 var result;
15
16 (function() {
17 try {
18 throw function () {
19 this._12_14_16_foo = "test";
20 };
21 } catch (e) {
22 var obj = {};
23 obj.test = function () {
24 this._12_14_16_foo = "test1";
25 };
26 e = obj.test;
27 e();
28 result = global._12_14_16_foo;
29 }
30 })();
31
32 assert.sameValue(result, "test1", 'result');
33
34 reportCompare(0, 0);