(options)
| 103 | } |
| 104 | |
| 105 | function prepareExecution(options) { |
| 106 | const { expandArgv1, initializeModules, isMainThread, shouldSpawnLoaderHookWorker, shouldPreloadModules } = options; |
| 107 | |
| 108 | refreshRuntimeOptions(); |
| 109 | |
| 110 | // Patch the process object and get the resolved main entry point. |
| 111 | const mainEntry = patchProcessObject(expandArgv1); |
| 112 | setupTraceCategoryState(); |
| 113 | setupInspectorHooks(); |
| 114 | setupNetworkInspection(); |
| 115 | setupNavigator(); |
| 116 | setupWarningHandler(); |
| 117 | setupFFI(); |
| 118 | setupSQLite(); |
| 119 | setupStreamIter(); |
| 120 | setupVfs(); |
| 121 | setupQuic(); |
| 122 | setupWebStorage(); |
| 123 | setupWebsocket(); |
| 124 | setupEventsource(); |
| 125 | setupCodeCoverage(); |
| 126 | setupDebugEnv(); |
| 127 | // Process initial diagnostic reporting configuration, if present. |
| 128 | initializeReport(); |
| 129 | |
| 130 | setupDiagnosticsChannel(); |
| 131 | |
| 132 | // Load permission system API |
| 133 | initializePermission(); |
| 134 | |
| 135 | initializeSourceMapsHandlers(); |
| 136 | initializeDeprecations(); |
| 137 | |
| 138 | initializeConfigFileSupport(); |
| 139 | |
| 140 | require('internal/dns/utils').initializeDns(); |
| 141 | |
| 142 | if (isMainThread) { |
| 143 | assert(internalBinding('worker').isMainThread); |
| 144 | // Worker threads will get the manifest in the message handler. |
| 145 | |
| 146 | // Print stack trace on `SIGINT` if option `--trace-sigint` presents. |
| 147 | setupStacktracePrinterOnSigint(); |
| 148 | initializeReportSignalHandlers(); // Main-thread-only. |
| 149 | initializeHeapSnapshotSignalHandlers(); |
| 150 | // If the process is spawned with env NODE_CHANNEL_FD, it's probably |
| 151 | // spawned by our child_process module, then initialize IPC. |
| 152 | // This attaches some internal event listeners and creates: |
| 153 | // process.send(), process.channel, process.connected, |
| 154 | // process.disconnect(). |
| 155 | setupChildProcessIpcChannel(); |
| 156 | // If this is a worker in cluster mode, start up the communication |
| 157 | // channel. This needs to be done before any user code gets executed |
| 158 | // (including preload modules). |
| 159 | initializeClusterIPC(); |
| 160 | |
| 161 | // TODO(joyeecheung): do this for worker threads as well. |
| 162 | runDeserializeCallbacks(); |
no test coverage detected
searching dependent graphs…