-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Float16Array #1398
Add Float16Array #1398
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks! I think it would be good to also add web-platform-tests coverage. We have a couple tests that check if each of the typed arrays are supported by postMessage()
, fetch()
, and the like and it would be good to add Float16Array
there. A grep
for one of the rarer types will likely return those tests.
OK, opened a PR with tests. |
Thanks @bakkot, I think the one thing remaining is that we should probably link the proposal if we are to merge this. Similar to how HTML has "[JSIMPORTATTRIBUTES]" and such. With that nit addressed I'd be willing to merge this Friday, barring any other feedback. |
I stuck a link to the proposal in the table which defines the types, but I'm not sure that's the best way to do it. Happy to take suggestions for alternative ways to include the link. |
I think the placement is good, but you want to use something akin to https://github.com/whatwg/fetch/blob/4c3750d3277e3df5ad452f48314eb29ca43b6461/fetch.bs#L58-L115 to add an official looking reference which you'd then reference from there. |
Neat, done. |
Added to Web IDL in whatwg/webidl#1398 and already used in the definition of `ArrayBufferView`. The test is not fantastically useful but will allow to make the test fail next time we need to add a basic type to the list.
Added to Web IDL in whatwg/webidl#1398 and already used in the definition of `ArrayBufferView`. The test is not fantastically useful but will allow to make the test fail next time we need to add a basic type to the list.
…l TypedArrays for Float16Array, a=testonly Automatic update from web-platform-tests Update tests which are generic across all TypedArrays for Float16Array For whatwg/webidl#1398. -- wpt-commits: 5aa50dd4151b5bc1d04d5505366c6e27df30af5b wpt-pr: 45483
…l TypedArrays for Float16Array, a=testonly Automatic update from web-platform-tests Update tests which are generic across all TypedArrays for Float16Array For whatwg/webidl#1398. -- wpt-commits: 5aa50dd4151b5bc1d04d5505366c6e27df30af5b wpt-pr: 45483
The Float16Array proposal for JavaScript adds a new TypedArray type holding IEEE binary16 floats. This PR adds it to all of the lists of TypedArray types in WebIDL.
Implementations of the proposal are underway in at least Chrome and Firefox, though it'll be some time before they're shippable. I don't know what the appropriate time to merge this is but I figured I should at least open it.
This is a JS feature, but adding it to ArrayBufferView has implications for any API which takes a generic TypedArray, which is quite a few of them. Does that imply they all need new tests? Hopefully not?
Fixes #1310.
(See WHATWG Working Mode: Changes for more details.)
Preview | Diff