main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
461 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | /*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
|
---|
| 2 |
|
---|
| 3 | if (!globalThis.DOMException) {
|
---|
| 4 | try {
|
---|
| 5 | const { MessageChannel } = require('worker_threads'),
|
---|
| 6 | port = new MessageChannel().port1,
|
---|
| 7 | ab = new ArrayBuffer()
|
---|
| 8 | port.postMessage(ab, [ab, ab])
|
---|
| 9 | } catch (err) {
|
---|
| 10 | err.constructor.name === 'DOMException' && (
|
---|
| 11 | globalThis.DOMException = err.constructor
|
---|
| 12 | )
|
---|
| 13 | }
|
---|
| 14 | }
|
---|
| 15 |
|
---|
| 16 | module.exports = globalThis.DOMException
|
---|
Note:
See
TracBrowser
for help on using the repository browser.