summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Object-defineProperty-01.js
blob: 91330694b932aa5d4a6a13eb9b5a041cfe629c04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// obj.defineProperty can define simple data properties.

var g = newGlobal({newCompartment: true});
var dbg = new Debugger;
var gobj = dbg.addDebuggee(g);
gobj.defineProperty("x", {configurable: true, enumerable: true, writable: true, value: 'ok'});
assertEq(g.x, 'ok');

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