summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Object-defineProperty-12.js
blob: 84ec3fbb5d87cd17f02d50d3753f1251dcce1fbd (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();
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);