Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperisager committed Oct 2, 2024
1 parent 4279f8c commit 4169a9b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
*/

const resolved = Promise.resolve()
const crashError = err => setImmediate(() => { throw err })

const crash = err => setImmediate(() => { throw err })

global.queueMicrotask = function queueMicrotask (fn) {
resolved
.then(fn)
// Make sure that exceptions are reported as normal uncaughts, not promise
// rejections.
.catch(crashError)
.catch(crash)
}

/**
Expand Down

0 comments on commit 4169a9b

Please sign in to comment.