-
Notifications
You must be signed in to change notification settings - Fork 506
Open
Description
In the current js-api (v2) spec draft, the getArg method on WebAssembly.Exception is defined asgetArg(unsigned long index), not requiring a tag:
Line 1686 in 1d3e26f
| any getArg([EnforceRange] unsigned long index); |
Lines 1754 to 1765 in 1d3e26f
| The <dfn method for="Exception">getArg(|index|)</dfn> method steps are: | |
| 1. Let |store| be the [=surrounding agent=]'s [=associated store=]. | |
| 1. Let |tagaddr| be [=exn_tag=](|store|, **this**.\[[Address]]). | |
| 1. Let |payload| be [=exn_read=](|store|, **this**.\[[Address]]). | |
| 1. Assert: |tagaddr| is equal to **this**.\[[Type]]. | |
| 1. If |index| ≥ |payload|'s [=list/size=], | |
| 1. Throw a {{RangeError}}. | |
| 1. Let [|types|] → [] be [=tag_type=](|store|, |tagaddr|). | |
| 1. If |types|[|index|] [=matches/valtype|matches=] [=v128=] or [=exnref=], | |
| 1. Throw a {{TypeError}}. | |
| 1. Return [=ToJSValue=](|payload|[|index|]). |
This does not align with the description in Exceptions.md and current browser implementations that expect a Tag argument:
| any getArg(Tag tag, unsigned long index); |
spec/proposals/exception-handling/Exceptions.md
Lines 236 to 237 in 1d3e26f
| to query if the `Exception` matches a given tag. The `getArg` method allows | |
| access to the data fields of a `Exception` if a matching tag is given. This last |
It's not entirely clear to me if this is a spec bug or an intentional change that has not been adopted in implementations yet. Either way, one of the two documents needs to be fixed.
Metadata
Metadata
Assignees
Labels
No labels