Skip to content

Commit 802e9ca

Browse files
committed
lib: move web global bootstrapping to the expected file
1 parent 3d00354 commit 802e9ca

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

lib/internal/bootstrap/node.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -208,22 +208,12 @@ internalBinding('async_wrap').setupHooks(nativeHooks);
208208

209209
const {
210210
setupTaskQueue,
211-
queueMicrotask,
212211
} = require('internal/process/task_queues');
213-
214-
// Non-standard extensions:
215-
defineOperation(globalThis, 'queueMicrotask', queueMicrotask);
216-
217212
const timers = require('timers');
213+
// Non-standard extensions:
218214
defineOperation(globalThis, 'clearImmediate', timers.clearImmediate);
219215
defineOperation(globalThis, 'setImmediate', timers.setImmediate);
220216

221-
defineLazyProperties(
222-
globalThis,
223-
'internal/structured_clone',
224-
['structuredClone'],
225-
);
226-
227217
// Set the per-Environment callback that will be called
228218
// when the TrackingTraceStateObserver updates trace state.
229219
// 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)