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

data_view_draft_UNCOMPILED #14

Merged
merged 4 commits into from
Feb 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/xembind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,13 @@ namespace xeus
ems::val js_array_buffer = js_array["buffer"].as<ems::val>();
ems::val byteOffset = js_array["byteOffset"].as<ems::val>();
const unsigned length = js_array["length"].as<unsigned> ();
const unsigned bytes_per_element = js_array["BYTES_PER_ELEMENT"].as<unsigned>();
const unsigned length_uint8 = length * bytes_per_element;

const unsigned length_uint8 = js_array["byteLength"].as<unsigned>();

// convert js typed-array into an Uint8Array
ems::val js_uint8array = ems::val::global("Uint8Array").new_(
js_array_buffer,
byteOffset,
length * bytes_per_element
length_uint8
);

// resize array on c++ size
Expand Down