Skip to content

Commit a32076d

Browse files
authored
Update xembind.cpp
1 parent 5e44f79 commit a32076d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/xembind.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,13 @@ namespace xeus
5252
// if its a data view we can/need to get the byteLength directly
5353
// because there is no "BYTES_PER_ELEMENT"
5454
const unsigned length_uint8 = is_data_view ? js_array["byteLength"].as<unsigned>() : length * js_array["BYTES_PER_ELEMENT"].as<unsigned>() ;
55+
5556

5657
// convert js typed-array into an Uint8Array
5758
ems::val js_uint8array = ems::val::global("Uint8Array").new_(
5859
js_array_buffer,
5960
byteOffset,
60-
length * bytes_per_element
61+
length_uint8
6162
);
6263

6364
// resize array on c++ size

0 commit comments

Comments
 (0)