Closed Bug 1612007 Opened 5 years ago Closed 5 years ago

Add convenient methods for throwing DOMExceptions on ErrorResult

Categories

(Core :: DOM: Bindings (WebIDL), enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Things like ThrowSyntaxError, etc. Nika suggested this today.

In the new setup you can do: aRv.ThrowSyntaxError("you typed it wrong").

We can convert existing ThrowDOMException uses to these, then make ThrowDOMException private...

Note that we are getting pretty close to just being able to create our DOMExceptions without an nsresult at all. Once everyone is switched to the new accessors, might be worth doing that, perhaps.

And fwiw, we only have ~100 ThrowDOMException callsites, and can convert them to this new thing pretty easily...

Note that we are getting pretty close to just being able to create our DOMExceptions without an nsresult at all.

Though that might be slower, because then it will look up the nsresult by name....

Attachment #9123407 - Attachment description: Bug 1612007. Add convenience methods for throwing varioys spec-defined DOMExceptions on ErrorResult. r=smaug → Bug 1612007. Add convenience methods for throwing various spec-defined DOMExceptions on ErrorResult. r=smaug
Pushed by bzbarsky@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/70615b052db5 Add convenience methods for throwing various spec-defined DOMExceptions on ErrorResult. r=smaug
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
Blocks: 1612213
Blocks: dom-error
Type: defect → enhancement
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: