Skip to content

Commit

Permalink
Fix offset for detached TypedArray test
Browse files Browse the repository at this point in the history
Bug was reported by @anba at
tc39/ecma262#852 (comment)

Without this change, you'd expect a RangeError rather than a TypeError.
  • Loading branch information
littledan committed Apr 5, 2017
1 parent 5da6f98 commit d1d3e6b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ includes: [testTypedArray.js, detachArrayBuffer.js]
testWithTypedArrayConstructors(function(TA) {
var offset = TA.BYTES_PER_ELEMENT;
var buffer = new ArrayBuffer(3 * offset);
var byteOffset = { valueOf() { $DETACHBUFFER(buffer); return 1; } };
var byteOffset = { valueOf() { $DETACHBUFFER(buffer); return offset; } };
assert.throws(TypeError, () => new TA(buffer, byteOffset));
});

0 comments on commit d1d3e6b

Please sign in to comment.