mirror of https://github.com/tc39/test262.git
improve error messages
This commit is contained in:
parent
cca3876881
commit
2892cc78c7
|
@ -29,6 +29,8 @@ var sample = new DataView(buffer, 0);
|
|||
|
||||
$DETACHBUFFER(buffer);
|
||||
|
||||
assert.throws(RangeError, () => sample.getBigInt64(Infinity), "Infinity");
|
||||
assert.throws(RangeError, () => sample.getBigInt64(Infinity),
|
||||
"DataView access at index Infinity should throw");
|
||||
|
||||
assert.throws(RangeError, () => sample.getBigInt64(-1), "-1");
|
||||
assert.throws(RangeError, () => sample.getBigInt64(-1),
|
||||
"DataView access at index -1 should throw");
|
||||
|
|
|
@ -31,4 +31,5 @@ sample = new DataView(buffer, 0);
|
|||
|
||||
$DETACHBUFFER(buffer);
|
||||
|
||||
assert.throws(TypeError, () => sample.getBigInt64(13), "13");
|
||||
assert.throws(TypeError, () => sample.getBigInt64(13),
|
||||
"detached DataView access should throw");
|
||||
|
|
|
@ -26,4 +26,5 @@ var buffer = new ArrayBuffer(1);
|
|||
var sample = new DataView(buffer, 0);
|
||||
|
||||
$DETACHBUFFER(buffer);
|
||||
assert.throws(TypeError, () => sample.getBigInt64(0), "0");
|
||||
assert.throws(TypeError, () => sample.getBigInt64(0),
|
||||
"detached DataView access should throw");
|
||||
|
|
|
@ -30,7 +30,7 @@ var buffer = new ArrayBuffer(12);
|
|||
sample = new DataView(buffer, 0);
|
||||
|
||||
assert.throws(RangeError, () => sample.getBigInt64(Infinity),
|
||||
"Infinity");
|
||||
"DataView access at index Infinity should throw");
|
||||
|
||||
assert.throws(RangeError, () => sample.getBigInt64(13), "13 + 8 > 12");
|
||||
|
||||
|
|
|
@ -23,7 +23,8 @@ features: [DataView, ArrayBuffer, BigInt, arrow-function]
|
|||
var buffer = new ArrayBuffer(12);
|
||||
var sample = new DataView(buffer, 0);
|
||||
|
||||
assert.throws(RangeError, () => sample.getBigInt64(-1), "-1");
|
||||
assert.throws(RangeError, () => sample.getBigInt64(-1),
|
||||
"DataView access at index -1 should throw");
|
||||
|
||||
assert.throws(RangeError, () => sample.getBigInt64(-Infinity),
|
||||
"-Infinity");
|
||||
"DataView access at index -Infinity should throw");
|
||||
|
|
Loading…
Reference in New Issue