Skip to content
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

NAPI DataView and TypedArray conversions ignore byteOffset #3781

Closed
RedBeard0531 opened this issue Jun 4, 2021 · 1 comment · Fixed by #4826
Closed

NAPI DataView and TypedArray conversions ignore byteOffset #3781

RedBeard0531 opened this issue Jun 4, 2021 · 1 comment · Fixed by #4826
Assignees

Comments

@RedBeard0531
Copy link
Contributor

RedBeard0531 commented Jun 4, 2021

template <>
auto get_data<DataView>(DataView data_view)
{
auto buffer = data_view.ArrayBuffer();
return static_cast<const char*>(buffer.Data());
}
template <>
auto get_data<TypedArray>(TypedArray typed_array)
{
auto buffer = typed_array.ArrayBuffer();
return static_cast<const char*>(buffer.Data());
}

That code should be adding the byte offset of the view to the start address of the ArrayBuffer. Instead, it is just returning the start address with no offsetting.

@sync-by-unito
Copy link

sync-by-unito bot commented Feb 23, 2023

➤ JacobOscarGunnarsson commented:

This code has been removed in v12

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
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 a pull request may close this issue.

3 participants