Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Conversation

@ngzhian
Copy link
Member

@ngzhian ngzhian commented Sep 23, 2020

Following the description given in
https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md#javascript-api-and-simd-values
and also what I64 did before bigint integration.

js-api tests are not updated yet, that will come in a future patch.

Following the description given in
https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md#javascript-api-and-simd-values
and also what I64 did before bigint integration.
<div algorithm>
The algorithm <dfn>ToJSValue</dfn>(|w|) coerces a [=WebAssembly value=] to a JavaScript value by performing the following steps:

1. Assert: |w| is not of the form [=v128.const=] <var ignore>v128</var>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps I'm not understanding this well, why is this assert required? Also, what happens for i64 values without BigInt support?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this assert required?

This assert is to ensure that we never call ToJSValue with a v128.const, since we don't know how to convert it to JS. In all the callers of ToJSValue we should have checked for v128 and raise an exception prior.

Also, what happens for i64 values without BigInt support?

I think BigInt support is required, not too sure.

@dtig dtig merged commit f5c5dcc into WebAssembly:master Feb 2, 2021
@ngzhian ngzhian deleted the js-api branch February 2, 2021 04:13
gahaas referenced this pull request in web-platform-tests/wpt May 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants