From 5525a64fbbf1a4c7fc8defa421e9e7c43e847ad7 Mon Sep 17 00:00:00 2001 From: Leonardo Balter Date: Wed, 6 Jul 2016 14:37:34 -0300 Subject: [PATCH] Update DataView method tests for detached buffer check order --- ...s => detached-buffer-after-toindex-byteoffset.js} | 12 +++++++----- .../detached-buffer-before-outofrange-byteoffset.js | 10 +++------- ...s => detached-buffer-after-toindex-byteoffset.js} | 12 +++++++----- .../detached-buffer-before-outofrange-byteoffset.js | 10 +++------- ...s => detached-buffer-after-toindex-byteoffset.js} | 12 +++++++----- .../detached-buffer-before-outofrange-byteoffset.js | 10 +++------- ...s => detached-buffer-after-toindex-byteoffset.js} | 12 +++++++----- .../detached-buffer-before-outofrange-byteoffset.js | 10 +++------- ...s => detached-buffer-after-toindex-byteoffset.js} | 12 +++++++----- .../detached-buffer-before-outofrange-byteoffset.js | 10 +++------- ...s => detached-buffer-after-toindex-byteoffset.js} | 12 +++++++----- .../detached-buffer-before-outofrange-byteoffset.js | 10 +++------- ...s => detached-buffer-after-toindex-byteoffset.js} | 12 +++++++----- .../detached-buffer-before-outofrange-byteoffset.js | 10 +++------- ...s => detached-buffer-after-toindex-byteoffset.js} | 12 +++++++----- .../detached-buffer-before-outofrange-byteoffset.js | 10 +++------- ...s => detached-buffer-after-toindex-byteoffset.js} | 8 +++++--- .../detached-buffer-before-outofrange-byteoffset.js | 4 ---- ...s => detached-buffer-after-toindex-byteoffset.js} | 8 +++++--- .../detached-buffer-before-outofrange-byteoffset.js | 4 ---- ...s => detached-buffer-after-toindex-byteoffset.js} | 8 +++++--- .../detached-buffer-before-outofrange-byteoffset.js | 4 ---- ...s => detached-buffer-after-toindex-byteoffset.js} | 8 +++++--- .../detached-buffer-before-outofrange-byteoffset.js | 4 ---- ...s => detached-buffer-after-toindex-byteoffset.js} | 8 +++++--- .../detached-buffer-before-outofrange-byteoffset.js | 4 ---- ...s => detached-buffer-after-toindex-byteoffset.js} | 8 +++++--- .../detached-buffer-before-outofrange-byteoffset.js | 4 ---- ...s => detached-buffer-after-toindex-byteoffset.js} | 8 +++++--- .../detached-buffer-before-outofrange-byteoffset.js | 4 ---- ...s => detached-buffer-after-toindex-byteoffset.js} | 8 +++++--- .../detached-buffer-before-outofrange-byteoffset.js | 4 ---- 32 files changed, 120 insertions(+), 152 deletions(-) rename test/built-ins/DataView/prototype/getFloat32/{detached-buffer-after-integer-byteoffset.js => detached-buffer-after-toindex-byteoffset.js} (75%) rename test/built-ins/DataView/prototype/getFloat64/{detached-buffer-after-integer-byteoffset.js => detached-buffer-after-toindex-byteoffset.js} (75%) rename test/built-ins/DataView/prototype/getInt16/{detached-buffer-after-integer-byteoffset.js => detached-buffer-after-toindex-byteoffset.js} (75%) rename test/built-ins/DataView/prototype/getInt32/{detached-buffer-after-integer-byteoffset.js => detached-buffer-after-toindex-byteoffset.js} (75%) rename test/built-ins/DataView/prototype/getInt8/{detached-buffer-after-integer-byteoffset.js => detached-buffer-after-toindex-byteoffset.js} (72%) rename test/built-ins/DataView/prototype/getUint16/{detached-buffer-after-integer-byteoffset.js => detached-buffer-after-toindex-byteoffset.js} (75%) rename test/built-ins/DataView/prototype/getUint32/{detached-buffer-after-integer-byteoffset.js => detached-buffer-after-toindex-byteoffset.js} (75%) rename test/built-ins/DataView/prototype/getUint8/{detached-buffer-after-integer-byteoffset.js => detached-buffer-after-toindex-byteoffset.js} (72%) rename test/built-ins/DataView/prototype/setFloat32/{detached-buffer-after-integer-byteoffset.js => detached-buffer-after-toindex-byteoffset.js} (85%) rename test/built-ins/DataView/prototype/setFloat64/{detached-buffer-after-integer-byteoffset.js => detached-buffer-after-toindex-byteoffset.js} (86%) rename test/built-ins/DataView/prototype/setInt16/{detached-buffer-after-integer-byteoffset.js => detached-buffer-after-toindex-byteoffset.js} (86%) rename test/built-ins/DataView/prototype/setInt32/{detached-buffer-after-integer-byteoffset.js => detached-buffer-after-toindex-byteoffset.js} (85%) rename test/built-ins/DataView/prototype/setInt8/{detached-buffer-after-integer-byteoffset.js => detached-buffer-after-toindex-byteoffset.js} (84%) rename test/built-ins/DataView/prototype/setUint16/{detached-buffer-after-integer-byteoffset.js => detached-buffer-after-toindex-byteoffset.js} (85%) rename test/built-ins/DataView/prototype/setUint32/{detached-buffer-after-integer-byteoffset.js => detached-buffer-after-toindex-byteoffset.js} (85%) rename test/built-ins/DataView/prototype/setUint8/{detached-buffer-after-integer-byteoffset.js => detached-buffer-after-toindex-byteoffset.js} (84%) 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/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/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/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/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/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/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/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");