mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-16 14:02:06 +03:00
e3473f5e9e
This commit fixes the `init` function when passed a `WebAssembly.Module`. Upon closer reading of the [spec] we see there's two possible return values from `WebAssembly.instantiate`. If passed a `Module`, it will return only the `Instance`. If passed a buffer source, though, it'll return an object with the module/instance. The fix here is to check the result value is an `Instance`, and if so assume the input must have been a module so it's paired up in the output. Closes #1418 [spec]: http://webassembly.github.io/spec/js-api/index.html#webassembly-namespace |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
LICENSE-APACHE | ||
LICENSE-MIT |