summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Debugger-ctor-03.js
blob: f2245e7c9add0b726c6f283a33b0eb7a3861a19b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// If the debuggee cannot be put into debug mode, throw.

// Run this test only if this compartment can't be put into debug mode.
var canEnable = true;
if (typeof setDebugMode === 'function') {
    try {
        setDebugMode(true);
    } catch (exc) {
        canEnable = false;
    }
}

if (!canEnable) {
    var g = newGlobal();
    g.libdir = libdir;
    g.eval("load(libdir + 'asserts.js');");
    g.parent = this;
    g.eval("assertThrowsInstanceOf(function () { new Debugger(parent); }, Error);");
}