summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Object-defineProperty-11.js
blob: 03ed7d651eb199ec5a3533a76036a7e00aef948b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// obj.defineProperty works when obj's referent is a wrapper.

var x = {};
var g = newGlobal({newCompartment: true});
g.x = x;
var dbg = new Debugger;
var gw = dbg.addDebuggee(g);
var xw = gw.getOwnPropertyDescriptor("x").value;
xw.defineProperty("p", {configurable: true, enumerable: true, writable: true, value: gw});
assertEq(x.p, g);

var desc = Object.getOwnPropertyDescriptor(x, "p");
assertEq(desc.configurable, true);
assertEq(desc.enumerable, true);
assertEq(desc.writable, true);
assertEq(desc.value, g);