Skip to content

Commit 456adf5

Browse files
committed
Node wrapper: support for d8, sm, and jsc
1 parent ba80fc5 commit 456adf5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/node_wrapper.ml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ let wasm_file file =
4848

4949
let common_args file argv = environment_args () @ (wasm_file file :: List.tl argv)
5050

51+
let shell_cmd cmd argv =
52+
let script = List.hd argv in
53+
Unix.chdir (Filename.dirname script);
54+
cmd, Filename.basename script :: "--" :: List.tl argv
55+
5156
let exe, args =
5257
match Array.to_list Sys.argv with
5358
| exe :: argv ->
@@ -59,6 +64,7 @@ let exe, args =
5964
| "wizard-fast" -> "wizeng.x86-64-linux", wizard_args @ common_args file argv
6065
| "wasmtime" -> "wasmtime", wasmtime_args @ common_args file argv
6166
| "wasmedge" -> "wasmedge", wasmedge_args @ common_args file argv
67+
| ("jsc" | "d8" | "sm") as cmd -> shell_cmd cmd argv
6268
| _ -> "node", extra_args_for_wasoo @ argv)
6369
| _ -> "node", extra_args_for_jsoo @ argv
6470
in

0 commit comments

Comments
 (0)