Imported Upstream version 1.0.0
[platform/upstream/js.git] / js / src / tests / ecma / extensions / trapflatclosure.js
1 /*
2  * Any copyright is dedicated to the Public Domain.
3  * http://creativecommons.org/licenses/publicdomain/
4  */
5
6 var BUGNUMBER = 549617;
7 var summary = 'flat closure debugged via trap while still active';
8
9 var expect = "abc";
10 var actual = expect;
11
12 function a(x, y) {
13     return function () { return x; };
14 }
15
16 var f = a("abc", 123);
17 if (this.trap && this.setDebug) {
18     setDebug(true);
19     trap(f, "try {actual = x} catch (e) {actual = e}");
20 }
21 f();
22
23 reportCompare(expect, actual, summary);
24
25 printStatus("All tests passed!");