js/src/jit-test/tests/debug/Frame-onStep-09.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 // After an implicit toString call throws an exception, the calling frame's
     2 // onStep hook fires.
     4 var g = newGlobal();
     5 g.eval("var x = {toString: function () { debugger; log += 'x'; throw 'mud'; }};");
     7 var dbg = Debugger(g);
     8 dbg.onDebuggerStatement = function (frame) {
     9     g.log += 'd';
    10     frame.older.onStep = function () {
    11         if (!g.log.match(/[sy]$/))
    12             g.log += 's';
    13     };
    14 };
    16 g.log = '';
    17 g.eval("try { x + ''; } catch (x) { }\n" +
    18        "log += 'y';\n");
    19 assertEq(g.log, "dxsy");
    21 g.log = '';
    22 g.eval("try { '' + x; } catch (x) { }\n" +
    23        "log += 'y';\n");
    24 assertEq(g.log, "dxsy");

mercurial