Skip to content

Commit

Permalink
Add test for order of checks in WebAssembly.Table constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Ms2ger committed Aug 28, 2024
1 parent 6e7abe8 commit 75e2df7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions wasm/jsapi/table/constructor.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,8 @@ test(() => {
assert_throws_js(TypeError, () => new WebAssembly.Table(argument, "cannot be used as a wasm function"));
assert_throws_js(TypeError, () => new WebAssembly.Table(argument, 37));
}, "initialize anyfunc table with a bad default value");

test(() => {
assert_throws_js(RangeError, () =>
new WebAssembly.Table({ "element": "anyfunc", "initial": 3, "maximum": 2 }, 37));
}, "initialize anyfunc table with a bad default value and a bad descriptor");

0 comments on commit 75e2df7

Please sign in to comment.