Tried to update to the latest test262 commit in #408 and noticed a failure in the new byteOffset test: byteoffset-with-detached-buffer
In assert.sameValue(byteOffset, 2 * TA.BYTES_PER_ELEMENT); byteOffset is 8 and not 16 as the test expects.
In QuickJS we zero the byteOffset if the buffer is detached, but oddly enough, the spec doesn't call for that: [13. Let srcByteOffset be O.[[ByteOffset]]](https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray). A bit higher in If [IsTypedArrayOutOfBounds](https://tc39.es/ecma262/#sec-istypedarrayoutofbounds)(srcRecord) is true we notice the buffer is detached but that just sets the srcLength = 0 and doesn't throw an error.
Tried to update to the latest test262 commit in #408 and noticed a failure in the new byteOffset test: byteoffset-with-detached-buffer
In
assert.sameValue(byteOffset, 2 * TA.BYTES_PER_ELEMENT);byteOffset is8and not16as the test expects.In QuickJS we zero the
byteOffsetif the buffer is detached, but oddly enough, the spec doesn't call for that:[13. Let srcByteOffset be O.[[ByteOffset]]](https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray). A bit higher inIf [IsTypedArrayOutOfBounds](https://tc39.es/ecma262/#sec-istypedarrayoutofbounds)(srcRecord) is truewe notice the buffer is detached but that just sets thesrcLength = 0and doesn't throw an error.