Closed Bug 1333556 Opened 7 years ago Closed 7 years ago

WebIDL callbacks should assert that their incoming rv is not already failing

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Apparently people think this is a reasonable way to call an IDL callback:

    ErrorResult result;
    result.Throw(rv);
    const nsAString& reason = NS_LITERAL_STRING("Error pairing.");
    aCallback.PairingFailed(reason, result);
    ENSURE_SUCCESS_VOID(result);

but of course this is nonsense, because we're throwing on the _outparam_.  IDL callbacks should assert against this.
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #8830334 - Flags: review?(peterv) → review+
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e7b337b06065
Assert that an ErrorResult passed to a WebIDL callback as an outparam is not already-failed.  r=peterv
https://hg.mozilla.org/mozilla-central/rev/e7b337b06065
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: