mirror of
https://github.com/tc39/test262.git
synced 2025-07-26 23:44:27 +02:00
built-ins/DataView/*: make all indentation consistent (depth & character) (#1416)
This commit is contained in:
parent
a7ab6b4fd5
commit
4b5f07a9ff
@ -30,7 +30,7 @@ var sample = new DataView(buffer, 0);
|
|||||||
$DETACHBUFFER(buffer);
|
$DETACHBUFFER(buffer);
|
||||||
|
|
||||||
assert.throws(RangeError, () => sample.getBigInt64(Infinity),
|
assert.throws(RangeError, () => sample.getBigInt64(Infinity),
|
||||||
"DataView access at index Infinity should throw");
|
"DataView access at index Infinity should throw");
|
||||||
|
|
||||||
assert.throws(RangeError, () => sample.getBigInt64(-1),
|
assert.throws(RangeError, () => sample.getBigInt64(-1),
|
||||||
"DataView access at index -1 should throw");
|
"DataView access at index -1 should throw");
|
||||||
|
@ -32,4 +32,4 @@ sample = new DataView(buffer, 0);
|
|||||||
$DETACHBUFFER(buffer);
|
$DETACHBUFFER(buffer);
|
||||||
|
|
||||||
assert.throws(TypeError, () => sample.getBigInt64(13),
|
assert.throws(TypeError, () => sample.getBigInt64(13),
|
||||||
"detached DataView access should throw");
|
"detached DataView access should throw");
|
||||||
|
@ -27,4 +27,4 @@ var sample = new DataView(buffer, 0);
|
|||||||
|
|
||||||
$DETACHBUFFER(buffer);
|
$DETACHBUFFER(buffer);
|
||||||
assert.throws(TypeError, () => sample.getBigInt64(0),
|
assert.throws(TypeError, () => sample.getBigInt64(0),
|
||||||
"detached DataView access should throw");
|
"detached DataView access should throw");
|
||||||
|
@ -30,7 +30,7 @@ var buffer = new ArrayBuffer(12);
|
|||||||
sample = new DataView(buffer, 0);
|
sample = new DataView(buffer, 0);
|
||||||
|
|
||||||
assert.throws(RangeError, () => sample.getBigInt64(Infinity),
|
assert.throws(RangeError, () => sample.getBigInt64(Infinity),
|
||||||
"DataView access at index Infinity should throw");
|
"DataView access at index Infinity should throw");
|
||||||
|
|
||||||
assert.throws(RangeError, () => sample.getBigInt64(13), "13 + 8 > 12");
|
assert.throws(RangeError, () => sample.getBigInt64(13), "13 + 8 > 12");
|
||||||
|
|
||||||
@ -52,24 +52,24 @@ assert.throws(RangeError, () => sample.getBigInt64(5), "5 + 8 > 12");
|
|||||||
|
|
||||||
sample = new DataView(buffer, 8);
|
sample = new DataView(buffer, 8);
|
||||||
assert.throws(RangeError, () => sample.getBigInt64(1),
|
assert.throws(RangeError, () => sample.getBigInt64(1),
|
||||||
"1 + 8 > 4 (offset)");
|
"1 + 8 > 4 (offset)");
|
||||||
|
|
||||||
sample = new DataView(buffer, 9);
|
sample = new DataView(buffer, 9);
|
||||||
assert.throws(RangeError, () => sample.getBigInt64(0),
|
assert.throws(RangeError, () => sample.getBigInt64(0),
|
||||||
"0 + 8 > 3 (offset)");
|
"0 + 8 > 3 (offset)");
|
||||||
|
|
||||||
sample = new DataView(buffer, 0, 8);
|
sample = new DataView(buffer, 0, 8);
|
||||||
assert.throws(RangeError, () => sample.getBigInt64(1),
|
assert.throws(RangeError, () => sample.getBigInt64(1),
|
||||||
"1 + 8 > 8 (length)");
|
"1 + 8 > 8 (length)");
|
||||||
|
|
||||||
sample = new DataView(buffer, 0, 7);
|
sample = new DataView(buffer, 0, 7);
|
||||||
assert.throws(RangeError, () => sample.getBigInt64(0),
|
assert.throws(RangeError, () => sample.getBigInt64(0),
|
||||||
"0 + 8 > 7 (length)");
|
"0 + 8 > 7 (length)");
|
||||||
|
|
||||||
sample = new DataView(buffer, 4, 8);
|
sample = new DataView(buffer, 4, 8);
|
||||||
assert.throws(RangeError, () => sample.getBigInt64(1),
|
assert.throws(RangeError, () => sample.getBigInt64(1),
|
||||||
"1 + 8 > 8 (offset+length)");
|
"1 + 8 > 8 (offset+length)");
|
||||||
|
|
||||||
sample = new DataView(buffer, 4, 7);
|
sample = new DataView(buffer, 4, 7);
|
||||||
assert.throws(RangeError, () => sample.getBigInt64(0),
|
assert.throws(RangeError, () => sample.getBigInt64(0),
|
||||||
"0 + 8 > 7 (offset+length)");
|
"0 + 8 > 7 (offset+length)");
|
||||||
|
@ -24,7 +24,7 @@ var buffer = new ArrayBuffer(12);
|
|||||||
var sample = new DataView(buffer, 0);
|
var sample = new DataView(buffer, 0);
|
||||||
|
|
||||||
assert.throws(RangeError, () => sample.getBigInt64(-1),
|
assert.throws(RangeError, () => sample.getBigInt64(-1),
|
||||||
"DataView access at index -1 should throw");
|
"DataView access at index -1 should throw");
|
||||||
|
|
||||||
assert.throws(RangeError, () => sample.getBigInt64(-Infinity),
|
assert.throws(RangeError, () => sample.getBigInt64(-Infinity),
|
||||||
"DataView access at index -Infinity should throw");
|
"DataView access at index -Infinity should throw");
|
||||||
|
@ -23,8 +23,16 @@ features: [DataView, ArrayBuffer, BigInt, arrow-function]
|
|||||||
var buffer = new ArrayBuffer(1);
|
var buffer = new ArrayBuffer(1);
|
||||||
var sample = new DataView(buffer, 0);
|
var sample = new DataView(buffer, 0);
|
||||||
|
|
||||||
var bo1 = { valueOf() { throw new Test262Error(); } };
|
var bo1 = {
|
||||||
var bo2 = { toString() { throw new Test262Error(); } };
|
valueOf() {
|
||||||
|
throw new Test262Error();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var bo2 = {
|
||||||
|
toString() {
|
||||||
|
throw new Test262Error();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
assert.throws(Test262Error, () => sample.getBigInt64(bo1), "valueOf");
|
assert.throws(Test262Error, () => sample.getBigInt64(bo1), "valueOf");
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ features: [DataView, ArrayBuffer, Symbol, BigInt, arrow-function]
|
|||||||
var getBigInt64 = DataView.prototype.getBigInt64;
|
var getBigInt64 = DataView.prototype.getBigInt64;
|
||||||
|
|
||||||
assert.throws(TypeError, () => getBigInt64.call(undefined),
|
assert.throws(TypeError, () => getBigInt64.call(undefined),
|
||||||
"undefined");
|
"undefined");
|
||||||
|
|
||||||
assert.throws(TypeError, () => getBigInt64.call(null), "null");
|
assert.throws(TypeError, () => getBigInt64.call(null), "null");
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ var sample = new DataView(buffer, 0);
|
|||||||
$DETACHBUFFER(buffer);
|
$DETACHBUFFER(buffer);
|
||||||
|
|
||||||
assert.throws(RangeError, () => sample.getBigUint64(Infinity),
|
assert.throws(RangeError, () => sample.getBigUint64(Infinity),
|
||||||
"DataView access at index Infinity should throw");
|
"DataView access at index Infinity should throw");
|
||||||
|
|
||||||
assert.throws(RangeError, () => sample.getBigUint64(-1),
|
assert.throws(RangeError, () => sample.getBigUint64(-1),
|
||||||
"DataView access at index -1 should throw");
|
"DataView access at index -1 should throw");
|
||||||
|
@ -17,4 +17,4 @@ sample = new DataView(buffer, 0);
|
|||||||
$DETACHBUFFER(buffer);
|
$DETACHBUFFER(buffer);
|
||||||
|
|
||||||
assert.throws(TypeError, () => sample.getBigUint64(13),
|
assert.throws(TypeError, () => sample.getBigUint64(13),
|
||||||
"detached DataView access should throw");
|
"detached DataView access should throw");
|
||||||
|
@ -14,4 +14,4 @@ var sample = new DataView(buffer, 0);
|
|||||||
|
|
||||||
$DETACHBUFFER(buffer);
|
$DETACHBUFFER(buffer);
|
||||||
assert.throws(TypeError, () => sample.getBigUint64(0),
|
assert.throws(TypeError, () => sample.getBigUint64(0),
|
||||||
"detached DataView access should throw");
|
"detached DataView access should throw");
|
||||||
|
@ -14,7 +14,7 @@ var buffer = new ArrayBuffer(12);
|
|||||||
sample = new DataView(buffer, 0);
|
sample = new DataView(buffer, 0);
|
||||||
|
|
||||||
assert.throws(RangeError, () => sample.getBigUint64(Infinity),
|
assert.throws(RangeError, () => sample.getBigUint64(Infinity),
|
||||||
"DataView access at index Infinity should throw");
|
"DataView access at index Infinity should throw");
|
||||||
|
|
||||||
assert.throws(RangeError, () => sample.getBigUint64(13), "13 + 8 > 12");
|
assert.throws(RangeError, () => sample.getBigUint64(13), "13 + 8 > 12");
|
||||||
|
|
||||||
@ -36,24 +36,24 @@ assert.throws(RangeError, () => sample.getBigUint64(5), "5 + 8 > 12");
|
|||||||
|
|
||||||
sample = new DataView(buffer, 8);
|
sample = new DataView(buffer, 8);
|
||||||
assert.throws(RangeError, () => sample.getBigUint64(1),
|
assert.throws(RangeError, () => sample.getBigUint64(1),
|
||||||
"1 + 8 > 4 (offset)");
|
"1 + 8 > 4 (offset)");
|
||||||
|
|
||||||
sample = new DataView(buffer, 9);
|
sample = new DataView(buffer, 9);
|
||||||
assert.throws(RangeError, () => sample.getBigUint64(0),
|
assert.throws(RangeError, () => sample.getBigUint64(0),
|
||||||
"0 + 8 > 3 (offset)");
|
"0 + 8 > 3 (offset)");
|
||||||
|
|
||||||
sample = new DataView(buffer, 0, 8);
|
sample = new DataView(buffer, 0, 8);
|
||||||
assert.throws(RangeError, () => sample.getBigUint64(1),
|
assert.throws(RangeError, () => sample.getBigUint64(1),
|
||||||
"1 + 8 > 8 (length)");
|
"1 + 8 > 8 (length)");
|
||||||
|
|
||||||
sample = new DataView(buffer, 0, 7);
|
sample = new DataView(buffer, 0, 7);
|
||||||
assert.throws(RangeError, () => sample.getBigUint64(0),
|
assert.throws(RangeError, () => sample.getBigUint64(0),
|
||||||
"0 + 8 > 7 (length)");
|
"0 + 8 > 7 (length)");
|
||||||
|
|
||||||
sample = new DataView(buffer, 4, 8);
|
sample = new DataView(buffer, 4, 8);
|
||||||
assert.throws(RangeError, () => sample.getBigUint64(1),
|
assert.throws(RangeError, () => sample.getBigUint64(1),
|
||||||
"1 + 8 > 8 (offset+length)");
|
"1 + 8 > 8 (offset+length)");
|
||||||
|
|
||||||
sample = new DataView(buffer, 4, 7);
|
sample = new DataView(buffer, 4, 7);
|
||||||
assert.throws(RangeError, () => sample.getBigUint64(0),
|
assert.throws(RangeError, () => sample.getBigUint64(0),
|
||||||
"0 + 8 > 7 (offset+length)");
|
"0 + 8 > 7 (offset+length)");
|
||||||
|
@ -12,7 +12,7 @@ var buffer = new ArrayBuffer(12);
|
|||||||
var sample = new DataView(buffer, 0);
|
var sample = new DataView(buffer, 0);
|
||||||
|
|
||||||
assert.throws(RangeError, () => sample.getBigUint64(-1),
|
assert.throws(RangeError, () => sample.getBigUint64(-1),
|
||||||
"DataView access at index -1 should throw");
|
"DataView access at index -1 should throw");
|
||||||
|
|
||||||
assert.throws(RangeError, () => sample.getBigUint64(-Infinity),
|
assert.throws(RangeError, () => sample.getBigUint64(-Infinity),
|
||||||
"DataView access at index -Infinity should throw");
|
"DataView access at index -Infinity should throw");
|
||||||
|
@ -11,8 +11,16 @@ features: [DataView, ArrayBuffer, BigInt, arrow-function]
|
|||||||
var buffer = new ArrayBuffer(1);
|
var buffer = new ArrayBuffer(1);
|
||||||
var sample = new DataView(buffer, 0);
|
var sample = new DataView(buffer, 0);
|
||||||
|
|
||||||
var bo1 = { valueOf() { throw new Test262Error(); } };
|
var bo1 = {
|
||||||
var bo2 = { toString() { throw new Test262Error(); } };
|
valueOf() {
|
||||||
|
throw new Test262Error();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var bo2 = {
|
||||||
|
toString() {
|
||||||
|
throw new Test262Error();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
assert.throws(Test262Error, () => sample.getBigUint64(bo1), "valueOf");
|
assert.throws(Test262Error, () => sample.getBigUint64(bo1), "valueOf");
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ features: [DataView, ArrayBuffer, Symbol, BigInt, arrow-function]
|
|||||||
var getBigUint64 = DataView.prototype.getBigUint64;
|
var getBigUint64 = DataView.prototype.getBigUint64;
|
||||||
|
|
||||||
assert.throws(TypeError, () => getBigUint64.call(undefined),
|
assert.throws(TypeError, () => getBigUint64.call(undefined),
|
||||||
"undefined");
|
"undefined");
|
||||||
|
|
||||||
assert.throws(TypeError, () => getBigUint64.call(null), "null");
|
assert.throws(TypeError, () => getBigUint64.call(null), "null");
|
||||||
|
|
||||||
|
@ -12,7 +12,11 @@ features: [DataView, ArrayBuffer, BigInt]
|
|||||||
var buffer = new ArrayBuffer(8);
|
var buffer = new ArrayBuffer(8);
|
||||||
var sample = new DataView(buffer, 0);
|
var sample = new DataView(buffer, 0);
|
||||||
|
|
||||||
var v = { valueOf() { throw new Test262Error(); } };
|
var v = {
|
||||||
|
valueOf() {
|
||||||
|
throw new Test262Error();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
$DETACHBUFFER(buffer);
|
$DETACHBUFFER(buffer);
|
||||||
assert.throws(Test262Error, function() {
|
assert.throws(Test262Error, function() {
|
||||||
|
@ -12,7 +12,9 @@ features: [DataView, ArrayBuffer, BigInt]
|
|||||||
var dataView = new DataView(new ArrayBuffer(8), 0);
|
var dataView = new DataView(new ArrayBuffer(8), 0);
|
||||||
|
|
||||||
var poisoned = {
|
var poisoned = {
|
||||||
valueOf() { throw new Test262Error("valueOf called"); }
|
valueOf() {
|
||||||
|
throw new Test262Error("valueOf called");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
assert.throws(RangeError, function() {
|
assert.throws(RangeError, function() {
|
||||||
|
@ -10,7 +10,11 @@ features: [DataView, ArrayBuffer, BigInt]
|
|||||||
|
|
||||||
var dataView = new DataView(new ArrayBuffer(8), 0);
|
var dataView = new DataView(new ArrayBuffer(8), 0);
|
||||||
|
|
||||||
var poisoned = { valueOf() { throw new Test262Error(); } };
|
var poisoned = {
|
||||||
|
valueOf() {
|
||||||
|
throw new Test262Error();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
assert.throws(Test262Error, function() {
|
assert.throws(Test262Error, function() {
|
||||||
dataView.setBigInt64(100, poisoned);
|
dataView.setBigInt64(100, poisoned);
|
||||||
|
@ -11,8 +11,16 @@ features: [DataView, ArrayBuffer, BigInt]
|
|||||||
var buffer = new ArrayBuffer(8);
|
var buffer = new ArrayBuffer(8);
|
||||||
var sample = new DataView(buffer, 0);
|
var sample = new DataView(buffer, 0);
|
||||||
|
|
||||||
var bo1 = { valueOf() { throw new Test262Error(); } };
|
var bo1 = {
|
||||||
var bo2 = { toString() { throw new Test262Error(); } };
|
valueOf() {
|
||||||
|
throw new Test262Error();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var bo2 = {
|
||||||
|
toString() {
|
||||||
|
throw new Test262Error();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
assert.throws(Test262Error, function() {
|
assert.throws(Test262Error, function() {
|
||||||
sample.setBigInt64(0, bo1);
|
sample.setBigInt64(0, bo1);
|
||||||
|
@ -11,8 +11,16 @@ features: [DataView, ArrayBuffer, BigInt]
|
|||||||
var buffer = new ArrayBuffer(1);
|
var buffer = new ArrayBuffer(1);
|
||||||
var sample = new DataView(buffer, 0);
|
var sample = new DataView(buffer, 0);
|
||||||
|
|
||||||
var bo1 = { valueOf() { throw new Test262Error(); } };
|
var bo1 = {
|
||||||
var bo2 = { toString() { throw new Test262Error(); } };
|
valueOf() {
|
||||||
|
throw new Test262Error();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var bo2 = {
|
||||||
|
toString() {
|
||||||
|
throw new Test262Error();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
assert.throws(Test262Error, function() {
|
assert.throws(Test262Error, function() {
|
||||||
sample.setBigInt64(bo1, 1n);
|
sample.setBigInt64(bo1, 1n);
|
||||||
|
@ -17,13 +17,13 @@ var values = byteConversionValues.values;
|
|||||||
values.forEach(function(value, i) {
|
values.forEach(function(value, i) {
|
||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
assert.throws(TypeError,
|
assert.throws(TypeError,
|
||||||
() => sample.setBigInt64(0, BigInt(value), false),
|
() => sample.setBigInt64(0, BigInt(value), false),
|
||||||
"value: " + value);
|
"value: " + value);
|
||||||
return;
|
return;
|
||||||
} else if (!Number.isInteger(value) || value > 9007199254740991) {
|
} else if (!Number.isInteger(value) || value > 9007199254740991) {
|
||||||
assert.throws(RangeError,
|
assert.throws(RangeError,
|
||||||
() => sample.setBigInt64(0, BigInt(value), false),
|
() => sample.setBigInt64(0, BigInt(value), false),
|
||||||
"value " + value);
|
"value " + value);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,8 +11,16 @@ features: [DataView, ArrayBuffer, BigInt]
|
|||||||
var buffer = new ArrayBuffer(12);
|
var buffer = new ArrayBuffer(12);
|
||||||
var sample = new DataView(buffer, 0);
|
var sample = new DataView(buffer, 0);
|
||||||
|
|
||||||
var obj1 = { valueOf() { return 3; } };
|
var obj1 = {
|
||||||
var obj2 = { toString() { return 4; } };
|
valueOf() {
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var obj2 = {
|
||||||
|
toString() {
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
sample.setBigInt64(0, 0n);
|
sample.setBigInt64(0, 0n);
|
||||||
sample.setBigInt64(-0, 42n);
|
sample.setBigInt64(-0, 42n);
|
||||||
|
@ -106,4 +106,4 @@ assert.sameValue(sample.getInt32(0), 42, "undefined");
|
|||||||
|
|
||||||
sample.setInt32(0, 7);
|
sample.setInt32(0, 7);
|
||||||
sample.setInt32();
|
sample.setInt32();
|
||||||
assert.sameValue(sample.getInt32(0), 0, "no arg");
|
assert.sameValue(sample.getInt32(0), 0, "no arg");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user