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 <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
  • 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.