Skip to content

Commit

Permalink
fix: switching to a microtask as it's a btter and more purposeful usage
Browse files Browse the repository at this point in the history
  • Loading branch information
webark committed Oct 6, 2022
1 parent edf49c5 commit 37ef247
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/parse.js
Expand Up @@ -114,7 +114,7 @@ module.exports = warner(class Parser extends EE {
this[SAW_NULL_BLOCK] = false
this[SAW_EOF] = false

this.on('end', () => setTimeout(() => this.emit('close')))
this.on('end', () => queueMicrotask(() => this.emit('close')))

if (typeof opt.onwarn === 'function') {
this.on('warn', opt.onwarn)
Expand Down

0 comments on commit 37ef247

Please sign in to comment.