Fix some references I missed

This commit is contained in:
Bradlee Speice
2018-09-02 22:32:19 -04:00
parent 724eb53d3c
commit c69833f253
4 changed files with 11 additions and 11 deletions

View File

@ -24,7 +24,7 @@ Options:
--typescript Output a `*.d.ts` file next to the JS output --typescript Output a `*.d.ts` file next to the JS output
--base64 Inline the wasm module using base64 encoding --base64 Inline the wasm module using base64 encoding
--fetch PATH Load module by passing the PATH argument to `fetch()` --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 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 but rather is intended purely as a temporary \"hack\" until it's standard in
@ -36,7 +36,7 @@ struct Args {
flag_output: Option<PathBuf>, flag_output: Option<PathBuf>,
flag_typescript: bool, flag_typescript: bool,
flag_base64: bool, flag_base64: bool,
flag_wasm2asm: bool, flag_wasm2js: bool,
flag_fetch: Option<String>, flag_fetch: Option<String>,
arg_input: PathBuf, arg_input: PathBuf,
} }
@ -62,7 +62,7 @@ fn rmain(args: &Args) -> Result<(), Error> {
let object = wasm_bindgen_cli_support::wasm2es6js::Config::new() let object = wasm_bindgen_cli_support::wasm2es6js::Config::new()
.base64(args.flag_base64) .base64(args.flag_base64)
.wasm2asm(args.flag_wasm2asm) .wasm2js(args.flag_wasm2js)
.fetch(args.flag_fetch.clone()) .fetch(args.flag_fetch.clone())
.generate(&wasm)?; .generate(&wasm)?;

View File

@ -12,7 +12,7 @@ The examples here are:
* `add` - an example of generating a tiny wasm binary, one that only adds two * `add` - an example of generating a tiny wasm binary, one that only adds two
numbers. 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 the generated WebAssembly to normal JS
* `char` - an example of passing the rust `char` type to and from the js `string` type * `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 * `closures` - an example of how to invoke functions like `setInterval` or use

View File

@ -1,6 +1,6 @@
# WebAssembly to asm.js # 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 the wasm output of `wasm-bindgen` to a normal JS file that can be executed like
asm.js. 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 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 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 a number of bugs to run into or work around. If any are encountered though
please feel free to report them upstream! please feel free to report them upstream!

View File

@ -6,17 +6,17 @@ set -ex
cargo +nightly build --target wasm32-unknown-unknown --release cargo +nightly build --target wasm32-unknown-unknown --release
# Run wasm-bindgen, and note that the `--no-demangle` argument is here is # 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 \ cargo +nightly run --manifest-path ../../crates/cli/Cargo.toml \
--bin wasm-bindgen -- \ --bin wasm-bindgen -- \
--no-demangle \ --no-demangle \
../../target/wasm32-unknown-unknown/release/asmjs.wasm --out-dir . ../../target/wasm32-unknown-unknown/release/asmjs.wasm --out-dir .
# Run the `wasm2es6js` primarily with the `--wasm2asm` flag, which will # Run the `wasm2es6js` primarily with the `--wasm2js` flag, which will
# internally execute `wasm2asm` as necessary # internally execute `wasm2js` as necessary
cargo +nightly run --manifest-path ../../crates/cli/Cargo.toml \ cargo +nightly run --manifest-path ../../crates/cli/Cargo.toml \
--bin wasm2es6js -- \ --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. # Move our original wasm out of the way to avoid cofusing Webpack.
mv asmjs_bg.wasm asmjs_bg.bak.wasm mv asmjs_bg.wasm asmjs_bg.bak.wasm