Skip to content

ArrayBufferView access from C++ script API #1497

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ada-tv
Copy link
Collaborator

@ada-tv ada-tv commented Apr 26, 2025

(Script.test__ArrayBufferView will be removed after QA testing)

Script.test__ArrayBufferView(new Uint8ClampedArray([1, 2, 3, 4]));

const buffer = new ArrayBuffer(16);
const view = new DataView(buffer);

view.setUint32(0, 0xbeefbabe);
view.setUint32(4, 0xcafecace);

Script.test__ArrayBufferView(new Uint8ClampedArray(buffer, 4, 4));

// expected results:
// ArrayBufferView(0, 4) [1, 2, 3, 4]
// ArrayBufferView(4, 4) [202, 254, 202, 206]

Closes #1353

@ada-tv ada-tv added enhancement New feature or request help wanted Extra attention is needed work in progress Do not merge yet needs CR This pull request needs to be code reviewed needs QA This pull request needs to be tested v8 Bugs related to the new V8 scripting engine labels Apr 26, 2025
@ada-tv ada-tv marked this pull request as ready for review April 28, 2025 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed needs CR This pull request needs to be code reviewed needs QA This pull request needs to be tested v8 Bugs related to the new V8 scripting engine work in progress Do not merge yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support JS TypedArray and DataView from C++
1 participant