tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

Object-executeInGlobal-11.js (896B)


      1 // executeInGlobalWithBindings correctly handles optional custom url option
      2 var g = newGlobal({newCompartment: true});
      3 var dbg = new Debugger(g);
      4 var debuggee = dbg.getDebuggees()[0];
      5 var count = 0;
      6 
      7 function testUrl (options, expected) {
      8    count++;
      9    dbg.onNewScript = function(script){
     10        dbg.onNewScript = undefined;
     11        assertEq(script.url, expected);
     12        count--;
     13    };
     14    debuggee.executeInGlobalWithBindings("", {}, options);
     15 }
     16 
     17 
     18 testUrl(undefined, "debugger eval code");
     19 testUrl(null, "debugger eval code");
     20 testUrl({ url: undefined }, "debugger eval code");
     21 testUrl({ url: null }, "null");
     22 testUrl({ url: 5 }, "5");
     23 testUrl({ url: "" }, "");
     24 testUrl({ url: "test" }, "test");
     25 testUrl({ url: "Ðëßþ" }, "Ðëßþ");
     26 testUrl({ url: "тест" }, "тест");
     27 testUrl({ url: "テスト" }, "テスト");
     28 testUrl({ url: "\u{1F9EA}" }, "\u{1F9EA}");
     29 assertEq(count, 0);