-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Closed
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.
Description
Having to do this is bad code smell
if (!globalThis.DOMException) {
try {
const { MessageChannel } = require('worker_threads'),
port = new MessageChannel().port1,
ab = new ArrayBuffer()
port.postMessage(ab, [ab, ab])
} catch (err) {
err.constructor.name === 'DOMException' && (
globalThis.DOMException = err.constructor
)
}
}
Since we are aligning more with Web standard APIs now days with the arise of URL, URLSearchParams, Event & EventTarget, MessageChannel, Workers, BroadcastChannel, Blob, File, AbortController, atob, bota, TextEncoder, TextDecoder etc
It would only start to make sense to expose DOMException globally so you are able to check if a error is a instances of DOMException.
Pollyfills need this Error class also.
And more feature web standard apis is probably going to need it.
aduh95
Metadata
Metadata
Assignees
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.