Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion binaryen.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
]
18 changes: 9 additions & 9 deletions esy.lock/index.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
3 changes: 2 additions & 1 deletion src/expression.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
9 changes: 6 additions & 3 deletions src/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
3 changes: 1 addition & 2 deletions test/dune
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down