diff --git a/crates/cli/src/bin/wasm2es6js.rs b/crates/cli/src/bin/wasm2es6js.rs index 9ff83202..2acec434 100644 --- a/crates/cli/src/bin/wasm2es6js.rs +++ b/crates/cli/src/bin/wasm2es6js.rs @@ -24,7 +24,7 @@ Options: --typescript Output a `*.d.ts` file next to the JS output --base64 Inline the wasm module using base64 encoding --fetch PATH Load module by passing the PATH argument to `fetch()` - --wasm2asm Convert wasm to asm.js and don't use `WebAssembly` + --wasm2js Convert wasm to javascript and don't use `WebAssembly` Note that this is not intended to produce a production-ready output module but rather is intended purely as a temporary \"hack\" until it's standard in @@ -36,7 +36,7 @@ struct Args { flag_output: Option, flag_typescript: bool, flag_base64: bool, - flag_wasm2asm: bool, + flag_wasm2js: bool, flag_fetch: Option, arg_input: PathBuf, } @@ -62,7 +62,7 @@ fn rmain(args: &Args) -> Result<(), Error> { let object = wasm_bindgen_cli_support::wasm2es6js::Config::new() .base64(args.flag_base64) - .wasm2asm(args.flag_wasm2asm) + .wasm2js(args.flag_wasm2js) .fetch(args.flag_fetch.clone()) .generate(&wasm)?; diff --git a/examples/README.md b/examples/README.md index 05084ced..f4467e5b 100644 --- a/examples/README.md +++ b/examples/README.md @@ -12,7 +12,7 @@ The examples here are: * `add` - an example of generating a tiny wasm binary, one that only adds two numbers. -* `asm.js` - an example of using the `wasm2asm` tool from [binaryen] to convert +* `asm.js` - an example of using the `wasm2js` tool from [binaryen] to convert the generated WebAssembly to normal JS * `char` - an example of passing the rust `char` type to and from the js `string` type * `closures` - an example of how to invoke functions like `setInterval` or use diff --git a/examples/asm.js/README.md b/examples/asm.js/README.md index eb6bfbb9..9030ee5c 100644 --- a/examples/asm.js/README.md +++ b/examples/asm.js/README.md @@ -1,6 +1,6 @@ # WebAssembly to asm.js -This directory is an example of using [binaryen]'s `wasm2asm` tool to convert +This directory is an example of using [binaryen]'s `wasm2js` tool to convert the wasm output of `wasm-bindgen` to a normal JS file that can be executed like asm.js. @@ -14,9 +14,9 @@ When opened in a web browser this should print "Hello, World!" to the console. This example uses the `wasm2es6js` tool to convert the wasm file to an ES module that's implemented with asm.js instead of WebAssembly. The conversion to asm.js -is done by [binaryen]'s `wasm2asm` tool internally. +is done by [binaryen]'s `wasm2js` tool internally. -Note that the `wasm2asm` tool is still pretty early days so there's likely to be +Note that the `wasm2js` tool is still pretty early days so there's likely to be a number of bugs to run into or work around. If any are encountered though please feel free to report them upstream! diff --git a/examples/asm.js/build.sh b/examples/asm.js/build.sh index 980fd68e..ee7454ef 100755 --- a/examples/asm.js/build.sh +++ b/examples/asm.js/build.sh @@ -6,17 +6,17 @@ set -ex cargo +nightly build --target wasm32-unknown-unknown --release # Run wasm-bindgen, and note that the `--no-demangle` argument is here is -# important for compatibility with wasm2asm! +# important for compatibility with wasm2js! cargo +nightly run --manifest-path ../../crates/cli/Cargo.toml \ --bin wasm-bindgen -- \ --no-demangle \ ../../target/wasm32-unknown-unknown/release/asmjs.wasm --out-dir . -# Run the `wasm2es6js` primarily with the `--wasm2asm` flag, which will -# internally execute `wasm2asm` as necessary +# Run the `wasm2es6js` primarily with the `--wasm2js` flag, which will +# internally execute `wasm2js` as necessary cargo +nightly run --manifest-path ../../crates/cli/Cargo.toml \ --bin wasm2es6js -- \ - asmjs_bg.wasm --wasm2asm -o asmjs_bg.js + asmjs_bg.wasm --wasm2js -o asmjs_bg.js # Move our original wasm out of the way to avoid cofusing Webpack. mv asmjs_bg.wasm asmjs_bg.bak.wasm