summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Object-defineProperty-08.js
blob: fb694719e35a94615dc2a2664f6cc8e347abf75a (plain)
1
2
3
4
5
6
7
8
9
10
// obj.defineProperty throws if a value, getter, or setter is in a different compartment than obj

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