From 9e530b73ac7ac752d9e6ca8c1e13f7406f2dc88a Mon Sep 17 00:00:00 2001 From: raskad <32105367+raskad@users.noreply.github.com> Date: Sun, 19 Sep 2021 02:16:40 +0200 Subject: [PATCH] Fix slicing error --- boa/src/builtins/array_buffer/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boa/src/builtins/array_buffer/mod.rs b/boa/src/builtins/array_buffer/mod.rs index cfd05c3c315..a02f1db278b 100644 --- a/boa/src/builtins/array_buffer/mod.rs +++ b/boa/src/builtins/array_buffer/mod.rs @@ -628,7 +628,7 @@ impl ArrayBuffer { // 6. Else, let rawValue be a List whose elements are bytes from block at indices byteIndex (inclusive) through byteIndex + elementSize (exclusive). // 7. Assert: The number of elements in rawValue is elementSize. - let raw_value = &block[byte_index..element_size]; + let raw_value = &block[byte_index..byte_index + element_size]; // TODO: Agent Record [[LittleEndian]] filed // 8. If isLittleEndian is not present, set isLittleEndian to the value of the [[LittleEndian]] field of the surrounding agent's Agent Record.