1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/debug/Frame-evalWithBindings-12.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,26 @@ 1.4 +// evalWithBindings correctly handles optional custom url option 1.5 +var g = newGlobal(); 1.6 +var dbg = new Debugger(g); 1.7 +var count = 0; 1.8 + 1.9 +function testUrl (options, expected) { 1.10 + count++; 1.11 + dbg.onDebuggerStatement = function (frame) { 1.12 + dbg.onNewScript = function (script) { 1.13 + dbg.onNewScript = undefined; 1.14 + assertEq(script.url, expected); 1.15 + count--; 1.16 + }; 1.17 + frame.evalWithBindings("", {}, options); 1.18 + }; 1.19 + g.eval("debugger;"); 1.20 +} 1.21 + 1.22 + 1.23 +testUrl(undefined, "debugger eval code"); 1.24 +testUrl(null, "debugger eval code"); 1.25 +testUrl({ url: undefined }, "debugger eval code"); 1.26 +testUrl({ url: null }, "null"); 1.27 +testUrl({ url: 5 }, "5"); 1.28 +testUrl({ url: "test" }, "test"); 1.29 +assertEq(count, 0);