Skip to content

Commit cf53ffc

Browse files
hhugoospencer
andauthored
chore!: Require jsoo >= 6.0 (#211)
* update js stubs for jsoo 6 * Change jsoo constraint * fix extra jsoo flag * fix compilation with dev profile * update package.json * restrict jsoo to < 7 --------- Co-authored-by: Oscar Spencer <[email protected]>
1 parent 3e1261e commit cf53ffc

File tree

8 files changed

+28
-25
lines changed

8 files changed

+28
-25
lines changed

binaryen.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ depends: [
1515
"ocaml" {>= "4.13.0"}
1616
"dune" {>= "3.0.0"}
1717
"dune-configurator" {>= "3.0.0"}
18-
"js_of_ocaml-compiler" {>= "4.1.0" < "6.0.0"}
18+
"js_of_ocaml-compiler" {>= "6.0.0" < "7.0.0"}
1919
"libbinaryen" {>= "116.0.0" < "117.0.0"}
2020
]

esy.lock/index.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

esy.lock/opam/js_of_ocaml-compiler.5.9.1/opam renamed to esy.lock/opam/js_of_ocaml-compiler.6.0.1/opam

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"@opam/dune-configurator": ">= 3.0.0"
1212
},
1313
"devDependencies": {
14-
"@opam/js_of_ocaml-compiler": ">= 4.1.0 < 6.0.0",
14+
"@opam/js_of_ocaml-compiler": ">= 6.0.0 < 7.0.0",
1515
"@opam/ocamlformat": "0.24.1",
1616
"@opam/ocaml-lsp-server": ">= 1.9.1 < 1.13.0"
1717
},

src/expression.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,11 +882,12 @@ function caml_binaryen_expression_id_array_len() {
882882

883883
//Provides: caml_binaryen_expression_print
884884
//Requires: Binaryen
885+
//Requires: caml_sys_fds
885886
//Requires: caml_string_of_jsstring
886887
//Requires: caml_ml_output, caml_ml_string_length
887888
function caml_binaryen_expression_print(expr) {
888889
var text = Binaryen.emitText(expr);
889-
var chanid = 1; // stdout
890+
var chanid = caml_sys_fds[1].chanid; // stdout
890891
var s = caml_string_of_jsstring(text);
891892
caml_ml_output(chanid, s, 0, caml_ml_string_length(s));
892893
}

src/module.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,34 @@ function caml_binaryen_module_parse(text) {
1717
}
1818

1919
//Provides: caml_binaryen_module_print
20+
//Requires: caml_sys_fds
2021
//Requires: caml_string_of_jsstring
2122
//Requires: caml_ml_output, caml_ml_string_length
2223
function caml_binaryen_module_print(wasm_mod) {
2324
var text = wasm_mod.emitText();
24-
var chanid = 1; // stdout
25+
var chanid = caml_sys_fds[1].chanid; // stdout
2526
var s = caml_string_of_jsstring(text);
2627
caml_ml_output(chanid, s, 0, caml_ml_string_length(s));
2728
}
2829

2930
//Provides: caml_binaryen_module_print_asmjs
31+
//Requires: caml_sys_fds
3032
//Requires: caml_string_of_jsstring
3133
//Requires: caml_ml_output, caml_ml_string_length
3234
function caml_binaryen_module_print_asmjs(wasm_mod) {
3335
var asm = wasm_mod.emitAsmjs();
34-
var chanid = 1; // stdout
36+
var chanid = caml_sys_fds[1].chanid; // stdout
3537
var s = caml_string_of_jsstring(asm);
3638
caml_ml_output(chanid, s, 0, caml_ml_string_length(s));
3739
}
3840

3941
//Provides: caml_binaryen_module_print_stack_ir
42+
//Requires: caml_sys_fds
4043
//Requires: caml_string_of_jsstring, caml_js_from_bool
4144
//Requires: caml_ml_output, caml_ml_string_length
4245
function caml_binaryen_module_print_stack_ir(wasm_mod, optimize) {
4346
var stackir = wasm_mod.emitStackIR(caml_js_from_bool(optimize));
44-
var chanid = 1; // stdout
47+
var chanid = caml_sys_fds[1].chanid; // stdout
4548
var s = caml_string_of_jsstring(stackir);
4649
caml_ml_output(chanid, s, 0, caml_ml_string_length(s));
4750
}

test/dune

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
(modes exe js)
55
(flags
66
:standard
7-
(:include ./config/ocamlopt_flags.sexp))
8-
(js_of_ocaml))
7+
(:include ./config/ocamlopt_flags.sexp)))
98

109
(rule
1110
(alias runtest)

test/test.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ let add =
8282
let _ = assert (Expression.Block.get_name add = Some "add")
8383

8484
(* Create the add function *)
85-
let adder = Function.add_function wasm_mod "adder" (params ()) results [||] add
85+
let _adder = Function.add_function wasm_mod "adder" (params ()) results [||] add
8686

8787
let call_adder =
8888
Expression.Call_indirect.make wasm_mod "table"

0 commit comments

Comments
 (0)