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.
wasm2es6js: Fix handling of start function
This is split out from rustwasm#1002 and is intended to fix the tool's handling of the `start` function. For the most accurate emulation of the wasm ESM spec I believe we need to defer execution of the start function until all our exports are wired up which should allow valid cyclical references during instantiation. The fix here is to remove the start function, if one is present, and inject an invocation of it at the end of initialization (after our exports are wired up). This fixes tests on rustwasm#1002, but doesn't have any direct analogue for tests here just yet. Along the way because multiple files now come out of `wasm2es6js` by default I've added an `--out-dir` argument as well as `-o` to ensure that a folder for all outputs can be specified.
- Loading branch information
1 parent
bbde39f
commit 522e973
Showing
3 changed files
with
85 additions
and
20 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