webidl
webidl copied to clipboard
DOMException needs Exposed=*
Currently DOMException’s exposure set is (Window, Worker)
. However there are interfaces whose exposure sets are *
which define operations that can throw DOMExceptions:
- AbortController.prototype.abort
- AbortSignal.abort
- AbortSignal.timeout
- EventTarget.prototype.dispatchEvent
- ...probably a bunch more
Likewise there are constructs found in global contexts not included in the (Window, Worker)
exposure set with steps that specify throwing DOMExceptions, e.g. PaintWorkletGlobalScope.prototype.registerPaint.
Curious aside: I checked what Chromium’s current implementation of PaintWorkletGlobalScope does in practice and found that it did throw a DOMException there as advertised yet did not expose DOMException as a global. The surprise was that most interfaces that are allegedly universal weren’t present there, either, so it’s currently an odd little world where ReadableStreamDefaultController
is at-the-ready but not, say, URL
.
cc @Ms2ger @domenic
Good point, oversight on my side. PRd as #1137.