Skip to content
This repository has been archived by the owner on Nov 12, 2022. It is now read-only.

Add bindings for DataView typed array #406

Open
jdm opened this issue Mar 24, 2018 · 9 comments
Open

Add bindings for DataView typed array #406

jdm opened this issue Mar 24, 2018 · 9 comments

Comments

@jdm
Copy link
Member

jdm commented Mar 24, 2018

It will be very similar to the ArrayBufferView typed array bindings.

@anthgur
Copy link
Contributor

anthgur commented Mar 25, 2018

@jdm I think this might be a prerequisite to servo/servo#20417 so I can take a crack at it too.

@jdm
Copy link
Member Author

jdm commented Mar 25, 2018

So it looks like we can't reuse the macro because the JS API for DataView objects functions a little differently. We'll need to hand-write this implementation to use UnwrapArrayBuffer, these functions, and this implementation using this function. At that point we should be able to reuse the array_alias! macro

@aditj
Copy link

aditj commented Feb 6, 2019

@jdm Can I work on this in an attempt to fix servo/servo issue #20417

@aditj
Copy link

aditj commented Feb 6, 2019

@jdm Can I work on this in an attempt to fix servo/servo issue #20417

Also if yes, can you maybe tell me is there a dxr tree for the same? 😁 😅

@jdm
Copy link
Member Author

jdm commented Feb 6, 2019

Absolutely. I'm pretty sure the answer to your DXR question is no, though, since the version of mozjs that we're using is at least 6 months older than the version in DXR/searchfox.

@aditj
Copy link

aditj commented Feb 8, 2019

@jdm Should I start by creating a macro rule for creating DataView element (like the one typed array element have)?

@jdm
Copy link
Member Author

jdm commented Feb 8, 2019

Sure.

@aditj
Copy link

aditj commented Feb 10, 2019

@jdm
I think the DataView element would be similar to the typed array element ,any properties that you think should be added?
Also, should I also write DataView Array structure? (And create a seperate array_alias macro for DataView Array)

@jdm
Copy link
Member Author

jdm commented Feb 19, 2019

@aditj I do not believe we need a separate DataViewArray structure. We should be able to use the existing TypedArray structure without any changes; we just need to define an implementation of TypedArrayElement and TypedArrayElementCreator that uses the DataView APIs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants