summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Object-getOwnPropertyDescriptor-surfaces-01.js
blob: b0b89f76237804d0bc1db82fcbd2eb03c6c7b412 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// The argument to Debugger.Object.prototype.getOwnPropertyDescriptor can be omitted.

var g = newGlobal({newCompartment: true});
g.eval("var obj = {};");

var dbg = Debugger(g);
var obj;
dbg.onDebuggerStatement = function (frame) { obj = frame.eval("obj").return; };
g.eval("debugger;");

assertEq(obj.getOwnPropertyDescriptor(), undefined);
g.obj.undefined = 17;
var desc = obj.getOwnPropertyDescriptor();
assertEq(desc.value, 17);