Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

[js-api] Add missing EnforceRange to getArg argument. #257

Merged
merged 1 commit into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion document/js-api/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,7 @@ dictionary ExceptionOptions {
[LegacyNamespace=WebAssembly, Exposed=(Window,Worker,Worklet)]
interface Exception {
constructor(Tag exceptionTag, sequence<any> payload, optional ExceptionOptions options = {});
any getArg(Tag exceptionTag, unsigned long index);
any getArg(Tag exceptionTag, [EnforceRange] unsigned long index);
boolean is(Tag exceptionTag);
readonly attribute (DOMString or undefined) stack;
};
Expand Down
2 changes: 1 addition & 1 deletion test/js-api/exception/getArg.tentative.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ test(() => {
const tag = new WebAssembly.Tag({ parameters: [] });
const exn = new WebAssembly.Exception(tag, []);
for (const value of outOfRangeValues) {
assert_throws_js(RangeError, () => exn.getArg(tag, value));
assert_throws_js(TypeError, () => exn.getArg(tag, value));
}
}, "Getting out-of-range argument");

Expand Down