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