diff options
Diffstat (limited to 'js/src/jit-test/tests/debug/onEnterFrame-generator-10.js')
-rw-r--r-- | js/src/jit-test/tests/debug/onEnterFrame-generator-10.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/debug/onEnterFrame-generator-10.js b/js/src/jit-test/tests/debug/onEnterFrame-generator-10.js new file mode 100644 index 0000000000..32546dc4d1 --- /dev/null +++ b/js/src/jit-test/tests/debug/onEnterFrame-generator-10.js @@ -0,0 +1,17 @@ +// Bug 1556033. Test behavior of onEnterFrame "return" completion +// values during explicit .next() calls. + +let g = newGlobal({newCompartment: true}); +g.eval(`function* f(x) { }`); +let dbg = new Debugger(g); + +let it = g.f(); + +dbg.onEnterFrame = () => ({ return: "exit" }); +const result = it.next(); +assertEq(result.value, "exit"); +assertEq(result.done, true); + +const result2 = it.next(); +assertEq(result2.value, undefined); +assertEq(result2.done, true); |