forked from rustwasm/wasm-bindgen
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix generated shims if APIs don't exist
This commit fixes instantiation of the wasm module even if some of the improted APIs don't exist. This extends the functionality initially added in rustwasm#409 to attempt to gracefully allow importing values from the environment which don't actually exist in all contexts. In addition to nonexistent methods being handled now entire nonexistent types are now also handled. I suspect that eventually we'll add a CLI flag to `wasm-bindgen` to say "I assert everything exists, don't check it" to trim out the extra JS glue generated here. In the meantime though this'll pave the way for a wasm-bindgen shim to be instantiated in both a web worker and the main thread, while using DOM-like APIs only on the main thread.
- Loading branch information
1 parent
e03e404
commit 13cac2d
Showing
3 changed files
with
55 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters