diff options
Diffstat (limited to 'js/src/jit-test/tests/debug/Frame-older-generators-03.js')
-rw-r--r-- | js/src/jit-test/tests/debug/Frame-older-generators-03.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/debug/Frame-older-generators-03.js b/js/src/jit-test/tests/debug/Frame-older-generators-03.js new file mode 100644 index 0000000000..128898b206 --- /dev/null +++ b/js/src/jit-test/tests/debug/Frame-older-generators-03.js @@ -0,0 +1,24 @@ +// Test that Debugger.Frame.prototype.older works on suspended generators. + +load(libdir + "asserts.js"); + +const g = newGlobal({ newCompartment: true }); +const dbg = new Debugger(g); + +g.eval(` +function* f() {} +`); + +let frame; +dbg.onEnterFrame = f => { + frame = f; + dbg.onEnterFrame = undefined; +}; + +const it = g.f(); + +assertEq(frame.older, null); + +it.next(); + +assertThrowsInstanceOf(() => frame.older, Error); |