Open aditj opened 5 years ago
Can you add to the existing tests in https://github.com/servo/rust-mozjs/blob/master/tests/typedarray.rs? You can use the example at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView as inspiration.
We can't use the TypedArrayElement and TypedArrayElementCreator traits since the functions of length_and_data and create_new would be different in case of a DataView.
We can't use the TypedArrayElement and TypedArrayElementCreator traits since the functions of length_and_data and create_new would be different in case of a DataView.
@jdm Help :face_with_head_bandage:
Is there a way I could overload functions of a trait (The same way I would overload functions in an OOP Language), or is there any other alternative?
Could you explain the problem that you are having? What is the code you are trying to write that is not working?
Could you explain the problem that you are having? What is the code you are trying to write that is not working?
See this comment
I think we will have to create a new DataView type similar to TypedArray which directly wraps these APIs and then add a macro like typedarray! which creates a rooted instance.
I think we will have to create a new DataView type similar to TypedArray which directly wraps these APIs and then add a macro like typedarray! which creates a rooted instance.
I'll try doing that :+1:
:umbrella: The latest upstream changes (presumably #541) made this pull request unmergeable. Please resolve the merge conflicts.
This PR tries to solve issue #406 The changes use the traits of a typed array but the APIs for Dataview object from mozjs are used. The changes have not been tested , any suggested tests/changes would be appreciated. :)
This change is