js/src/jit-test/tests/debug/Script-source-02.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/Script-source-02.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,16 @@
     1.4 +/*
     1.5 + * Script.prototype.source should be the same object for both the top-level
     1.6 + * script and the script of functions accessed as debuggee values on the global
     1.7 + */
     1.8 +let g = newGlobal();
     1.9 +let dbg = new Debugger();
    1.10 +let gw = dbg.addDebuggee(g);
    1.11 +
    1.12 +let count = 0;
    1.13 +dbg.onDebuggerStatement = function (frame) {
    1.14 +    ++count;
    1.15 +    assertEq(frame.script.source, gw.makeDebuggeeValue(g.f).script.source);
    1.16 +}
    1.17 +
    1.18 +g.eval("function f() {}; debugger;");
    1.19 +assertEq(count, 1);

mercurial