diff options
author | Bert Belder <bertbelder@gmail.com> | 2020-01-24 05:34:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-24 05:34:55 +0100 |
commit | a6a7253df9129b51255d45bf996d9a335c809ace (patch) | |
tree | c50572bb537480e9522eac7da7e7ea013fd131ab | |
parent | 9f1e4237a590f79fbb7748d9bfaea4a701f8f4f8 (diff) |
Fix: take control buffer offset/length into account again (#3769)
-rw-r--r-- | core/bindings.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/bindings.rs b/core/bindings.rs index c6882ed5a..1c146934b 100644 --- a/core/bindings.rs +++ b/core/bindings.rs @@ -396,8 +396,11 @@ fn send( let control = match v8::Local::<v8::ArrayBufferView>::try_from(args.get(1)) { Ok(view) => { + let byte_offset = view.byte_offset(); + let byte_length = view.byte_length(); let backing_store = view.buffer().unwrap().get_backing_store(); - unsafe { &**backing_store.get() } + let buf = unsafe { &**backing_store.get() }; + &buf[byte_offset..byte_offset + byte_length] } Err(..) => &[], }; |