summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/save-queue-resets-draining.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/debug/save-queue-resets-draining.js')
-rw-r--r--js/src/jit-test/tests/debug/save-queue-resets-draining.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/debug/save-queue-resets-draining.js b/js/src/jit-test/tests/debug/save-queue-resets-draining.js
new file mode 100644
index 0000000000..3d63c09bf8
--- /dev/null
+++ b/js/src/jit-test/tests/debug/save-queue-resets-draining.js
@@ -0,0 +1,18 @@
+// The draining state is reset when saving the job queue.
+
+let g = newGlobal({newCompartment: true});
+
+let dbg = new Debugger();
+let gw = dbg.addDebuggee(g);
+
+dbg.onDebuggerStatement = frame => {
+ // Enqueue a new job from within the debugger while executing another job
+ // from outside of the debugger.
+ enqueueJob(function() {});
+};
+
+g.eval(`
+ enqueueJob(function() {
+ debugger;
+ });
+`);