From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../debug/Debugger-onEnterFrame-resumption-06.js | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 js/src/jit-test/tests/debug/Debugger-onEnterFrame-resumption-06.js (limited to 'js/src/jit-test/tests/debug/Debugger-onEnterFrame-resumption-06.js') diff --git a/js/src/jit-test/tests/debug/Debugger-onEnterFrame-resumption-06.js b/js/src/jit-test/tests/debug/Debugger-onEnterFrame-resumption-06.js new file mode 100644 index 0000000000..c515475e9d --- /dev/null +++ b/js/src/jit-test/tests/debug/Debugger-onEnterFrame-resumption-06.js @@ -0,0 +1,31 @@ +// |jit-test| error:all-jobs-completed-successfully +// Verifiy that onEnterFrame's force-return queues the promise microtask +// to run in the debuggee's job queue, not the debugger's +// AutoDebuggerJobQueueInterruption. + +let g = newGlobal({ newCompartment: true }); +g.eval(` + async function asyncFn(x) { + await Promise.resolve(); + } + function enterDebuggee(){} +`); +const dbg = new Debugger(g); + +(async function() { + let it = g.asyncFn(); + + // Force-return when the await resumes. + dbg.onEnterFrame = () => { + dbg.onEnterFrame = undefined; + return { return: "exit" }; + }; + + const result = await it; + assertEq(result, "exit"); + // If execution here is resumed from the debugger's queue, this call will + // trigger DebuggeeWouldRun exception. + g.enterDebuggee(); + + throw "all-jobs-completed-successfully"; +})(); -- cgit v1.2.3