Closed Bug 1726595 Opened 4 years ago Closed 4 years ago

WebIDL code generation for Promise returning callbacks doesn't handle abrupt completions correctly.

Categories

(Core :: DOM: Bindings (WebIDL), defect)

defect

Tracking

()

RESOLVED FIXED
94 Branch
Tracking Status
firefox94 --- fixed

People

(Reporter: mgaudet, Assigned: peterv)

References

Details

Attachments

(2 files)

Our Promise-returning callback interfaces (callback Foo = Promise<...>()) don't correctly handle abrupt completions

The WebIDL spec for callback invoke has as Step 15.5 and 15.6 returning a promise rejected with the error; however, it appears that we instead simply return nullptr and note the exception on the return value.

There's only one in-tree consumer of a Promise returning callback: LockGrantedCallback which has a special helper to handle this.

I spent more than a few hours trying to get something working; alas, every approach I've taken has been thwarted so far. Can share in progress code if there's interest.

Assignee: nobody → peterv
Status: NEW → ASSIGNED

Note that even with this, there are cases where creating the promise for the return value fails. So I think the LockGrantedCallback helper might need to stay.

Flags: needinfo?(krosylight)

Thanks, I guess I can resolve bug 1726363 as a dupe of this?

Flags: needinfo?(krosylight)
Pushed by pvanderbeken@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/68364de67158 WebIDL code generation for Promise returning callbacks doesn't handle abrupt completions correctly. r=edgar
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: