Skip to content

Commit ce42d60

Browse files
committed
fix(wasm): illegal table access msg in test
1 parent 839e80a commit ce42d60

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/cases/wasm/table/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
// the message is inconsistency between some nodejs versions
2+
const UNKNOWN_FUNCTION_TABLE = /invalid index into function table|invalid function/;
3+
14
it("should support tables", function() {
25
return import("./wasm-table.wasm").then(function(wasm) {
36
expect(wasm.callByIndex(0)).toEqual(42);
47
expect(wasm.callByIndex(1)).toEqual(13);
5-
expect(() => wasm.callByIndex(2)).toThrow("invalid function");
8+
expect(() => wasm.callByIndex(2)).toThrow(UNKNOWN_FUNCTION_TABLE);
69
});
710
});
811

@@ -23,6 +26,6 @@ it("should support imported tables", function() {
2326
return import("./wasm-table-imported.wasm").then(function(wasm) {
2427
expect(wasm.callByIndex(0)).toEqual(42);
2528
expect(wasm.callByIndex(1)).toEqual(13);
26-
expect(() => wasm.callByIndex(2)).toThrow("invalid function");
29+
expect(() => wasm.callByIndex(2)).toThrow(UNKNOWN_FUNCTION_TABLE);
2730
});
2831
});

0 commit comments

Comments
 (0)