js/src/jit-test/tests/debug/Frame-onPop-star-generators-02.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     1 // Throwing an exception from an onPop handler when yielding terminates the debuggee
     2 // but does not close the generator-iterator.
     4 load(libdir + 'iteration.js')
     6 var g = newGlobal();
     7 var dbg = new Debugger;
     8 var gw = dbg.addDebuggee(g);
     9 dbg.onDebuggerStatement = function handleDebugger(frame) {
    10     frame.onPop = function (c) {
    11         throw "fit";
    12     };
    13 };
    14 g.eval("function* g() { for (var i = 0; i < 10; i++) { debugger; yield i; } }");
    15 g.eval("var it = g();");
    16 assertEq(gw.evalInGlobal("it.next();"), null);
    18 dbg.enabled = false;
    19 assertIteratorNext(g.it, 1);

mercurial