Skip to content

Commit

Permalink
Remove unnecessary global counting
Browse files Browse the repository at this point in the history
  • Loading branch information
MaikKlein committed Jan 8, 2020
1 parent eddb3f0 commit b81ab44
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/test/run-make/wasm-export-all-symbols/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@ let list = WebAssembly.Module.exports(m);
console.log('exports', list);

const my_exports = {};
let nexports_fn = 0;
let nexports_global = 0;
let nexports = 0;

for (const entry of list) {
if (entry.kind == 'function'){
nexports_fn += 1;
}
if (entry.kind == 'global'){
nexports_global += 1;
nexports += 1;
}
my_exports[entry.name] = true;
}
Expand All @@ -27,12 +24,9 @@ if (my_exports.FOO === undefined)
throw new Error("`FOO` wasn't defined");

if (my_exports.main === undefined) {
if (nexports_fn != 1)
if (nexports != 1)
throw new Error("should only have one function export");
} else {
if (nexports_fn != 2)
if (nexports != 2)
throw new Error("should only have two function exports");
}

if (nexports_global != 1)
throw new Error("should only have one static export");

0 comments on commit b81ab44

Please sign in to comment.