summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Object-defineProperty-06.js
blob: 92aed6f1b4983e7edf50352b7fb067c5c80bb02f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// obj.defineProperty with vague descriptors works like Object.defineProperty

var g = newGlobal();
var dbg = new Debugger;
var gw = dbg.addDebuggee(g);

gw.defineProperty("p", {configurable: true, enumerable: true});
assertEq(g.p, undefined);
var desc = g.Object.getOwnPropertyDescriptor(g, "p");
assertEq(desc.configurable, true);
assertEq(desc.enumerable, true);
assertEq(desc.value, undefined);
assertEq(desc.writable, false);

gw.defineProperty("q", {});
assertEq(g.q, undefined);
var desc = g.Object.getOwnPropertyDescriptor(g, "q");
assertEq(desc.configurable, false);
assertEq(desc.enumerable, false);
assertEq(desc.value, undefined);
assertEq(desc.writable, false);