diff --git a/binaryen.opam b/binaryen.opam index b97829e8..25033cba 100644 --- a/binaryen.opam +++ b/binaryen.opam @@ -15,6 +15,6 @@ depends: [ "ocaml" {>= "4.13.0"} "dune" {>= "3.0.0"} "dune-configurator" {>= "3.0.0"} - "js_of_ocaml-compiler" {>= "4.1.0" < "6.0.0"} + "js_of_ocaml-compiler" {>= "6.0.0" < "7.0.0"} "libbinaryen" {>= "116.0.0" < "117.0.0"} ] diff --git a/esy.lock/index.json b/esy.lock/index.json index 0b767567..a98378b1 100644 --- a/esy.lock/index.json +++ b/esy.lock/index.json @@ -1,5 +1,5 @@ { - "checksum": "ad7ec1c1f18f2da0d805bf4ce5a7f697", + "checksum": "027362814c85d00422b9f9ff4957739b", "root": "@grain/binaryen.ml@link-dev:./package.json", "node": { "ocaml@4.14.1000@d41d8cd9": { @@ -1039,20 +1039,20 @@ ], "available": "true" }, - "@opam/js_of_ocaml-compiler@opam:5.9.1@e8650b39": { - "id": "@opam/js_of_ocaml-compiler@opam:5.9.1@e8650b39", + "@opam/js_of_ocaml-compiler@opam:6.0.1@ac2ae2e8": { + "id": "@opam/js_of_ocaml-compiler@opam:6.0.1@ac2ae2e8", "name": "@opam/js_of_ocaml-compiler", - "version": "opam:5.9.1", + "version": "opam:6.0.1", "source": { "type": "install", "source": [ - "archive:https://opam.ocaml.org/cache/sha256/68/68c95c60871d8e9c9a54c82f35e2ed50413bcb440f220d0b3516b2a1ee1c7307#sha256:68c95c60871d8e9c9a54c82f35e2ed50413bcb440f220d0b3516b2a1ee1c7307", - "archive:https://github.com/ocsigen/js_of_ocaml/releases/download/5.9.1/js_of_ocaml-5.9.1.tbz#sha256:68c95c60871d8e9c9a54c82f35e2ed50413bcb440f220d0b3516b2a1ee1c7307" + "archive:https://opam.ocaml.org/cache/sha256/81/813dbee2b62e1541049ea23a20e405cf244e27ebfa9859785cfa53e286d2c614#sha256:813dbee2b62e1541049ea23a20e405cf244e27ebfa9859785cfa53e286d2c614", + "archive:https://github.com/ocsigen/js_of_ocaml/releases/download/6.0.1/js_of_ocaml-6.0.1.tbz#sha256:813dbee2b62e1541049ea23a20e405cf244e27ebfa9859785cfa53e286d2c614" ], "opam": { "name": "js_of_ocaml-compiler", - "version": "5.9.1", - "path": "esy.lock/opam/js_of_ocaml-compiler.5.9.1" + "version": "6.0.1", + "path": "esy.lock/opam/js_of_ocaml-compiler.6.0.1" } }, "overrides": [], @@ -1648,7 +1648,7 @@ "devDependencies": [ "@opam/ocamlformat@opam:0.24.1@01d7df0f", "@opam/ocaml-lsp-server@opam:1.12.4@c24ab770", - "@opam/js_of_ocaml-compiler@opam:5.9.1@e8650b39" + "@opam/js_of_ocaml-compiler@opam:6.0.1@ac2ae2e8" ] }, "@esy-ocaml/substs@0.0.1@d41d8cd9": { diff --git a/esy.lock/opam/js_of_ocaml-compiler.5.9.1/opam b/esy.lock/opam/js_of_ocaml-compiler.6.0.1/opam similarity index 72% rename from esy.lock/opam/js_of_ocaml-compiler.5.9.1/opam rename to esy.lock/opam/js_of_ocaml-compiler.6.0.1/opam index 89af4b17..ed835fe8 100644 --- a/esy.lock/opam/js_of_ocaml-compiler.5.9.1/opam +++ b/esy.lock/opam/js_of_ocaml-compiler.6.0.1/opam @@ -11,10 +11,10 @@ homepage: "https://ocsigen.org/js_of_ocaml/latest/manual/overview" doc: "https://ocsigen.org/js_of_ocaml/latest/manual/overview" bug-reports: "https://github.com/ocsigen/js_of_ocaml/issues" depends: [ - "dune" {>= "3.15"} + "dune" {>= "3.17"} "ocaml" {>= "4.08" & < "5.4"} "num" {with-test} - "ppx_expect" {>= "v0.14.2" & with-test} + "ppx_expect" {>= "v0.16.1" & with-test} "ppxlib" {>= "0.15.0" & < "0.36.0"} "re" {with-test} "cmdliner" {>= "1.1.0"} @@ -23,7 +23,7 @@ depends: [ "menhir" "menhirLib" "menhirSdk" - "yojson" {>= "1.6"} + "yojson" {>= "2.1"} "odoc" {with-doc} ] depopts: ["ocamlfind"] @@ -47,10 +47,10 @@ build: [ ] url { src: - "https://github.com/ocsigen/js_of_ocaml/releases/download/5.9.1/js_of_ocaml-5.9.1.tbz" + "https://github.com/ocsigen/js_of_ocaml/releases/download/6.0.1/js_of_ocaml-6.0.1.tbz" checksum: [ - "sha256=68c95c60871d8e9c9a54c82f35e2ed50413bcb440f220d0b3516b2a1ee1c7307" - "sha512=288d68ea7a45e92375cf51c34bb1071dd26d0d8de54883f3422639561e1494ff43aa45c3d7466627fd7b5a9bb29a0c75e5744a3e7147f5d544bf2c5414083778" + "sha256=813dbee2b62e1541049ea23a20e405cf244e27ebfa9859785cfa53e286d2c614" + "sha512=194ae5d1122171fa8253b6a41438a2fc330caf4ab6dd008fcce1253fd51fbe4b1149813da6075c5deb52ea136143def57c83c3f4e32421803d7699648fdc563b" ] } -x-commit-hash: "a02342914f3221a298730d61537cc0d939ccb6e0" +x-commit-hash: "b6d60e4f8ff35e7c7b3bb52b97ffedc3eb8e3d08" diff --git a/package.json b/package.json index 69a9bb85..a042d0e8 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "@opam/dune-configurator": ">= 3.0.0" }, "devDependencies": { - "@opam/js_of_ocaml-compiler": ">= 4.1.0 < 6.0.0", + "@opam/js_of_ocaml-compiler": ">= 6.0.0 < 7.0.0", "@opam/ocamlformat": "0.24.1", "@opam/ocaml-lsp-server": ">= 1.9.1 < 1.13.0" }, diff --git a/src/expression.js b/src/expression.js index 50dc0da1..fa8c8332 100644 --- a/src/expression.js +++ b/src/expression.js @@ -882,11 +882,12 @@ function caml_binaryen_expression_id_array_len() { //Provides: caml_binaryen_expression_print //Requires: Binaryen +//Requires: caml_sys_fds //Requires: caml_string_of_jsstring //Requires: caml_ml_output, caml_ml_string_length function caml_binaryen_expression_print(expr) { var text = Binaryen.emitText(expr); - var chanid = 1; // stdout + var chanid = caml_sys_fds[1].chanid; // stdout var s = caml_string_of_jsstring(text); caml_ml_output(chanid, s, 0, caml_ml_string_length(s)); } diff --git a/src/module.js b/src/module.js index 4c344679..dbe0492d 100644 --- a/src/module.js +++ b/src/module.js @@ -17,31 +17,34 @@ function caml_binaryen_module_parse(text) { } //Provides: caml_binaryen_module_print +//Requires: caml_sys_fds //Requires: caml_string_of_jsstring //Requires: caml_ml_output, caml_ml_string_length function caml_binaryen_module_print(wasm_mod) { var text = wasm_mod.emitText(); - var chanid = 1; // stdout + var chanid = caml_sys_fds[1].chanid; // stdout var s = caml_string_of_jsstring(text); caml_ml_output(chanid, s, 0, caml_ml_string_length(s)); } //Provides: caml_binaryen_module_print_asmjs +//Requires: caml_sys_fds //Requires: caml_string_of_jsstring //Requires: caml_ml_output, caml_ml_string_length function caml_binaryen_module_print_asmjs(wasm_mod) { var asm = wasm_mod.emitAsmjs(); - var chanid = 1; // stdout + var chanid = caml_sys_fds[1].chanid; // stdout var s = caml_string_of_jsstring(asm); caml_ml_output(chanid, s, 0, caml_ml_string_length(s)); } //Provides: caml_binaryen_module_print_stack_ir +//Requires: caml_sys_fds //Requires: caml_string_of_jsstring, caml_js_from_bool //Requires: caml_ml_output, caml_ml_string_length function caml_binaryen_module_print_stack_ir(wasm_mod, optimize) { var stackir = wasm_mod.emitStackIR(caml_js_from_bool(optimize)); - var chanid = 1; // stdout + var chanid = caml_sys_fds[1].chanid; // stdout var s = caml_string_of_jsstring(stackir); caml_ml_output(chanid, s, 0, caml_ml_string_length(s)); } diff --git a/test/dune b/test/dune index e9f7192b..e391294b 100644 --- a/test/dune +++ b/test/dune @@ -4,8 +4,7 @@ (modes exe js) (flags :standard - (:include ./config/ocamlopt_flags.sexp)) - (js_of_ocaml)) + (:include ./config/ocamlopt_flags.sexp))) (rule (alias runtest) diff --git a/test/test.ml b/test/test.ml index 55e949e9..e0339e08 100644 --- a/test/test.ml +++ b/test/test.ml @@ -82,7 +82,7 @@ let add = let _ = assert (Expression.Block.get_name add = Some "add") (* Create the add function *) -let adder = Function.add_function wasm_mod "adder" (params ()) results [||] add +let _adder = Function.add_function wasm_mod "adder" (params ()) results [||] add let call_adder = Expression.Call_indirect.make wasm_mod "table"