michael@0: // |reftest| require-or(debugMode,skip) michael@0: /* michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/licenses/publicdomain/ michael@0: */ michael@0: michael@0: var BUGNUMBER = 549617; michael@0: var summary = 'flat closure debugged via trap while still active'; michael@0: michael@0: var expect = "abc"; michael@0: var actual = expect; michael@0: michael@0: function a(x, y) { michael@0: return function () { return x; }; michael@0: } michael@0: michael@0: var f = a("abc", 123); michael@0: if (this.trap && this.setDebug) { michael@0: setDebug(true); michael@0: trap(f, "try {actual = x} catch (e) {actual = e}"); michael@0: } michael@0: f(); michael@0: michael@0: reportCompare(expect, actual, summary); michael@0: michael@0: printStatus("All tests passed!");