mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Merge pull request #699 from bocoup/685-range-check
Fix range check tests for DataView#set methods
This commit is contained in:
commit
e3ae1c88ff
@ -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");
|
@ -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");
|
||||
|
@ -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");
|
@ -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");
|
||||
|
@ -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);
|
||||
});
|
@ -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");
|
||||
|
@ -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);
|
||||
});
|
@ -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");
|
||||
|
@ -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);
|
||||
});
|
@ -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");
|
||||
|
@ -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);
|
||||
});
|
@ -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");
|
||||
|
@ -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);
|
||||
});
|
@ -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");
|
||||
|
@ -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);
|
||||
});
|
@ -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");
|
||||
|
@ -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);
|
||||
});
|
@ -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");
|
||||
|
@ -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)");
|
||||
|
@ -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)");
|
||||
|
@ -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);
|
||||
});
|
@ -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");
|
||||
|
@ -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)");
|
||||
|
@ -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)");
|
||||
|
@ -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);
|
||||
});
|
@ -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");
|
||||
|
@ -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)");
|
||||
|
@ -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)");
|
||||
|
@ -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);
|
||||
});
|
@ -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");
|
||||
|
@ -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)");
|
||||
|
@ -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)");
|
||||
|
@ -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);
|
||||
});
|
@ -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");
|
||||
|
@ -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)");
|
||||
|
@ -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)");
|
||||
|
@ -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);
|
||||
});
|
@ -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");
|
||||
|
@ -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)");
|
||||
|
@ -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)");
|
||||
|
@ -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);
|
||||
});
|
@ -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");
|
||||
|
@ -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)");
|
||||
|
@ -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)");
|
||||
|
@ -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);
|
||||
});
|
@ -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");
|
||||
|
@ -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)");
|
||||
|
@ -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)");
|
||||
|
Loading…
x
Reference in New Issue
Block a user