Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information