archives

« Bugzilla Issues Index

#4050 — 22.2.3.22.1, 2 %TypedArray%.prototype.set: Unnecessary application of min()


22.2.3.22.1 %TypedArray%.prototype.set (array [ , offset ] )
22.2.3.22.2 %TypedArray%.prototype.set(typedArray [, offset ] )

Per 22.2.3.22.1 step 21 `srcLength + targetOffset ≤ targetLength`. That means `srcLength ≤ targetLength - targetOffset`, so `min(srcLength, targetLength – targetOffset) = srcLength`.



22.2.3.22.1 - step 24
> Let limit be targetByteIndex + targetElementSize × srcLength.


22.2.3.22.2 - step 27
> Let limit be targetByteIndex + targetElementSize × srcLength.


fixed in rev35 editor's draft


fixed in rev35