]> Cypherpunks repositories - gostls13.git/commit
misc/wasm: add scripts for running WebAssembly binaries
authorRichard Musiol <mail@richard-musiol.de>
Sun, 4 Mar 2018 12:53:50 +0000 (13:53 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 30 Mar 2018 05:13:31 +0000 (05:13 +0000)
commitf63250238be548b7c6c24ae840541102a5cfef99
tree155f63136e0826d3adb95b42e39998ecdf66d3b1
parent5cf3b523080ea35a5148c3dc6c8a701305f1f875
misc/wasm: add scripts for running WebAssembly binaries

This commit adds scripts for running the WebAssembly binaries that the
Go compiler will produce.

The script go_js_wasm_exec uses Node.js to run the binaries. Adding it
to PATH will enable "go run" and "go test" to work for js/wasm
without having to manually provide the -exec flag.
See https://golang.org/cmd/go/#hdr-Compile_and_run_Go_program
for more information.

The web page wasm_exec.html is an example on how to run the same
binaries in a web browser.

Both scripts use wasm_exec.js as a shared library.

Updates #18892

Change-Id: Ia4d9bea025957750baa0d0651243dc88f156f85d
Reviewed-on: https://go-review.googlesource.com/103255
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
misc/wasm/go_js_wasm_exec [new file with mode: 0755]
misc/wasm/wasm_exec.html [new file with mode: 0644]
misc/wasm/wasm_exec.js [new file with mode: 0755]