This repository has been archived by the owner on Apr 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a first pass at a loader for wasm modules. It offers support for both named imports as well as deafult. It may be possible to move some of this logic down to C++, but I think the current implementation might be good enough. It doesn't currently use the ESM cache, but AFAICT it isn't currently exposed. Will dig in more with tests / examples / cache after initial implementation gets feedback.
- Loading branch information
1 parent
c809f78
commit f0a4ff5
Showing
5 changed files
with
47 additions
and
1 deletion.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Flags: --experimental-modules --experimental-wasm-modules | ||
/* eslint-disable node-core/required-modules */ | ||
import wasmMod from '../fixtures/simple.wasm' | ||
import {add} from '../fixtures/simple.wasm'; | ||
import {strictEqual} from 'assert'; | ||
|
||
strictEqual(wasmMod.add(10, 20), 30); | ||
strictEqual(add(10, 20), 30); | ||
strictEqual(wasmMod.add, add); |