Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from grain-lang/binaryen-js
binaryen.ml.js
- Loading branch information
Showing
29 changed files
with
1,684 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "src/binaryen"] | ||
path = src/binaryen | ||
url = https://github.com/WebAssembly/binaryen | ||
[submodule "js/binaryen.js"] | ||
path = js/binaryen.js | ||
url = https://github.com/AssemblyScript/binaryen.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
(dirs :standard virtual) | ||
(dirs :standard virtual js) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Submodule binaryen.js
added at
aed6e3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(library | ||
(name binaryen_js) | ||
(public_name binaryen.js) | ||
(implements binaryen) | ||
(libraries js_of_ocaml) | ||
(preprocess | ||
(pps js_of_ocaml-ppx)) | ||
(js_of_ocaml | ||
(flags --no-sourcemap) | ||
(javascript_files binaryen.js/index.js postlude.js))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
open Js_of_ocaml.Js | ||
open Js_of_ocaml.Js.Unsafe | ||
|
||
type t | ||
|
||
let add_function_export wasm_mod internal_name external_name = | ||
meth_call wasm_mod "addFunctionExport" | ||
[| inject (string internal_name); inject (string external_name) |] | ||
|
||
let add_table_export wasm_mod internal_name external_name = | ||
meth_call wasm_mod "addTableExport" | ||
[| inject (string internal_name); inject (string external_name) |] | ||
|
||
let add_memory_export wasm_mod internal_name external_name = | ||
meth_call wasm_mod "addMemoryExport" | ||
[| inject (string internal_name); inject (string external_name) |] | ||
|
||
let add_global_export wasm_mod internal_name external_name = | ||
meth_call wasm_mod "addGlobalExport" | ||
[| inject (string internal_name); inject (string external_name) |] | ||
|
||
let remove_export wasm_mod external_name = | ||
meth_call wasm_mod "removeExport" [| inject (string external_name) |] |
Oops, something went wrong.