summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/onEnterFrame-async-resumption-09.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/debug/onEnterFrame-async-resumption-09.js')
-rw-r--r--js/src/jit-test/tests/debug/onEnterFrame-async-resumption-09.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/debug/onEnterFrame-async-resumption-09.js b/js/src/jit-test/tests/debug/onEnterFrame-async-resumption-09.js
new file mode 100644
index 0000000000..4a3bd52c3b
--- /dev/null
+++ b/js/src/jit-test/tests/debug/onEnterFrame-async-resumption-09.js
@@ -0,0 +1,33 @@
+// Resume execution of async generator when initially yielding.
+
+let g = newGlobal({newCompartment: true});
+let dbg = new Debugger();
+let gw = dbg.addDebuggee(g);
+
+g.eval(`
+ async function* f() {
+ await 123;
+ return "ponies";
+ }
+`);
+
+let counter = 0;
+dbg.onEnterFrame = frame => {
+ frame.onPop = completion => {
+ if (counter++ === 0) {
+ let genObj = completion.return.unsafeDereference();
+
+ genObj.next().then(({value, done}) => {
+ assertEq(value, "ponies");
+ assertEq(done, true);
+ });
+ }
+ };
+};
+
+let it = g.f();
+
+it.next().then(({value, done}) => {
+ assertEq(value, undefined);
+ assertEq(done, true);
+});