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

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

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

mercurial