js/src/jit-test/tests/debug/Debugger-ctor-03.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/debug/Debugger-ctor-03.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,19 @@
     1.4 +// If the debuggee cannot be put into debug mode, throw.
     1.5 +
     1.6 +// Run this test only if this compartment can't be put into debug mode.
     1.7 +var canEnable = true;
     1.8 +if (typeof setDebugMode === 'function') {
     1.9 +    try {
    1.10 +        setDebugMode(true);
    1.11 +    } catch (exc) {
    1.12 +        canEnable = false;
    1.13 +    }
    1.14 +}
    1.15 +
    1.16 +if (!canEnable) {
    1.17 +    var g = newGlobal();
    1.18 +    g.libdir = libdir;
    1.19 +    g.eval("load(libdir + 'asserts.js');");
    1.20 +    g.parent = this;
    1.21 +    g.eval("assertThrowsInstanceOf(function () { new Debugger(parent); }, Error);");
    1.22 +}

mercurial