Skip to content

Commit

Permalink
Wrong change
Browse files Browse the repository at this point in the history
  • Loading branch information
hansl committed Jan 10, 2025
1 parent 61ee7e7 commit d094fbb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/engine/src/builtins/array_buffer/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,11 @@ impl SliceRef<'_> {

// 1. Assert: IsDetachedBuffer(arrayBuffer) is false.
// 2. Assert: There are sufficient bytes in arrayBuffer starting at byteIndex to represent a value of type.
debug_assert!(buffer.len() >= size_of::<T>());
debug_assert_eq!(buffer.addr() % align_of::<T>(), 0);
#[cfg(debug_assertions)]
{
assert!(buffer.len() >= size_of::<T>());
assert_eq!(buffer.addr() % align_of::<T>(), 0);
}

// 3. Let block be arrayBuffer.[[ArrayBufferData]].
// 4. Let elementSize be the Element Size value specified in Table 70 for Element Type type.
Expand Down

0 comments on commit d094fbb

Please # to comment.