summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Object-unwrap-03.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/debug/Object-unwrap-03.js')
-rw-r--r--js/src/jit-test/tests/debug/Object-unwrap-03.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/debug/Object-unwrap-03.js b/js/src/jit-test/tests/debug/Object-unwrap-03.js
new file mode 100644
index 0000000000..d6c9180be6
--- /dev/null
+++ b/js/src/jit-test/tests/debug/Object-unwrap-03.js
@@ -0,0 +1,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);