GeezerVison is showing github.com — lib: move web global bootstrapping to the expected file · nodejs/node@562b3d4
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: lib/internal/bootstrap/node.js +1-12Lines changed: 1 addition & 12 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -70,7 +70,6 @@ const internalTimers = require('internal/timers'); | 70 | 70 | const { | 71 | 71 | defineOperation, | 72 | 72 | deprecate, | 73 | | - defineLazyProperties, | 74 | 73 | } = require('internal/util'); | 75 | 74 | const { | 76 | 75 | validateInteger, | @@ -208,22 +207,12 @@ internalBinding('async_wrap').setupHooks(nativeHooks); | 208 | 207 |
| 209 | 208 | const { | 210 | 209 | setupTaskQueue, | 211 | | - queueMicrotask, | 212 | 210 | } = require('internal/process/task_queues'); | 213 | | - | 214 | | -// Non-standard extensions: | 215 | | -defineOperation(globalThis, 'queueMicrotask', queueMicrotask); | 216 | | - | 217 | 211 | const timers = require('timers'); | | 212 | +// Non-standard extensions: | 218 | 213 | defineOperation(globalThis, 'clearImmediate', timers.clearImmediate); | 219 | 214 | defineOperation(globalThis, 'setImmediate', timers.setImmediate); | 220 | 215 |
| 221 | | -defineLazyProperties( | 222 | | - globalThis, | 223 | | - 'internal/structured_clone', | 224 | | - ['structuredClone'], | 225 | | -); | 226 | | - | 227 | 216 | // Set the per-Environment callback that will be called | 228 | 217 | // when the TrackingTraceStateObserver updates trace state. | 229 | 218 | // Note that when NODE_USE_V8_PLATFORM is true, the observer is | |
Collapse file Copy file name to clipboardExpand all lines: lib/internal/bootstrap/web/exposed-window-or-worker.js +12-1Lines changed: 12 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -26,12 +26,23 @@ defineOperation(globalThis, 'clearTimeout', timers.clearTimeout); | 26 | 26 | defineOperation(globalThis, 'setInterval', timers.setInterval); | 27 | 27 | defineOperation(globalThis, 'setTimeout', timers.setTimeout); | 28 | 28 |
| | 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 | + | 29 | 41 | // https://html.spec.whatwg.org/multipage/web-messaging.html#broadcasting-to-other-browsing-contexts | 30 | 42 | exposeLazyInterfaces(globalThis, 'internal/worker/io', ['BroadcastChannel']); | 31 | 43 | exposeLazyInterfaces(globalThis, 'internal/worker/io', [ | 32 | 44 | 'MessageChannel', 'MessagePort', 'MessageEvent', | 33 | 45 | ]); | 34 | | -defineLazyProperties(globalThis, 'buffer', ['atob', 'btoa']); | 35 | 46 | // https://www.w3.org/TR/FileAPI/#dfn-Blob | 36 | 47 | exposeLazyInterfaces(globalThis, 'internal/blob', ['Blob']); | 37 | 48 | // https://www.w3.org/TR/FileAPI/#dfn-file | |
|