diff --git a/test/built-ins/DataView/prototype/getFloat32/detached-buffer-after-integer-byteoffset.js b/test/built-ins/DataView/prototype/getFloat32/detached-buffer-after-toindex-byteoffset.js similarity index 75% rename from test/built-ins/DataView/prototype/getFloat32/detached-buffer-after-integer-byteoffset.js rename to test/built-ins/DataView/prototype/getFloat32/detached-buffer-after-toindex-byteoffset.js index ef2440d1a2..9170345f79 100644 --- a/test/built-ins/DataView/prototype/getFloat32/detached-buffer-after-integer-byteoffset.js +++ b/test/built-ins/DataView/prototype/getFloat32/detached-buffer-after-toindex-byteoffset.js @@ -3,10 +3,8 @@ /*--- esid: sec-dataview.prototype.getfloat32 -es6id: 24.2.4.5 description: > - Detached buffer is checked after checking If numberIndex ≠ getIndex or - getIndex < 0, + Detached buffer is only checked after ToIndex(requestIndex) info: | 24.2.4.5 DataView.prototype.getFloat32 ( byteOffset [ , littleEndian ] ) @@ -19,8 +17,8 @@ info: | ... 4. Let getIndex be ? ToIndex(requestIndex). ... - 7. Let buffer be view.[[ViewedArrayBuffer]]. - 8. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. + 6. Let buffer be view.[[ViewedArrayBuffer]]. + 7. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. ... includes: [detachArrayBuffer.js] ---*/ @@ -33,3 +31,7 @@ $DETACHBUFFER(buffer); assert.throws(RangeError, function() { sample.getFloat32(-1); }); + +assert.throws(RangeError, function() { + sample.getFloat32(Infinity); +}, "Infinity"); diff --git a/test/built-ins/DataView/prototype/getFloat32/detached-buffer-before-outofrange-byteoffset.js b/test/built-ins/DataView/prototype/getFloat32/detached-buffer-before-outofrange-byteoffset.js index 3ed97901cf..cf9293dba9 100644 --- a/test/built-ins/DataView/prototype/getFloat32/detached-buffer-before-outofrange-byteoffset.js +++ b/test/built-ins/DataView/prototype/getFloat32/detached-buffer-before-outofrange-byteoffset.js @@ -16,10 +16,10 @@ info: | 24.2.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type ) ... - 8. Let buffer be the value of view's [[ViewedArrayBuffer]] internal slot. - 9. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. + 6. Let buffer be view.[[ViewedArrayBuffer]]. + 7. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. ... - 13. If getIndex + elementSize > viewSize, throw a RangeError exception. + 11. If getIndex + elementSize > viewSize, throw a RangeError exception. ... includes: [detachArrayBuffer.js] ---*/ @@ -31,10 +31,6 @@ sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); -assert.throws(TypeError, function() { - sample.getFloat32(Infinity); -}, "Infinity"); - assert.throws(TypeError, function() { sample.getFloat32(13); }, "13"); diff --git a/test/built-ins/DataView/prototype/getFloat64/detached-buffer-after-integer-byteoffset.js b/test/built-ins/DataView/prototype/getFloat64/detached-buffer-after-toindex-byteoffset.js similarity index 75% rename from test/built-ins/DataView/prototype/getFloat64/detached-buffer-after-integer-byteoffset.js rename to test/built-ins/DataView/prototype/getFloat64/detached-buffer-after-toindex-byteoffset.js index 32947925e2..a322e1a11f 100644 --- a/test/built-ins/DataView/prototype/getFloat64/detached-buffer-after-integer-byteoffset.js +++ b/test/built-ins/DataView/prototype/getFloat64/detached-buffer-after-toindex-byteoffset.js @@ -3,10 +3,8 @@ /*--- esid: sec-dataview.prototype.getfloat64 -es6id: 24.2.4.6 description: > - Detached buffer is checked after checking If numberIndex ≠ getIndex or - getIndex < 0, + Detached buffer is only checked after ToIndex(requestIndex) info: | 24.2.4.6 DataView.prototype.getFloat64 ( byteOffset [ , littleEndian ] ) @@ -19,8 +17,8 @@ info: | ... 4. Let getIndex be ? ToIndex(requestIndex). ... - 7. Let buffer be view.[[ViewedArrayBuffer]]. - 8. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. + 6. Let buffer be view.[[ViewedArrayBuffer]]. + 7. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. ... includes: [detachArrayBuffer.js] ---*/ @@ -33,3 +31,7 @@ $DETACHBUFFER(buffer); assert.throws(RangeError, function() { sample.getFloat64(-1); }); + +assert.throws(RangeError, function() { + sample.getFloat64(Infinity); +}, "Infinity"); diff --git a/test/built-ins/DataView/prototype/getFloat64/detached-buffer-before-outofrange-byteoffset.js b/test/built-ins/DataView/prototype/getFloat64/detached-buffer-before-outofrange-byteoffset.js index 81d349941b..6fc2c78c1e 100644 --- a/test/built-ins/DataView/prototype/getFloat64/detached-buffer-before-outofrange-byteoffset.js +++ b/test/built-ins/DataView/prototype/getFloat64/detached-buffer-before-outofrange-byteoffset.js @@ -16,10 +16,10 @@ info: | 24.2.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type ) ... - 8. Let buffer be the value of view's [[ViewedArrayBuffer]] internal slot. - 9. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. + 6. Let buffer be view.[[ViewedArrayBuffer]]. + 7. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. ... - 13. If getIndex + elementSize > viewSize, throw a RangeError exception. + 11. If getIndex + elementSize > viewSize, throw a RangeError exception. ... includes: [detachArrayBuffer.js] ---*/ @@ -31,10 +31,6 @@ sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); -assert.throws(TypeError, function() { - sample.getFloat64(Infinity); -}, "Infinity"); - assert.throws(TypeError, function() { sample.getFloat64(13); }, "13"); diff --git a/test/built-ins/DataView/prototype/getInt16/detached-buffer-after-integer-byteoffset.js b/test/built-ins/DataView/prototype/getInt16/detached-buffer-after-toindex-byteoffset.js similarity index 75% rename from test/built-ins/DataView/prototype/getInt16/detached-buffer-after-integer-byteoffset.js rename to test/built-ins/DataView/prototype/getInt16/detached-buffer-after-toindex-byteoffset.js index 5d7007553d..2427379e78 100644 --- a/test/built-ins/DataView/prototype/getInt16/detached-buffer-after-integer-byteoffset.js +++ b/test/built-ins/DataView/prototype/getInt16/detached-buffer-after-toindex-byteoffset.js @@ -3,10 +3,8 @@ /*--- esid: sec-dataview.prototype.getint16 -es6id: 24.2.4.8 description: > - Detached buffer is checked after checking If numberIndex ≠ getIndex or - getIndex < 0, + Detached buffer is only checked after ToIndex(requestIndex) info: | 24.2.4.8 DataView.prototype.getInt16 ( byteOffset [ , littleEndian ] ) @@ -19,8 +17,8 @@ info: | ... 4. Let getIndex be ? ToIndex(requestIndex). ... - 7. Let buffer be view.[[ViewedArrayBuffer]]. - 8. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. + 6. Let buffer be view.[[ViewedArrayBuffer]]. + 7. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. ... includes: [detachArrayBuffer.js] ---*/ @@ -30,6 +28,10 @@ var sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); +assert.throws(RangeError, function() { + sample.getInt16(Infinity); +}, "Infinity"); + assert.throws(RangeError, function() { sample.getInt16(-1); }); diff --git a/test/built-ins/DataView/prototype/getInt16/detached-buffer-before-outofrange-byteoffset.js b/test/built-ins/DataView/prototype/getInt16/detached-buffer-before-outofrange-byteoffset.js index 2763fb9db3..1432f1c176 100644 --- a/test/built-ins/DataView/prototype/getInt16/detached-buffer-before-outofrange-byteoffset.js +++ b/test/built-ins/DataView/prototype/getInt16/detached-buffer-before-outofrange-byteoffset.js @@ -16,10 +16,10 @@ info: | 24.2.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type ) ... - 8. Let buffer be the value of view's [[ViewedArrayBuffer]] internal slot. - 9. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. + 6. Let buffer be view.[[ViewedArrayBuffer]]. + 7. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. ... - 13. If getIndex + elementSize > viewSize, throw a RangeError exception. + 11. If getIndex + elementSize > viewSize, throw a RangeError exception. ... includes: [detachArrayBuffer.js] ---*/ @@ -31,10 +31,6 @@ sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); -assert.throws(TypeError, function() { - sample.getInt16(Infinity); -}, "Infinity"); - assert.throws(TypeError, function() { sample.getInt16(13); }, "13"); diff --git a/test/built-ins/DataView/prototype/getInt32/detached-buffer-after-integer-byteoffset.js b/test/built-ins/DataView/prototype/getInt32/detached-buffer-after-toindex-byteoffset.js similarity index 75% rename from test/built-ins/DataView/prototype/getInt32/detached-buffer-after-integer-byteoffset.js rename to test/built-ins/DataView/prototype/getInt32/detached-buffer-after-toindex-byteoffset.js index 777c6a6226..c82d6711c7 100644 --- a/test/built-ins/DataView/prototype/getInt32/detached-buffer-after-integer-byteoffset.js +++ b/test/built-ins/DataView/prototype/getInt32/detached-buffer-after-toindex-byteoffset.js @@ -3,10 +3,8 @@ /*--- esid: sec-dataview.prototype.getint32 -es6id: 24.2.4.9 description: > - Detached buffer is checked after checking If numberIndex ≠ getIndex or - getIndex < 0, + Detached buffer is only checked after ToIndex(requestIndex) info: | 24.2.4.9 DataView.prototype.getInt32 ( byteOffset [ , littleEndian ] ) @@ -19,8 +17,8 @@ info: | ... 4. Let getIndex be ? ToIndex(requestIndex). ... - 7. Let buffer be view.[[ViewedArrayBuffer]]. - 8. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. + 6. Let buffer be view.[[ViewedArrayBuffer]]. + 7. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. ... includes: [detachArrayBuffer.js] ---*/ @@ -30,6 +28,10 @@ var sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); +assert.throws(RangeError, function() { + sample.getInt32(Infinity); +}, "Infinity"); + assert.throws(RangeError, function() { sample.getInt32(-1); }); diff --git a/test/built-ins/DataView/prototype/getInt32/detached-buffer-before-outofrange-byteoffset.js b/test/built-ins/DataView/prototype/getInt32/detached-buffer-before-outofrange-byteoffset.js index 5f707284c0..75bd40c4f7 100644 --- a/test/built-ins/DataView/prototype/getInt32/detached-buffer-before-outofrange-byteoffset.js +++ b/test/built-ins/DataView/prototype/getInt32/detached-buffer-before-outofrange-byteoffset.js @@ -16,10 +16,10 @@ info: | 24.2.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type ) ... - 8. Let buffer be the value of view's [[ViewedArrayBuffer]] internal slot. - 9. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. + 6. Let buffer be view.[[ViewedArrayBuffer]]. + 7. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. ... - 13. If getIndex + elementSize > viewSize, throw a RangeError exception. + 11. If getIndex + elementSize > viewSize, throw a RangeError exception. ... includes: [detachArrayBuffer.js] ---*/ @@ -31,10 +31,6 @@ sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); -assert.throws(TypeError, function() { - sample.getInt32(Infinity); -}, "Infinity"); - assert.throws(TypeError, function() { sample.getInt32(13); }, "13"); diff --git a/test/built-ins/DataView/prototype/getInt8/detached-buffer-after-integer-byteoffset.js b/test/built-ins/DataView/prototype/getInt8/detached-buffer-after-toindex-byteoffset.js similarity index 72% rename from test/built-ins/DataView/prototype/getInt8/detached-buffer-after-integer-byteoffset.js rename to test/built-ins/DataView/prototype/getInt8/detached-buffer-after-toindex-byteoffset.js index 175359727d..2d25f84ae6 100644 --- a/test/built-ins/DataView/prototype/getInt8/detached-buffer-after-integer-byteoffset.js +++ b/test/built-ins/DataView/prototype/getInt8/detached-buffer-after-toindex-byteoffset.js @@ -3,10 +3,8 @@ /*--- esid: sec-dataview.prototype.getint8 -es6id: 24.2.4.7 description: > - Detached buffer is checked after checking If numberIndex ≠ getIndex or - getIndex < 0, + Detached buffer is only checked after ToIndex(requestIndex) info: | 24.2.4.7 DataView.prototype.getInt8 ( byteOffset ) @@ -18,8 +16,8 @@ info: | ... 4. Let getIndex be ? ToIndex(requestIndex). ... - 7. Let buffer be view.[[ViewedArrayBuffer]]. - 8. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. + 6. Let buffer be view.[[ViewedArrayBuffer]]. + 7. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. ... includes: [detachArrayBuffer.js] ---*/ @@ -29,6 +27,10 @@ var sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); +assert.throws(RangeError, function() { + sample.getInt8(Infinity); +}, "Infinity"); + assert.throws(RangeError, function() { sample.getInt8(-1); }); diff --git a/test/built-ins/DataView/prototype/getInt8/detached-buffer-before-outofrange-byteoffset.js b/test/built-ins/DataView/prototype/getInt8/detached-buffer-before-outofrange-byteoffset.js index 48f03e7fc7..c168243e98 100644 --- a/test/built-ins/DataView/prototype/getInt8/detached-buffer-before-outofrange-byteoffset.js +++ b/test/built-ins/DataView/prototype/getInt8/detached-buffer-before-outofrange-byteoffset.js @@ -15,10 +15,10 @@ info: | 24.2.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type ) ... - 8. Let buffer be the value of view's [[ViewedArrayBuffer]] internal slot. - 9. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. + 6. Let buffer be view.[[ViewedArrayBuffer]]. + 7. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. ... - 13. If getIndex + elementSize > viewSize, throw a RangeError exception. + 11. If getIndex + elementSize > viewSize, throw a RangeError exception. ... includes: [detachArrayBuffer.js] ---*/ @@ -30,10 +30,6 @@ sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); -assert.throws(TypeError, function() { - sample.getInt8(Infinity); -}, "Infinity"); - assert.throws(TypeError, function() { sample.getInt8(13); }, "13"); diff --git a/test/built-ins/DataView/prototype/getUint16/detached-buffer-after-integer-byteoffset.js b/test/built-ins/DataView/prototype/getUint16/detached-buffer-after-toindex-byteoffset.js similarity index 75% rename from test/built-ins/DataView/prototype/getUint16/detached-buffer-after-integer-byteoffset.js rename to test/built-ins/DataView/prototype/getUint16/detached-buffer-after-toindex-byteoffset.js index 874c54ad43..5181c146e1 100644 --- a/test/built-ins/DataView/prototype/getUint16/detached-buffer-after-integer-byteoffset.js +++ b/test/built-ins/DataView/prototype/getUint16/detached-buffer-after-toindex-byteoffset.js @@ -3,10 +3,8 @@ /*--- esid: sec-dataview.prototype.getuint16 -es6id: 24.2.4.11 description: > - Detached buffer is checked after checking If numberIndex ≠ getIndex or - getIndex < 0, + Detached buffer is only checked after ToIndex(requestIndex) info: | 24.2.4.11 DataView.prototype.getUint16 ( byteOffset [ , littleEndian ] ) @@ -19,8 +17,8 @@ info: | ... 4. Let getIndex be ? ToIndex(requestIndex). ... - 7. Let buffer be view.[[ViewedArrayBuffer]]. - 8. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. + 6. Let buffer be view.[[ViewedArrayBuffer]]. + 7. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. ... includes: [detachArrayBuffer.js] ---*/ @@ -30,6 +28,10 @@ var sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); +assert.throws(RangeError, function() { + sample.getUint16(Infinity); +}, "Infinity"); + assert.throws(RangeError, function() { sample.getUint16(-1); }); diff --git a/test/built-ins/DataView/prototype/getUint16/detached-buffer-before-outofrange-byteoffset.js b/test/built-ins/DataView/prototype/getUint16/detached-buffer-before-outofrange-byteoffset.js index 91ee8e72e2..01a4d13ee0 100644 --- a/test/built-ins/DataView/prototype/getUint16/detached-buffer-before-outofrange-byteoffset.js +++ b/test/built-ins/DataView/prototype/getUint16/detached-buffer-before-outofrange-byteoffset.js @@ -16,10 +16,10 @@ info: | 24.2.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type ) ... - 8. Let buffer be the value of view's [[ViewedArrayBuffer]] internal slot. - 9. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. + 6. Let buffer be view.[[ViewedArrayBuffer]]. + 7. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. ... - 13. If getIndex + elementSize > viewSize, throw a RangeError exception. + 11. If getIndex + elementSize > viewSize, throw a RangeError exception. ... includes: [detachArrayBuffer.js] ---*/ @@ -31,10 +31,6 @@ sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); -assert.throws(TypeError, function() { - sample.getUint16(Infinity); -}, "Infinity"); - assert.throws(TypeError, function() { sample.getUint16(13); }, "13"); diff --git a/test/built-ins/DataView/prototype/getUint32/detached-buffer-after-integer-byteoffset.js b/test/built-ins/DataView/prototype/getUint32/detached-buffer-after-toindex-byteoffset.js similarity index 75% rename from test/built-ins/DataView/prototype/getUint32/detached-buffer-after-integer-byteoffset.js rename to test/built-ins/DataView/prototype/getUint32/detached-buffer-after-toindex-byteoffset.js index 748a578c03..09067c897f 100644 --- a/test/built-ins/DataView/prototype/getUint32/detached-buffer-after-integer-byteoffset.js +++ b/test/built-ins/DataView/prototype/getUint32/detached-buffer-after-toindex-byteoffset.js @@ -3,10 +3,8 @@ /*--- esid: sec-dataview.prototype.getuint32 -es6id: 24.2.4.12 description: > - Detached buffer is checked after checking If numberIndex ≠ getIndex or - getIndex < 0, + Detached buffer is only checked after ToIndex(requestIndex) info: | 24.2.4.12 DataView.prototype.getUint32 ( byteOffset [ , littleEndian ] ) @@ -19,8 +17,8 @@ info: | ... 4. Let getIndex be ? ToIndex(requestIndex). ... - 7. Let buffer be view.[[ViewedArrayBuffer]]. - 8. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. + 6. Let buffer be view.[[ViewedArrayBuffer]]. + 7. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. ... includes: [detachArrayBuffer.js] ---*/ @@ -30,6 +28,10 @@ var sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); +assert.throws(RangeError, function() { + sample.getUint32(Infinity); +}, "Infinity"); + assert.throws(RangeError, function() { sample.getUint32(-1); }); diff --git a/test/built-ins/DataView/prototype/getUint32/detached-buffer-before-outofrange-byteoffset.js b/test/built-ins/DataView/prototype/getUint32/detached-buffer-before-outofrange-byteoffset.js index 3829c5e92d..be88a8b239 100644 --- a/test/built-ins/DataView/prototype/getUint32/detached-buffer-before-outofrange-byteoffset.js +++ b/test/built-ins/DataView/prototype/getUint32/detached-buffer-before-outofrange-byteoffset.js @@ -16,10 +16,10 @@ info: | 24.2.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type ) ... - 8. Let buffer be the value of view's [[ViewedArrayBuffer]] internal slot. - 9. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. + 6. Let buffer be view.[[ViewedArrayBuffer]]. + 7. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. ... - 13. If getIndex + elementSize > viewSize, throw a RangeError exception. + 11. If getIndex + elementSize > viewSize, throw a RangeError exception. ... includes: [detachArrayBuffer.js] ---*/ @@ -31,10 +31,6 @@ sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); -assert.throws(TypeError, function() { - sample.getUint32(Infinity); -}, "Infinity"); - assert.throws(TypeError, function() { sample.getUint32(13); }, "13"); diff --git a/test/built-ins/DataView/prototype/getUint8/detached-buffer-after-integer-byteoffset.js b/test/built-ins/DataView/prototype/getUint8/detached-buffer-after-toindex-byteoffset.js similarity index 72% rename from test/built-ins/DataView/prototype/getUint8/detached-buffer-after-integer-byteoffset.js rename to test/built-ins/DataView/prototype/getUint8/detached-buffer-after-toindex-byteoffset.js index 16581aaed9..363a60ba70 100644 --- a/test/built-ins/DataView/prototype/getUint8/detached-buffer-after-integer-byteoffset.js +++ b/test/built-ins/DataView/prototype/getUint8/detached-buffer-after-toindex-byteoffset.js @@ -3,10 +3,8 @@ /*--- esid: sec-dataview.prototype.getuint8 -es6id: 24.2.4.10 description: > - Detached buffer is checked after checking If numberIndex ≠ getIndex or - getIndex < 0, + Detached buffer is only checked after ToIndex(requestIndex) info: | 24.2.4.10 DataView.prototype.getUint8 ( byteOffset ) @@ -18,8 +16,8 @@ info: | ... 4. Let getIndex be ? ToIndex(requestIndex). ... - 7. Let buffer be view.[[ViewedArrayBuffer]]. - 8. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. + 6. Let buffer be view.[[ViewedArrayBuffer]]. + 7. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. ... includes: [detachArrayBuffer.js] ---*/ @@ -29,6 +27,10 @@ var sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); +assert.throws(RangeError, function() { + sample.getUint8(Infinity); +}, "Infinity"); + assert.throws(RangeError, function() { sample.getUint8(-1); }); diff --git a/test/built-ins/DataView/prototype/getUint8/detached-buffer-before-outofrange-byteoffset.js b/test/built-ins/DataView/prototype/getUint8/detached-buffer-before-outofrange-byteoffset.js index 18149bd2f5..98c8f0a67c 100644 --- a/test/built-ins/DataView/prototype/getUint8/detached-buffer-before-outofrange-byteoffset.js +++ b/test/built-ins/DataView/prototype/getUint8/detached-buffer-before-outofrange-byteoffset.js @@ -15,10 +15,10 @@ info: | 24.2.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type ) ... - 8. Let buffer be the value of view's [[ViewedArrayBuffer]] internal slot. - 9. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. + 6. Let buffer be view.[[ViewedArrayBuffer]]. + 7. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. ... - 13. If getIndex + elementSize > viewSize, throw a RangeError exception. + 11. If getIndex + elementSize > viewSize, throw a RangeError exception. ... includes: [detachArrayBuffer.js] ---*/ @@ -30,10 +30,6 @@ sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); -assert.throws(TypeError, function() { - sample.getUint8(Infinity); -}, "Infinity"); - assert.throws(TypeError, function() { sample.getUint8(13); }, "13"); diff --git a/test/built-ins/DataView/prototype/setFloat32/detached-buffer-after-integer-byteoffset.js b/test/built-ins/DataView/prototype/setFloat32/detached-buffer-after-toindex-byteoffset.js similarity index 85% rename from test/built-ins/DataView/prototype/setFloat32/detached-buffer-after-integer-byteoffset.js rename to test/built-ins/DataView/prototype/setFloat32/detached-buffer-after-toindex-byteoffset.js index 4e101c3bc7..c0d1d6d50c 100644 --- a/test/built-ins/DataView/prototype/setFloat32/detached-buffer-after-integer-byteoffset.js +++ b/test/built-ins/DataView/prototype/setFloat32/detached-buffer-after-toindex-byteoffset.js @@ -3,10 +3,8 @@ /*--- esid: sec-dataview.prototype.setfloat32 -es6id: 24.2.4.13 description: > - Detached buffer is checked after checking If numberIndex ≠ getIndex or - getIndex < 0 + Detached buffer is only checked after ToIndex(requestIndex) info: | 24.2.4.13 DataView.prototype.setFloat32 ( byteOffset, value [ , littleEndian ] ) @@ -30,6 +28,10 @@ var sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); +assert.throws(RangeError, function() { + sample.setFloat32(Infinity, 0); +}, "Infinity"); + assert.throws(RangeError, function() { sample.setFloat32(-1, 0); }); diff --git a/test/built-ins/DataView/prototype/setFloat32/detached-buffer-before-outofrange-byteoffset.js b/test/built-ins/DataView/prototype/setFloat32/detached-buffer-before-outofrange-byteoffset.js index 7bdfdc5c2f..260a282a8f 100644 --- a/test/built-ins/DataView/prototype/setFloat32/detached-buffer-before-outofrange-byteoffset.js +++ b/test/built-ins/DataView/prototype/setFloat32/detached-buffer-before-outofrange-byteoffset.js @@ -31,10 +31,6 @@ sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); -assert.throws(TypeError, function() { - sample.setFloat32(Infinity, 0); -}, "Infinity"); - assert.throws(TypeError, function() { sample.setFloat32(13, 0); }, "13"); diff --git a/test/built-ins/DataView/prototype/setFloat32/index-check-before-value-conversion.js b/test/built-ins/DataView/prototype/setFloat32/index-check-before-value-conversion.js index 34cf980535..bdf09e3d1c 100755 --- a/test/built-ins/DataView/prototype/setFloat32/index-check-before-value-conversion.js +++ b/test/built-ins/DataView/prototype/setFloat32/index-check-before-value-conversion.js @@ -35,3 +35,7 @@ assert.throws(RangeError, function() { assert.throws(RangeError, function() { dataView.setFloat32(-Infinity, poisoned); }, "setFloat32(-Infinity, poisoned)"); + +assert.throws(RangeError, function() { + dataView.setFloat32(Infinity, poisoned); +}, "setFloat32(Infinity, poisoned)"); diff --git a/test/built-ins/DataView/prototype/setFloat32/range-check-after-value-conversion.js b/test/built-ins/DataView/prototype/setFloat32/range-check-after-value-conversion.js index e048fdfa15..8a1b4013ef 100755 --- a/test/built-ins/DataView/prototype/setFloat32/range-check-after-value-conversion.js +++ b/test/built-ins/DataView/prototype/setFloat32/range-check-after-value-conversion.js @@ -30,18 +30,10 @@ var poisoned = { } }; -assert.throws(Test262Error, function() { - dataView.setFloat32(Infinity, poisoned); -}, "setFloat32(Infinity, poisoned)"); - assert.throws(Test262Error, function() { dataView.setFloat32(100, poisoned); }, "setFloat32(100, poisoned)"); -assert.throws(Test262Error, function() { - dataView.setFloat32('Infinity', poisoned); -}, "setFloat32('Infinity', poisoned)"); - assert.throws(Test262Error, function() { dataView.setFloat32('100', poisoned); }, "setFloat32('100', poisoned)"); diff --git a/test/built-ins/DataView/prototype/setFloat64/detached-buffer-after-integer-byteoffset.js b/test/built-ins/DataView/prototype/setFloat64/detached-buffer-after-toindex-byteoffset.js similarity index 86% rename from test/built-ins/DataView/prototype/setFloat64/detached-buffer-after-integer-byteoffset.js rename to test/built-ins/DataView/prototype/setFloat64/detached-buffer-after-toindex-byteoffset.js index 5a80f5641d..367c749def 100644 --- a/test/built-ins/DataView/prototype/setFloat64/detached-buffer-after-integer-byteoffset.js +++ b/test/built-ins/DataView/prototype/setFloat64/detached-buffer-after-toindex-byteoffset.js @@ -3,10 +3,8 @@ /*--- esid: sec-dataview.prototype.setfloat64 -es6id: 24.2.4.14 description: > - Detached buffer is checked after checking If numberIndex ≠ getIndex or - getIndex < 0 + Detached buffer is only checked after ToIndex(requestIndex) info: | 24.2.4.14 DataView.prototype.setFloat64 ( byteOffset, value [ , littleEndian ] ) @@ -30,6 +28,10 @@ var sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); +assert.throws(TypeError, function() { + sample.setFloat64(Infinity, 0); +}, "Infinity"); + assert.throws(RangeError, function() { sample.setFloat64(-1, 0); }); diff --git a/test/built-ins/DataView/prototype/setFloat64/detached-buffer-before-outofrange-byteoffset.js b/test/built-ins/DataView/prototype/setFloat64/detached-buffer-before-outofrange-byteoffset.js index dcbfa85211..841821d172 100644 --- a/test/built-ins/DataView/prototype/setFloat64/detached-buffer-before-outofrange-byteoffset.js +++ b/test/built-ins/DataView/prototype/setFloat64/detached-buffer-before-outofrange-byteoffset.js @@ -31,10 +31,6 @@ sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); -assert.throws(TypeError, function() { - sample.setFloat64(Infinity, 0); -}, "Infinity"); - assert.throws(TypeError, function() { sample.setFloat64(13, 0); }, "13"); diff --git a/test/built-ins/DataView/prototype/setFloat64/index-check-before-value-conversion.js b/test/built-ins/DataView/prototype/setFloat64/index-check-before-value-conversion.js index 5e66803fb7..792e8cc18a 100755 --- a/test/built-ins/DataView/prototype/setFloat64/index-check-before-value-conversion.js +++ b/test/built-ins/DataView/prototype/setFloat64/index-check-before-value-conversion.js @@ -36,3 +36,7 @@ assert.throws(RangeError, function() { assert.throws(RangeError, function() { dataView.setFloat64(-Infinity, poisoned); }, "setFloat64(-Infinity, poisoned)"); + +assert.throws(RangeError, function() { + dataView.setFloat64(Infinity, poisoned); +}, "setFloat64(Infinity, poisoned)"); diff --git a/test/built-ins/DataView/prototype/setFloat64/range-check-after-value-conversion.js b/test/built-ins/DataView/prototype/setFloat64/range-check-after-value-conversion.js index 5843fdc54c..3482407718 100755 --- a/test/built-ins/DataView/prototype/setFloat64/range-check-after-value-conversion.js +++ b/test/built-ins/DataView/prototype/setFloat64/range-check-after-value-conversion.js @@ -30,18 +30,10 @@ var poisoned = { } }; -assert.throws(Test262Error, function() { - dataView.setFloat64(Infinity, poisoned); -}, "setFloat64(Infinity, poisoned)"); - assert.throws(Test262Error, function() { dataView.setFloat64(100, poisoned); }, "setFloat64(100, poisoned)"); -assert.throws(Test262Error, function() { - dataView.setFloat64('Infinity', poisoned); -}, "setFloat64('Infinity', poisoned)"); - assert.throws(Test262Error, function() { dataView.setFloat64('100', poisoned); }, "setFloat64('100', poisoned)"); diff --git a/test/built-ins/DataView/prototype/setInt16/detached-buffer-after-integer-byteoffset.js b/test/built-ins/DataView/prototype/setInt16/detached-buffer-after-toindex-byteoffset.js similarity index 86% rename from test/built-ins/DataView/prototype/setInt16/detached-buffer-after-integer-byteoffset.js rename to test/built-ins/DataView/prototype/setInt16/detached-buffer-after-toindex-byteoffset.js index 765fd8b3e8..f193bde4fe 100644 --- a/test/built-ins/DataView/prototype/setInt16/detached-buffer-after-integer-byteoffset.js +++ b/test/built-ins/DataView/prototype/setInt16/detached-buffer-after-toindex-byteoffset.js @@ -3,10 +3,8 @@ /*--- esid: sec-dataview.prototype.setint16 -es6id: 24.2.4.16 description: > - Detached buffer is checked after checking If numberIndex ≠ getIndex or - getIndex < 0 + Detached buffer is only checked after ToIndex(requestIndex) info: | 24.2.4.16 DataView.prototype.setInt16 ( byteOffset, value [ , littleEndian ] ) @@ -30,6 +28,10 @@ var sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); +assert.throws(TypeError, function() { + sample.setInt16(Infinity, 0); +}, "Infinity"); + assert.throws(RangeError, function() { sample.setInt16(-1, 0); }); diff --git a/test/built-ins/DataView/prototype/setInt16/detached-buffer-before-outofrange-byteoffset.js b/test/built-ins/DataView/prototype/setInt16/detached-buffer-before-outofrange-byteoffset.js index bb47762117..04c3c53fa0 100644 --- a/test/built-ins/DataView/prototype/setInt16/detached-buffer-before-outofrange-byteoffset.js +++ b/test/built-ins/DataView/prototype/setInt16/detached-buffer-before-outofrange-byteoffset.js @@ -31,10 +31,6 @@ sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); -assert.throws(TypeError, function() { - sample.setInt16(Infinity, 0); -}, "Infinity"); - assert.throws(TypeError, function() { sample.setInt16(13, 0); }, "13"); diff --git a/test/built-ins/DataView/prototype/setInt16/index-check-before-value-conversion.js b/test/built-ins/DataView/prototype/setInt16/index-check-before-value-conversion.js index 826cbc8313..7a07fd8e64 100755 --- a/test/built-ins/DataView/prototype/setInt16/index-check-before-value-conversion.js +++ b/test/built-ins/DataView/prototype/setInt16/index-check-before-value-conversion.js @@ -36,3 +36,7 @@ assert.throws(RangeError, function() { assert.throws(RangeError, function() { dataView.setInt16(-Infinity, poisoned); }, "setInt16(-Infinity, poisoned)"); + +assert.throws(RangeError, function() { + dataView.setInt16(Infinity, poisoned); +}, "setInt16(Infinity, poisoned)"); diff --git a/test/built-ins/DataView/prototype/setInt16/range-check-after-value-conversion.js b/test/built-ins/DataView/prototype/setInt16/range-check-after-value-conversion.js index 7778ab7b76..043c2abd24 100755 --- a/test/built-ins/DataView/prototype/setInt16/range-check-after-value-conversion.js +++ b/test/built-ins/DataView/prototype/setInt16/range-check-after-value-conversion.js @@ -30,18 +30,10 @@ var poisoned = { } }; -assert.throws(Test262Error, function() { - dataView.setInt16(Infinity, poisoned); -}, "setInt16(Infinity, poisoned)"); - assert.throws(Test262Error, function() { dataView.setInt16(100, poisoned); }, "setInt16(100, poisoned)"); -assert.throws(Test262Error, function() { - dataView.setInt16('Infinity', poisoned); -}, "setInt16('Infinity', poisoned)"); - assert.throws(Test262Error, function() { dataView.setInt16('100', poisoned); }, "setInt16('100', poisoned)"); diff --git a/test/built-ins/DataView/prototype/setInt32/detached-buffer-after-integer-byteoffset.js b/test/built-ins/DataView/prototype/setInt32/detached-buffer-after-toindex-byteoffset.js similarity index 85% rename from test/built-ins/DataView/prototype/setInt32/detached-buffer-after-integer-byteoffset.js rename to test/built-ins/DataView/prototype/setInt32/detached-buffer-after-toindex-byteoffset.js index 128e66b0db..9e9ca06027 100644 --- a/test/built-ins/DataView/prototype/setInt32/detached-buffer-after-integer-byteoffset.js +++ b/test/built-ins/DataView/prototype/setInt32/detached-buffer-after-toindex-byteoffset.js @@ -3,10 +3,8 @@ /*--- esid: sec-dataview.prototype.setint32 -es6id: 24.2.4.17 description: > - Detached buffer is checked after checking If numberIndex ≠ getIndex or - getIndex < 0 + Detached buffer is only checked after ToIndex(requestIndex) info: | 24.2.4.17 DataView.prototype.setInt32 ( byteOffset, value [ , littleEndian ] ) @@ -30,6 +28,10 @@ var sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); +assert.throws(RangeError, function() { + sample.setInt32(Infinity, 0); +}, "Infinity"); + assert.throws(RangeError, function() { sample.setInt32(-1, 0); }); diff --git a/test/built-ins/DataView/prototype/setInt32/detached-buffer-before-outofrange-byteoffset.js b/test/built-ins/DataView/prototype/setInt32/detached-buffer-before-outofrange-byteoffset.js index 8a74c2a374..6fa4663dd5 100644 --- a/test/built-ins/DataView/prototype/setInt32/detached-buffer-before-outofrange-byteoffset.js +++ b/test/built-ins/DataView/prototype/setInt32/detached-buffer-before-outofrange-byteoffset.js @@ -31,10 +31,6 @@ sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); -assert.throws(TypeError, function() { - sample.setInt32(Infinity, 0); -}, "Infinity"); - assert.throws(TypeError, function() { sample.setInt32(13, 0); }, "13"); diff --git a/test/built-ins/DataView/prototype/setInt32/index-check-before-value-conversion.js b/test/built-ins/DataView/prototype/setInt32/index-check-before-value-conversion.js index ee0adecbf3..8fa67a3a88 100755 --- a/test/built-ins/DataView/prototype/setInt32/index-check-before-value-conversion.js +++ b/test/built-ins/DataView/prototype/setInt32/index-check-before-value-conversion.js @@ -36,3 +36,7 @@ assert.throws(RangeError, function() { assert.throws(RangeError, function() { dataView.setInt32(-Infinity, poisoned); }, "setInt32(-Infinity, poisoned)"); + +assert.throws(RangeError, function() { + dataView.setInt32(Infinity, poisoned); +}, "setInt32(Infinity, poisoned)"); diff --git a/test/built-ins/DataView/prototype/setInt32/range-check-after-value-conversion.js b/test/built-ins/DataView/prototype/setInt32/range-check-after-value-conversion.js index 951de20ba0..a514260a47 100755 --- a/test/built-ins/DataView/prototype/setInt32/range-check-after-value-conversion.js +++ b/test/built-ins/DataView/prototype/setInt32/range-check-after-value-conversion.js @@ -30,18 +30,10 @@ var poisoned = { } }; -assert.throws(Test262Error, function() { - dataView.setInt32(Infinity, poisoned); -}, "setInt32(Infinity, poisoned)"); - assert.throws(Test262Error, function() { dataView.setInt32(100, poisoned); }, "setInt32(100, poisoned)"); -assert.throws(Test262Error, function() { - dataView.setInt32('Infinity', poisoned); -}, "setInt32('Infinity', poisoned)"); - assert.throws(Test262Error, function() { dataView.setInt32('100', poisoned); }, "setInt32('100', poisoned)"); diff --git a/test/built-ins/DataView/prototype/setInt8/detached-buffer-after-integer-byteoffset.js b/test/built-ins/DataView/prototype/setInt8/detached-buffer-after-toindex-byteoffset.js similarity index 84% rename from test/built-ins/DataView/prototype/setInt8/detached-buffer-after-integer-byteoffset.js rename to test/built-ins/DataView/prototype/setInt8/detached-buffer-after-toindex-byteoffset.js index 55eddc992a..9f04182efa 100644 --- a/test/built-ins/DataView/prototype/setInt8/detached-buffer-after-integer-byteoffset.js +++ b/test/built-ins/DataView/prototype/setInt8/detached-buffer-after-toindex-byteoffset.js @@ -3,10 +3,8 @@ /*--- esid: sec-dataview.prototype.setint8 -es6id: 24.2.4.15 description: > - Detached buffer is checked after checking If numberIndex ≠ getIndex or - getIndex < 0 + Detached buffer is only checked after ToIndex(requestIndex) info: | 24.2.4.15 DataView.prototype.setInt8 ( byteOffset, value ) @@ -29,6 +27,10 @@ var sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); +assert.throws(RangeError, function() { + sample.setInt8(Infinity, 0); +}, "Infinity"); + assert.throws(RangeError, function() { sample.setInt8(-1, 0); }); diff --git a/test/built-ins/DataView/prototype/setInt8/detached-buffer-before-outofrange-byteoffset.js b/test/built-ins/DataView/prototype/setInt8/detached-buffer-before-outofrange-byteoffset.js index a1ff142587..6fe8abf4c2 100644 --- a/test/built-ins/DataView/prototype/setInt8/detached-buffer-before-outofrange-byteoffset.js +++ b/test/built-ins/DataView/prototype/setInt8/detached-buffer-before-outofrange-byteoffset.js @@ -30,10 +30,6 @@ sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); -assert.throws(TypeError, function() { - sample.setInt8(Infinity, 0); -}, "Infinity"); - assert.throws(TypeError, function() { sample.setInt8(13, 0); }, "13"); diff --git a/test/built-ins/DataView/prototype/setInt8/index-check-before-value-conversion.js b/test/built-ins/DataView/prototype/setInt8/index-check-before-value-conversion.js index ca6ce0c5a9..1766d04eb1 100755 --- a/test/built-ins/DataView/prototype/setInt8/index-check-before-value-conversion.js +++ b/test/built-ins/DataView/prototype/setInt8/index-check-before-value-conversion.js @@ -36,3 +36,7 @@ assert.throws(RangeError, function() { assert.throws(RangeError, function() { dataView.setInt8(-Infinity, poisoned); }, "setInt8(-Infinity, poisoned)"); + +assert.throws(RangeError, function() { + dataView.setInt8(Infinity, poisoned); +}, "setInt8(Infinity, poisoned)"); diff --git a/test/built-ins/DataView/prototype/setInt8/range-check-after-value-conversion.js b/test/built-ins/DataView/prototype/setInt8/range-check-after-value-conversion.js index d723d74341..a41d72e9a6 100755 --- a/test/built-ins/DataView/prototype/setInt8/range-check-after-value-conversion.js +++ b/test/built-ins/DataView/prototype/setInt8/range-check-after-value-conversion.js @@ -30,18 +30,10 @@ var poisoned = { } }; -assert.throws(Test262Error, function() { - dataView.setInt8(Infinity, poisoned); -}, "setInt8(Infinity, poisoned)"); - assert.throws(Test262Error, function() { dataView.setInt8(100, poisoned); }, "setInt8(100, poisoned)"); -assert.throws(Test262Error, function() { - dataView.setInt8('Infinity', poisoned); -}, "setInt8('Infinity', poisoned)"); - assert.throws(Test262Error, function() { dataView.setInt8('100', poisoned); }, "setInt8('100', poisoned)"); diff --git a/test/built-ins/DataView/prototype/setUint16/detached-buffer-after-integer-byteoffset.js b/test/built-ins/DataView/prototype/setUint16/detached-buffer-after-toindex-byteoffset.js similarity index 85% rename from test/built-ins/DataView/prototype/setUint16/detached-buffer-after-integer-byteoffset.js rename to test/built-ins/DataView/prototype/setUint16/detached-buffer-after-toindex-byteoffset.js index 86f4be4bd9..07348e275c 100644 --- a/test/built-ins/DataView/prototype/setUint16/detached-buffer-after-integer-byteoffset.js +++ b/test/built-ins/DataView/prototype/setUint16/detached-buffer-after-toindex-byteoffset.js @@ -3,10 +3,8 @@ /*--- esid: sec-dataview.prototype.setuint16 -es6id: 24.2.4.19 description: > - Detached buffer is checked after checking If numberIndex ≠ getIndex or - getIndex < 0 + Detached buffer is only checked after ToIndex(requestIndex) info: | 24.2.4.19 DataView.prototype.setUint16 ( byteOffset, value [ , littleEndian ] ) @@ -30,6 +28,10 @@ var sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); +assert.throws(RangeError, function() { + sample.setUint16(Infinity, 0); +}, "Infinity"); + assert.throws(RangeError, function() { sample.setUint16(-1, 0); }); diff --git a/test/built-ins/DataView/prototype/setUint16/detached-buffer-before-outofrange-byteoffset.js b/test/built-ins/DataView/prototype/setUint16/detached-buffer-before-outofrange-byteoffset.js index eaf3581edc..203c619d77 100644 --- a/test/built-ins/DataView/prototype/setUint16/detached-buffer-before-outofrange-byteoffset.js +++ b/test/built-ins/DataView/prototype/setUint16/detached-buffer-before-outofrange-byteoffset.js @@ -31,10 +31,6 @@ sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); -assert.throws(TypeError, function() { - sample.setUint16(Infinity, 0); -}, "Infinity"); - assert.throws(TypeError, function() { sample.setUint16(13, 0); }, "13"); diff --git a/test/built-ins/DataView/prototype/setUint16/index-check-before-value-conversion.js b/test/built-ins/DataView/prototype/setUint16/index-check-before-value-conversion.js index 6fed3d7b4f..544459a974 100755 --- a/test/built-ins/DataView/prototype/setUint16/index-check-before-value-conversion.js +++ b/test/built-ins/DataView/prototype/setUint16/index-check-before-value-conversion.js @@ -36,3 +36,7 @@ assert.throws(RangeError, function() { assert.throws(RangeError, function() { dataView.setUint16(-Infinity, poisoned); }, "setUint16(-Infinity, poisoned)"); + +assert.throws(RangeError, function() { + dataView.setUint16(Infinity, poisoned); +}, "setUint16(Infinity, poisoned)"); diff --git a/test/built-ins/DataView/prototype/setUint16/range-check-after-value-conversion.js b/test/built-ins/DataView/prototype/setUint16/range-check-after-value-conversion.js index de7bbbec2c..09a67898c6 100755 --- a/test/built-ins/DataView/prototype/setUint16/range-check-after-value-conversion.js +++ b/test/built-ins/DataView/prototype/setUint16/range-check-after-value-conversion.js @@ -30,18 +30,10 @@ var poisoned = { } }; -assert.throws(Test262Error, function() { - dataView.setUint16(Infinity, poisoned); -}, "setUint16(Infinity, poisoned)"); - assert.throws(Test262Error, function() { dataView.setUint16(100, poisoned); }, "setUint16(100, poisoned)"); -assert.throws(Test262Error, function() { - dataView.setUint16('Infinity', poisoned); -}, "setUint16('Infinity', poisoned)"); - assert.throws(Test262Error, function() { dataView.setUint16('100', poisoned); }, "setUint16('100', poisoned)"); diff --git a/test/built-ins/DataView/prototype/setUint32/detached-buffer-after-integer-byteoffset.js b/test/built-ins/DataView/prototype/setUint32/detached-buffer-after-toindex-byteoffset.js similarity index 85% rename from test/built-ins/DataView/prototype/setUint32/detached-buffer-after-integer-byteoffset.js rename to test/built-ins/DataView/prototype/setUint32/detached-buffer-after-toindex-byteoffset.js index 7c9472078a..47043e6bbc 100644 --- a/test/built-ins/DataView/prototype/setUint32/detached-buffer-after-integer-byteoffset.js +++ b/test/built-ins/DataView/prototype/setUint32/detached-buffer-after-toindex-byteoffset.js @@ -3,10 +3,8 @@ /*--- esid: sec-dataview.prototype.setuint32 -es6id: 24.2.4.20 description: > - Detached buffer is checked after checking If numberIndex ≠ getIndex or - getIndex < 0 + Detached buffer is only checked after ToIndex(requestIndex) info: | 24.2.4.20 DataView.prototype.setUint32 ( byteOffset, value [ , littleEndian ] ) @@ -30,6 +28,10 @@ var sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); +assert.throws(RangeError, function() { + sample.setUint32(Infinity, 0); +}, "Infinity"); + assert.throws(RangeError, function() { sample.setUint32(-1, 0); }); diff --git a/test/built-ins/DataView/prototype/setUint32/detached-buffer-before-outofrange-byteoffset.js b/test/built-ins/DataView/prototype/setUint32/detached-buffer-before-outofrange-byteoffset.js index 7c48893667..a54d239559 100644 --- a/test/built-ins/DataView/prototype/setUint32/detached-buffer-before-outofrange-byteoffset.js +++ b/test/built-ins/DataView/prototype/setUint32/detached-buffer-before-outofrange-byteoffset.js @@ -31,10 +31,6 @@ sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); -assert.throws(TypeError, function() { - sample.setUint32(Infinity, 0); -}, "Infinity"); - assert.throws(TypeError, function() { sample.setUint32(13, 0); }, "13"); diff --git a/test/built-ins/DataView/prototype/setUint32/index-check-before-value-conversion.js b/test/built-ins/DataView/prototype/setUint32/index-check-before-value-conversion.js index 7bbab801d3..115b9a4b49 100755 --- a/test/built-ins/DataView/prototype/setUint32/index-check-before-value-conversion.js +++ b/test/built-ins/DataView/prototype/setUint32/index-check-before-value-conversion.js @@ -36,3 +36,7 @@ assert.throws(RangeError, function() { assert.throws(RangeError, function() { dataView.setUint32(-Infinity, poisoned); }, "setUint32(-Infinity, poisoned)"); + +assert.throws(RangeError, function() { + dataView.setUint32(Infinity, poisoned); +}, "setUint32(Infinity, poisoned)"); diff --git a/test/built-ins/DataView/prototype/setUint32/range-check-after-value-conversion.js b/test/built-ins/DataView/prototype/setUint32/range-check-after-value-conversion.js index be32633578..03155eacdd 100755 --- a/test/built-ins/DataView/prototype/setUint32/range-check-after-value-conversion.js +++ b/test/built-ins/DataView/prototype/setUint32/range-check-after-value-conversion.js @@ -30,18 +30,10 @@ var poisoned = { } }; -assert.throws(Test262Error, function() { - dataView.setUint32(Infinity, poisoned); -}, "setUint32(Infinity, poisoned)"); - assert.throws(Test262Error, function() { dataView.setUint32(100, poisoned); }, "setUint32(100, poisoned)"); -assert.throws(Test262Error, function() { - dataView.setUint32('Infinity', poisoned); -}, "setUint32('Infinity', poisoned)"); - assert.throws(Test262Error, function() { dataView.setUint32('100', poisoned); }, "setUint32('100', poisoned)"); diff --git a/test/built-ins/DataView/prototype/setUint8/detached-buffer-after-integer-byteoffset.js b/test/built-ins/DataView/prototype/setUint8/detached-buffer-after-toindex-byteoffset.js similarity index 84% rename from test/built-ins/DataView/prototype/setUint8/detached-buffer-after-integer-byteoffset.js rename to test/built-ins/DataView/prototype/setUint8/detached-buffer-after-toindex-byteoffset.js index 952947f45f..acdc80f250 100644 --- a/test/built-ins/DataView/prototype/setUint8/detached-buffer-after-integer-byteoffset.js +++ b/test/built-ins/DataView/prototype/setUint8/detached-buffer-after-toindex-byteoffset.js @@ -3,10 +3,8 @@ /*--- esid: sec-dataview.prototype.setuint8 -es6id: 24.2.4.18 description: > - Detached buffer is checked after checking If numberIndex ≠ getIndex or - getIndex < 0 + Detached buffer is only checked after ToIndex(requestIndex) info: | 24.2.4.18 DataView.prototype.setUint8 ( byteOffset, value ) @@ -29,6 +27,10 @@ var sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); +assert.throws(RangeError, function() { + sample.setUint8(Infinity, 0); +}, "Infinity"); + assert.throws(RangeError, function() { sample.setUint8(-1, 0); }); diff --git a/test/built-ins/DataView/prototype/setUint8/detached-buffer-before-outofrange-byteoffset.js b/test/built-ins/DataView/prototype/setUint8/detached-buffer-before-outofrange-byteoffset.js index 99fb2687b0..05cd2a91a1 100644 --- a/test/built-ins/DataView/prototype/setUint8/detached-buffer-before-outofrange-byteoffset.js +++ b/test/built-ins/DataView/prototype/setUint8/detached-buffer-before-outofrange-byteoffset.js @@ -30,10 +30,6 @@ sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); -assert.throws(TypeError, function() { - sample.setUint8(Infinity, 0); -}, "Infinity"); - assert.throws(TypeError, function() { sample.setUint8(13, 0); }, "13"); diff --git a/test/built-ins/DataView/prototype/setUint8/index-check-before-value-conversion.js b/test/built-ins/DataView/prototype/setUint8/index-check-before-value-conversion.js index d1a93d452b..34690136ee 100755 --- a/test/built-ins/DataView/prototype/setUint8/index-check-before-value-conversion.js +++ b/test/built-ins/DataView/prototype/setUint8/index-check-before-value-conversion.js @@ -36,3 +36,7 @@ assert.throws(RangeError, function() { assert.throws(RangeError, function() { dataView.setUint8(-Infinity, poisoned); }, "setUint8(-Infinity, poisoned)"); + +assert.throws(RangeError, function() { + dataView.setUint8(Infinity, poisoned); +}, "setUint8(Infinity, poisoned)"); diff --git a/test/built-ins/DataView/prototype/setUint8/range-check-after-value-conversion.js b/test/built-ins/DataView/prototype/setUint8/range-check-after-value-conversion.js index c22efa0bf1..d377b99e0f 100755 --- a/test/built-ins/DataView/prototype/setUint8/range-check-after-value-conversion.js +++ b/test/built-ins/DataView/prototype/setUint8/range-check-after-value-conversion.js @@ -30,18 +30,10 @@ var poisoned = { } }; -assert.throws(Test262Error, function() { - dataView.setUint8(Infinity, poisoned); -}, "setUint8(Infinity, poisoned)"); - assert.throws(Test262Error, function() { dataView.setUint8(100, poisoned); }, "setUint8(100, poisoned)"); -assert.throws(Test262Error, function() { - dataView.setUint8('Infinity', poisoned); -}, "setUint8('Infinity', poisoned)"); - assert.throws(Test262Error, function() { dataView.setUint8('100', poisoned); }, "setUint8('100', poisoned)");