summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Object-defineProperty-12.js
blob: 821617711d156ed85922521ff51b80eea4b12da3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// obj.defineProperty redefining an existing property leaves unspecified attributes unchanged.

var g = newGlobal({newCompartment: true});
g.p = 1;
var dbg = new Debugger;
var gw = dbg.addDebuggee(g);

gw.defineProperty("p", {value: 2});
assertEq(g.p, 2);

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

g.p = 3;
assertEq(g.p, 3);