Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
26 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
it("should allow wasm with unused exports", function() { | ||
return import("./module").then(function(module) { | ||
const result = module.run(); | ||
expect(result).toEqual(42); | ||
}); | ||
}); |
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,5 @@ | ||
import { getNumber } from "./wasm.wat"; | ||
|
||
export function run() { | ||
return getNumber(); | ||
} |
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,5 @@ | ||
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); | ||
|
||
module.exports = function(config) { | ||
return supportsWebAssembly(); | ||
}; |
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,10 @@ | ||
(module | ||
(type $t0 (func (param i32 i32) (result i32))) | ||
(type $t1 (func (result i32))) | ||
(func $add (export "add") (type $t0) (param $p0 i32) (param $p1 i32) (result i32) | ||
(i32.add | ||
(get_local $p0) | ||
(get_local $p1))) | ||
(func $getNumber (export "getNumber") (type $t1) (result i32) | ||
(i32.const 42))) | ||
|