Open jdm opened 6 years ago
@jdm I think this might be a prerequisite to https://github.com/servo/servo/issues/20417 so I can take a crack at it too.
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
@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? :grin: :sweat_smile:
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.
@jdm Should I start by creating a macro rule for creating DataView element (like the one typed array element have)?
Sure.
@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)
@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.
It will be very similar to the ArrayBufferView typed array bindings.