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