michael@0: // defineProperty can't re-define non-configurable properties. michael@0: // Also: when defineProperty throws, the exception is native to the debugger michael@0: // compartment, not a wrapper. michael@0: michael@0: var g = newGlobal(); michael@0: var dbg = new Debugger; michael@0: var gw = dbg.addDebuggee(g); michael@0: gw.defineProperty("p", {value: 1}); michael@0: g.p = 4; michael@0: assertEq(g.p, 1); michael@0: michael@0: var threw; michael@0: try { michael@0: gw.defineProperty("p", {value: 2}); michael@0: threw = false; michael@0: } catch (exc) { michael@0: threw = true; michael@0: assertEq(exc instanceof TypeError, true); michael@0: assertEq(typeof exc.message, "string"); michael@0: assertEq(typeof exc.stack, "string"); michael@0: } michael@0: assertEq(threw, true); michael@0: michael@0: assertEq(g.p, 1);