Skip to content

Commit 562b3d4

Browse files
legendecasRafaelGSS
authored andcommitted
lib: move web global bootstrapping to the expected file
PR-URL: #47881 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Khaidi Chu <[email protected]>
1 parent d623616 commit 562b3d4

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

lib/internal/bootstrap/node.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ const internalTimers = require('internal/timers');
7070
const {
7171
defineOperation,
7272
deprecate,
73-
defineLazyProperties,
7473
} = require('internal/util');
7574
const {
7675
validateInteger,
@@ -208,22 +207,12 @@ internalBinding('async_wrap').setupHooks(nativeHooks);
208207

209208
const {
210209
setupTaskQueue,
211-
queueMicrotask,
212210
} = require('internal/process/task_queues');
213-
214-
// Non-standard extensions:
215-
defineOperation(globalThis, 'queueMicrotask', queueMicrotask);
216-
217211
const timers = require('timers');
212+
// Non-standard extensions:
218213
defineOperation(globalThis, 'clearImmediate', timers.clearImmediate);
219214
defineOperation(globalThis, 'setImmediate', timers.setImmediate);
220215

221-
defineLazyProperties(
222-
globalThis,
223-
'internal/structured_clone',
224-
['structuredClone'],
225-
);
226-
227216
// Set the per-Environment callback that will be called
228217
// when the TrackingTraceStateObserver updates trace state.
229218
// Note that when NODE_USE_V8_PLATFORM is true, the observer is

lib/internal/bootstrap/web/exposed-window-or-worker.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,23 @@ defineOperation(globalThis, 'clearTimeout', timers.clearTimeout);
2626
defineOperation(globalThis, 'setInterval', timers.setInterval);
2727
defineOperation(globalThis, 'setTimeout', timers.setTimeout);
2828

29+
const {
30+
queueMicrotask,
31+
} = require('internal/process/task_queues');
32+
defineOperation(globalThis, 'queueMicrotask', queueMicrotask);
33+
34+
defineLazyProperties(
35+
globalThis,
36+
'internal/structured_clone',
37+
['structuredClone'],
38+
);
39+
defineLazyProperties(globalThis, 'buffer', ['atob', 'btoa']);
40+
2941
// https://html.spec.whatwg.org/multipage/web-messaging.html#broadcasting-to-other-browsing-contexts
3042
exposeLazyInterfaces(globalThis, 'internal/worker/io', ['BroadcastChannel']);
3143
exposeLazyInterfaces(globalThis, 'internal/worker/io', [
3244
'MessageChannel', 'MessagePort', 'MessageEvent',
3345
]);
34-
defineLazyProperties(globalThis, 'buffer', ['atob', 'btoa']);
3546
// https://www.w3.org/TR/FileAPI/#dfn-Blob
3647
exposeLazyInterfaces(globalThis, 'internal/blob', ['Blob']);
3748
// https://www.w3.org/TR/FileAPI/#dfn-file

0 commit comments

Comments
 (0)