( scriptPath: string, scriptArgs: readonly string[], execArgv: readonly string[] = process.execArgv )
| 104 | * and its args. Pure — exported for unit testing. |
| 105 | */ |
| 106 | export function buildRelaunchArgv( |
| 107 | scriptPath: string, |
| 108 | scriptArgs: readonly string[], |
| 109 | execArgv: readonly string[] = process.execArgv |
| 110 | ): string[] { |
| 111 | const preserved = execArgv.filter( |
| 112 | (arg) => !WASM_RUNTIME_FLAGS.includes(arg) && !NODE_RUNTIME_FLAGS.includes(arg) |
| 113 | ); |
| 114 | return [...NODE_RUNTIME_FLAGS, ...WASM_RUNTIME_FLAGS, ...preserved, scriptPath, ...scriptArgs]; |
| 115 | } |
| 116 | |
| 117 | /** |
| 118 | * If the current process is missing the WASM runtime flags, re-exec it once |
no outgoing calls
no test coverage detected