js/src/jit-test/tests/debug/Frame-this-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/Frame-this-02.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,17 @@
     1.4 +// Frame.prototype.this in strict direct eval frames
     1.5 +
     1.6 +var g = newGlobal();
     1.7 +var dbg = new Debugger(g);
     1.8 +var hits = 0;
     1.9 +dbg.onDebuggerStatement = function (frame) {
    1.10 +    hits++;
    1.11 +    assertEq(frame.this, g.v);
    1.12 +};
    1.13 +
    1.14 +g.eval("function f() { 'use strict'; eval('debugger;'); }");
    1.15 +
    1.16 +g.eval("Boolean.prototype.f = f; v = true; v.f();");
    1.17 +g.eval("f.call(v);");
    1.18 +g.eval("v = null; f.call(v);");
    1.19 +
    1.20 +assertEq(hits, 3);

mercurial