From 8fbb531210c0a3e2e90a7e25f916fd54f2f5a85c Mon Sep 17 00:00:00 2001 From: Shu-yu Guo Date: Wed, 18 Aug 2021 16:43:35 -0700 Subject: [PATCH] Normative: Don't consider 0-length TypedArrays out of bounds (#70) Closes #68 --- spec.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec.html b/spec.html index daca54d..bd55ce0 100644 --- a/spec.html +++ b/spec.html @@ -481,7 +481,8 @@

IsIntegerIndexedObjectOutOfBounds ( _O_, _getBufferByteLength_ )

1. Else, 1. Let _elementSize_ be the Element Size value specified in for _O_.[[TypedArrayName]]. 1. Let _byteOffsetEnd_ be _byteOffsetStart_ + _O_.[[ArrayLength]] × _elementSize_. - 1. If _byteOffsetStart_ ≥ _bufferByteLength_ or _byteOffsetEnd_ > _bufferByteLength_, then return *true*. + 1. If _byteOffsetStart_ > _bufferByteLength_ or _byteOffsetEnd_ > _bufferByteLength_, then return *true*. + 1. NOTE: 0-length TypedArrays are not considered out-of-bounds. 1. Return *false*.