| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d181b76 commit 6e3d7f8
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -286,3 +286,32 @@ rawMethods.resetStdioForTesting = function() { | |||
| 286 | 286 | stdout = undefined; | |
| 287 | 287 | stderr = undefined; | |
| 288 | 288 | }; | |
| 289 | + | ||
| 290 | + // Needed by the module loader and generally needed everywhere. | ||
| 291 | + require('fs'); | ||
| 292 | + require('util'); | ||
| 293 | + require('url'); | ||
| 294 | + | ||
| 295 | + require('internal/modules/cjs/loader'); | ||
| 296 | + require('internal/modules/esm/utils'); | ||
| 297 | + require('internal/vm/module'); | ||
| 298 | + // Needed to refresh the time origin. | ||
| 299 | + require('internal/perf/utils'); | ||
| 300 | + // Needed to register the async hooks. | ||
| 301 | + if (internalBinding('config').hasInspector) { | ||
| 302 | + require('internal/inspector_async_hook'); | ||
| 303 | + } | ||
| 304 | + // Needed to set the wasm web API callbacks. | ||
| 305 | + internalBinding('wasm_web_api'); | ||
| 306 | + // Needed to detect whether it's on main thread. | ||
| 307 | + internalBinding('worker'); | ||
| 308 | + // Needed to setup source maps. | ||
| 309 | + require('internal/source_map/source_map_cache'); | ||
| 310 | + // Needed by most execution modes. | ||
| 311 | + require('internal/modules/run_main'); | ||
| 312 | + // Needed to refresh DNS configurations. | ||
| 313 | + require('internal/dns/utils'); | ||
| 314 | + // Needed by almost all execution modes. It's fine to | ||
| 315 | + // load them into the snapshot as long as we don't run | ||
| 316 | + // any of the initialization. | ||
| 317 | + require('internal/process/pre_execution'); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,6 @@ const { | |||
| 12 | 12 | ||
| 13 | 13 | const { | |
| 14 | 14 | getOptionValue, | |
| 15 | - getEmbedderOptions, | ||
| 16 | 15 | refreshOptions, | |
| 17 | 16 | } = require('internal/options'); | |
| 18 | 17 | const { reconnectZeroFillToggle } = require('internal/buffer'); | |
@@ -81,6 +80,7 @@ function prepareExecution(options) { | |||
| 81 | 80 | initializeSourceMapsHandlers(); | |
| 82 | 81 | initializeDeprecations(); | |
| 83 | 82 | initializeWASI(); | |
| 83 | + | ||
| 84 | 84 | require('internal/dns/utils').initializeDns(); | |
| 85 | 85 | ||
| 86 | 86 | if (isMainThread) { | |
@@ -263,8 +263,9 @@ function setupFetch() { | |||
| 263 | 263 | }); | |
| 264 | 264 | ||
| 265 | 265 | // The WebAssembly Web API: https://webassembly.github.io/spec/web-api | |
| 266 | - const { wasmStreamingCallback } = require('internal/wasm_web_api'); | ||
| 267 | - internalBinding('wasm_web_api').setImplementation(wasmStreamingCallback); | ||
| 266 | + internalBinding('wasm_web_api').setImplementation((streamState, source) => { | ||
| 267 | + require('internal/wasm_web_api').wasmStreamingCallback(streamState, source); | ||
| 268 | + }); | ||
| 268 | 269 | } | |
| 269 | 270 | ||
| 270 | 271 | // TODO(aduh95): move this to internal/bootstrap/browser when the CLI flag is | |
@@ -337,12 +338,12 @@ function setupStacktracePrinterOnSigint() { | |||
| 337 | 338 | } | |
| 338 | 339 | ||
| 339 | 340 | function initializeReport() { | |
| 340 | - const { report } = require('internal/process/report'); | ||
| 341 | 341 | ObjectDefineProperty(process, 'report', { | |
| 342 | 342 | __proto__: null, | |
| 343 | 343 | enumerable: true, | |
| 344 | 344 | configurable: true, | |
| 345 | 345 | get() { | |
| 346 | + const { report } = require('internal/process/report'); | ||
| 346 | 347 | return report; | |
| 347 | 348 | } | |
| 348 | 349 | }); | |
@@ -357,9 +358,10 @@ function setupDebugEnv() { | |||
| 357 | 358 | ||
| 358 | 359 | // This has to be called after initializeReport() is called | |
| 359 | 360 | function initializeReportSignalHandlers() { | |
| 360 | - const { addSignalHandler } = require('internal/process/report'); | ||
| 361 | - | ||
| 362 | - addSignalHandler(); | ||
| 361 | + if (getOptionValue('--report-on-signal')) { | ||
| 362 | + const { addSignalHandler } = require('internal/process/report'); | ||
| 363 | + addSignalHandler(); | ||
| 364 | + } | ||
| 363 | 365 | } | |
| 364 | 366 | ||
| 365 | 367 | function initializeHeapSnapshotSignalHandlers() { | |
@@ -565,8 +567,6 @@ function initializeCJSLoader() { | |||
| 565 | 567 | } | |
| 566 | 568 | ||
| 567 | 569 | function initializeESMLoader() { | |
| 568 | - if (getEmbedderOptions().shouldNotRegisterESMLoader) return; | ||
| 569 | - | ||
| 570 | 570 | const { initializeESM } = require('internal/modules/esm/utils'); | |
| 571 | 571 | initializeESM(); | |
| 572 | 572 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,7 +25,6 @@ const expectedModules = new Set([ | |||
| 25 | 25 | 'Internal Binding options', | |
| 26 | 26 | 'Internal Binding performance', | |
| 27 | 27 | 'Internal Binding process_methods', | |
| 28 | - 'Internal Binding report', | ||
| 29 | 28 | 'Internal Binding string_decoder', | |
| 30 | 29 | 'Internal Binding symbols', | |
| 31 | 30 | 'Internal Binding task_queue', | |
@@ -66,7 +65,6 @@ const expectedModules = new Set([ | |||
| 66 | 65 | 'NativeModule internal/process/per_thread', | |
| 67 | 66 | 'NativeModule internal/process/pre_execution', | |
| 68 | 67 | 'NativeModule internal/process/promises', | |
| 69 | - 'NativeModule internal/process/report', | ||
| 70 | 68 | 'NativeModule internal/process/signal', | |
| 71 | 69 | 'NativeModule internal/process/task_queues', | |
| 72 | 70 | 'NativeModule internal/process/warning', | |
@@ -82,7 +80,6 @@ const expectedModules = new Set([ | |||
| 82 | 80 | 'NativeModule internal/validators', | |
| 83 | 81 | 'NativeModule internal/vm', | |
| 84 | 82 | 'NativeModule internal/vm/module', | |
| 85 | - 'NativeModule internal/wasm_web_api', | ||
| 86 | 83 | 'NativeModule internal/worker/js_transferable', | |
| 87 | 84 | 'NativeModule path', | |
| 88 | 85 | 'NativeModule querystring', | |
| Back | FazBrowse Home | New Git URL |
0 commit comments