Skip to content

Commit

Permalink
lib: lazy load internal/queue_microtask
Browse files Browse the repository at this point in the history
PR-URL: #23046
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: John-David Dalton <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
  • Loading branch information
devsnek committed Sep 24, 2018
1 parent 7dde560 commit ea8000f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/internal/bootstrap/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -529,11 +529,12 @@
}

function setupQueueMicrotask() {
const { queueMicrotask } = NativeModule.require('internal/queue_microtask');
Object.defineProperty(global, 'queueMicrotask', {
get: () => {
process.emitWarning('queueMicrotask() is experimental.',
'ExperimentalWarning');
const { queueMicrotask } =
NativeModule.require('internal/queue_microtask');
Object.defineProperty(global, 'queueMicrotask', {
value: queueMicrotask,
writable: true,
Expand Down

0 comments on commit ea8000f

Please sign in to comment.