Bug 235261 - [JSC] Fix misc issues in WebAssembly.Exception
Summary: [JSC] Fix misc issues in WebAssembly.Exception
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-01-14 20:03 PST by Yusuke Suzuki
Modified: 2022-01-15 13:33 PST (History)
10 users (show)

See Also:


Attachments
Patch (14.62 KB, patch)
2022-01-14 20:05 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (16.72 KB, patch)
2022-01-14 21:03 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (16.69 KB, patch)
2022-01-15 00:22 PST, Yusuke Suzuki
ashvayka: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2022-01-14 20:03:44 PST
[JSC] Fix misc issues in WebAssembly.Exception
Comment 1 Yusuke Suzuki 2022-01-14 20:05:58 PST
Created attachment 449239 [details]
Patch
Comment 2 EWS Watchlist 2022-01-14 20:07:18 PST
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment 3 Yusuke Suzuki 2022-01-14 20:21:57 PST
Comment on attachment 449239 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=449239&action=review

> LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/getArg.tentative.any.js:23
> +  assert_throws_js(TypeError, () => exn.getArg(tag, 1));

According to the spec, it should be TypeError https://webassembly.github.io/exception-handling/js-api/index.html#dom-exception-getarg
Comment 4 Yusuke Suzuki 2022-01-14 21:03:23 PST
Created attachment 449242 [details]
Patch
Comment 5 Yusuke Suzuki 2022-01-15 00:22:44 PST
Created attachment 449246 [details]
Patch
Comment 6 Alexey Shvayka 2022-01-15 06:30:26 PST
Comment on attachment 449246 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=449246&action=review

r=me with ChangeLog nits.

> Source/JavaScriptCore/ChangeLog:10
> +

3. Throw TypeError instead of RangeError when implementing [EnforceRange] extended attribute (step 6 of https://webidl.spec.whatwg.org/#abstract-opdef-converttoint).

Also, a link to proposal spec would be nice: https://github.com/WebAssembly/exception-handling/blob/main/proposals/exception-handling/Exceptions.md#js-api.
Comment 7 Alexey Shvayka 2022-01-15 07:05:46 PST
(In reply to Alexey Shvayka from comment #6)
> 3. Throw TypeError instead of RangeError when implementing [EnforceRange]
> extended attribute (step 6 of
> https://webidl.spec.whatwg.org/#abstract-opdef-converttoint).
> 
> Also, a link to proposal spec would be nice:
> https://github.com/WebAssembly/exception-handling/blob/main/proposals/
> exception-handling/Exceptions.md#js-api.

Oops, that's not [EnforceRange], sorry, and the spec link from WPT PR is way better.
Comment 8 Yusuke Suzuki 2022-01-15 13:30:42 PST
(In reply to Alexey Shvayka from comment #7)
> (In reply to Alexey Shvayka from comment #6)
> > 3. Throw TypeError instead of RangeError when implementing [EnforceRange]
> > extended attribute (step 6 of
> > https://webidl.spec.whatwg.org/#abstract-opdef-converttoint).
> > 
> > Also, a link to proposal spec would be nice:
> > https://github.com/WebAssembly/exception-handling/blob/main/proposals/
> > exception-handling/Exceptions.md#js-api.
> 
> Oops, that's not [EnforceRange], sorry, and the spec link from WPT PR is way
> better.

OK, added!
Comment 9 Yusuke Suzuki 2022-01-15 13:32:48 PST
Committed r288065 (246085@trunk): <https://commits.webkit.org/246085@trunk>
Comment 10 Radar WebKit Bug Importer 2022-01-15 13:33:16 PST
<rdar://problem/87641664>