summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Object-defineProperty-07.js
blob: 8565c4735743f87e8374de0835b068d229f3feac (plain)
1
2
3
4
5
6
7
8
9
10
// obj.defineProperty throws if a value, getter, or setter is not a debuggee value.

load(libdir + "asserts.js");
var g = newGlobal({newCompartment: true});
var dbg = new Debugger;
var gobj = dbg.addDebuggee(g);
assertThrowsInstanceOf(function () { gobj.defineProperty('x', {value: {}}); }, TypeError);
assertThrowsInstanceOf(function () { gobj.defineProperty('x', {get: Number}); }, TypeError);
assertThrowsInstanceOf(function () { gobj.defineProperty('x', {get: gobj, set: Number}) },
                       TypeError);