node-domexception/.history/index_20210527214034.js
raw| 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 |