Closed Bug 1595980 Opened 5 years ago Closed 4 years ago

[jsdbg2] Forced return from an await onEnterFrame can cause a DebuggeeWouldRun exception

Categories

(Core :: JavaScript Engine, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: loganfsmyth, Assigned: loganfsmyth)

Details

Attachments

(1 file)

Test case:

let g = newGlobal({ newCompartment: true });
g.eval(`
  async function asyncFn(x) {
    await Promise.resolve();
  }
`);
const dbg = new Debugger(g);

(async function() {
  let it = g.asyncFn().catch(() => {});
  dbg.onEnterFrame = () => ({ return: "exit" });

  await it;

  dbg.onEnterFrame = undefined;
  g.asyncFn();
})();

I assume the forced return is queuing up the promise in microtask entry synchronously during the onEnterFrameHook where before it would have waited until after onEnterFrame completed.

Priority: -- → P2
Assignee: nobody → loganfsmyth
Status: NEW → ASSIGNED

Interesting: passing the shell --enable-experimental-await-fix makes this bug no longer occur.

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:loganfsmyth, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(loganfsmyth)
Pushed by loganfsmyth@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/042af67cea49
Move return value adjustment into the debuggee scope. r=jimb
Flags: needinfo?(loganfsmyth)
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: