From ea8000f1195801cf602946c6bd85b8b5dbe83d43 Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Sun, 23 Sep 2018 22:22:34 -0500 Subject: [PATCH] lib: lazy load internal/queue_microtask PR-URL: https://github.com/nodejs/node/pull/23046 Reviewed-By: Colin Ihrig Reviewed-By: Rich Trott Reviewed-By: John-David Dalton Reviewed-By: Gireesh Punathil --- lib/internal/bootstrap/node.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index e1c56e9b7e6679..bcbb96a87fa598 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -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,