Skip to content

Commit b81ab44

Browse files
committed
Remove unnecessary global counting
1 parent eddb3f0 commit b81ab44

File tree

1 file changed

+5
-11
lines changed
  • src/test/run-make/wasm-export-all-symbols

1 file changed

+5
-11
lines changed

Diff for: src/test/run-make/wasm-export-all-symbols/verify.js

+5-11
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@ let list = WebAssembly.Module.exports(m);
88
console.log('exports', list);
99

1010
const my_exports = {};
11-
let nexports_fn = 0;
12-
let nexports_global = 0;
11+
let nexports = 0;
12+
1313
for (const entry of list) {
1414
if (entry.kind == 'function'){
15-
nexports_fn += 1;
16-
}
17-
if (entry.kind == 'global'){
18-
nexports_global += 1;
15+
nexports += 1;
1916
}
2017
my_exports[entry.name] = true;
2118
}
@@ -27,12 +24,9 @@ if (my_exports.FOO === undefined)
2724
throw new Error("`FOO` wasn't defined");
2825

2926
if (my_exports.main === undefined) {
30-
if (nexports_fn != 1)
27+
if (nexports != 1)
3128
throw new Error("should only have one function export");
3229
} else {
33-
if (nexports_fn != 2)
30+
if (nexports != 2)
3431
throw new Error("should only have two function exports");
3532
}
36-
37-
if (nexports_global != 1)
38-
throw new Error("should only have one static export");

0 commit comments

Comments
 (0)