summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Object-unwrap-03.js
blob: d6c9180be6bd2d64c1cca90d0709beef48228095 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Debugger.Object.prototype.unwrap should not let us see things in
// invisible-to-Debugger compartments.

load(libdir + 'asserts.js');

var g = newGlobal({ newCompartment: true, invisibleToDebugger: true });

var dbg = new Debugger;

// Create a wrapper in our compartment for the global.
// Note that makeGlobalObjectReference won't do: it tries to dereference as far
// as it can go.
var /* yo */ DOwg = dbg.makeGlobalObjectReference(this).makeDebuggeeValue(g);

assertThrowsInstanceOf(() => DOwg.unwrap(), Error);