js/src/jit-test/tests/debug/Object-evalInGlobal-07.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/Object-evalInGlobal-07.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,24 @@
     1.4 +// evalInGlobal correctly handles optional custom url option
     1.5 +var g = newGlobal();
     1.6 +var dbg = new Debugger(g);
     1.7 +var debuggee = dbg.getDebuggees()[0];
     1.8 +var count = 0;
     1.9 +
    1.10 +function testUrl (options, expected) {
    1.11 +    count++;
    1.12 +    dbg.onNewScript = function(script){
    1.13 +        dbg.onNewScript = undefined;
    1.14 +        assertEq(script.url, expected);
    1.15 +        count--;
    1.16 +    };
    1.17 +    debuggee.evalInGlobal("", options);
    1.18 +}
    1.19 +
    1.20 +
    1.21 +testUrl(undefined, "debugger eval code");
    1.22 +testUrl(null, "debugger eval code");
    1.23 +testUrl({ url: undefined }, "debugger eval code");
    1.24 +testUrl({ url: null }, "null");
    1.25 +testUrl({ url: 5 }, "5");
    1.26 +testUrl({ url: "test" }, "test");
    1.27 +assertEq(count, 0);

mercurial