| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e0e09ca commit 1a499c5
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 | |
|---|---|---|---|
@@ -14,7 +14,6 @@ const { | |||
| 14 | 14 | ||
| 15 | 15 | const { | |
| 16 | 16 | getOptionValue, | |
| 17 | - getEmbedderOptions, | ||
| 18 | 17 | refreshOptions, | |
| 19 | 18 | } = require('internal/options'); | |
| 20 | 19 | const { reconnectZeroFillToggle } = require('internal/buffer'); | |
@@ -74,6 +73,7 @@ function prepareExecution(options) { | |||
| 74 | 73 | initializeReport(); | |
| 75 | 74 | initializeSourceMapsHandlers(); | |
| 76 | 75 | initializeDeprecations(); | |
| 76 | + | ||
| 77 | 77 | require('internal/dns/utils').initializeDns(); | |
| 78 | 78 | ||
| 79 | 79 | setupSymbolDisposePolyfill(); | |
@@ -266,8 +266,9 @@ function setupFetch() { | |||
| 266 | 266 | }); | |
| 267 | 267 | ||
| 268 | 268 | // The WebAssembly Web API: https://webassembly.github.io/spec/web-api | |
| 269 | - const { wasmStreamingCallback } = require('internal/wasm_web_api'); | ||
| 270 | - internalBinding('wasm_web_api').setImplementation(wasmStreamingCallback); | ||
| 269 | + internalBinding('wasm_web_api').setImplementation((streamState, source) => { | ||
| 270 | + require('internal/wasm_web_api').wasmStreamingCallback(streamState, source); | ||
| 271 | + }); | ||
| 271 | 272 | } | |
| 272 | 273 | ||
| 273 | 274 | // TODO(aduh95): move this to internal/bootstrap/browser when the CLI flag is | |
@@ -324,12 +325,12 @@ function setupStacktracePrinterOnSigint() { | |||
| 324 | 325 | } | |
| 325 | 326 | ||
| 326 | 327 | function initializeReport() { | |
| 327 | - const { report } = require('internal/process/report'); | ||
| 328 | 328 | ObjectDefineProperty(process, 'report', { | |
| 329 | 329 | __proto__: null, | |
| 330 | 330 | enumerable: true, | |
| 331 | 331 | configurable: true, | |
| 332 | 332 | get() { | |
| 333 | + const { report } = require('internal/process/report'); | ||
| 333 | 334 | return report; | |
| 334 | 335 | }, | |
| 335 | 336 | }); | |
@@ -344,9 +345,10 @@ function setupDebugEnv() { | |||
| 344 | 345 | ||
| 345 | 346 | // This has to be called after initializeReport() is called | |
| 346 | 347 | function initializeReportSignalHandlers() { | |
| 347 | - const { addSignalHandler } = require('internal/process/report'); | ||
| 348 | - | ||
| 349 | - addSignalHandler(); | ||
| 348 | + if (getOptionValue('--report-on-signal')) { | ||
| 349 | + const { addSignalHandler } = require('internal/process/report'); | ||
| 350 | + addSignalHandler(); | ||
| 351 | + } | ||
| 350 | 352 | } | |
| 351 | 353 | ||
| 352 | 354 | function initializeHeapSnapshotSignalHandlers() { | |
@@ -545,8 +547,6 @@ function initializeCJSLoader() { | |||
| 545 | 547 | } | |
| 546 | 548 | ||
| 547 | 549 | function initializeESMLoader() { | |
| 548 | - if (getEmbedderOptions().shouldNotRegisterESMLoader) return; | ||
| 549 | - | ||
| 550 | 550 | const { initializeESM } = require('internal/modules/esm/utils'); | |
| 551 | 551 | initializeESM(); | |
| 552 | 552 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,7 +24,6 @@ const expectedModules = new Set([ | |||
| 24 | 24 | 'Internal Binding options', | |
| 25 | 25 | 'Internal Binding performance', | |
| 26 | 26 | 'Internal Binding process_methods', | |
| 27 | - 'Internal Binding report', | ||
| 28 | 27 | 'Internal Binding string_decoder', | |
| 29 | 28 | 'Internal Binding symbols', | |
| 30 | 29 | 'Internal Binding task_queue', | |
@@ -64,7 +63,6 @@ const expectedModules = new Set([ | |||
| 64 | 63 | 'NativeModule internal/process/per_thread', | |
| 65 | 64 | 'NativeModule internal/process/pre_execution', | |
| 66 | 65 | 'NativeModule internal/process/promises', | |
| 67 | - 'NativeModule internal/process/report', | ||
| 68 | 66 | 'NativeModule internal/process/signal', | |
| 69 | 67 | 'NativeModule internal/process/task_queues', | |
| 70 | 68 | 'NativeModule internal/process/warning', | |
@@ -79,7 +77,6 @@ const expectedModules = new Set([ | |||
| 79 | 77 | 'NativeModule internal/validators', | |
| 80 | 78 | 'NativeModule internal/vm', | |
| 81 | 79 | 'NativeModule internal/vm/module', | |
| 82 | - 'NativeModule internal/wasm_web_api', | ||
| 83 | 80 | 'NativeModule internal/webidl', | |
| 84 | 81 | 'NativeModule internal/worker/js_transferable', | |
| 85 | 82 | 'Internal Binding blob', | |
| Back | FazBrowse Home | New Git URL |
0 commit comments