From 4b5f07a9ffc32769bb77f4836ac8b7c6af1966e3 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Thu, 15 Feb 2018 15:55:14 -0500 Subject: [PATCH] built-ins/DataView/*: make all indentation consistent (depth & character) (#1416) --- .../detached-buffer-after-toindex-byteoffset.js | 4 ++-- ...detached-buffer-before-outofrange-byteoffset.js | 2 +- .../prototype/getBigInt64/detached-buffer.js | 2 +- .../prototype/getBigInt64/index-is-out-of-range.js | 14 +++++++------- .../getBigInt64/negative-byteoffset-throws.js | 4 ++-- .../return-abrupt-from-tonumber-byteoffset.js | 12 ++++++++++-- .../prototype/getBigInt64/this-is-not-object.js | 2 +- .../detached-buffer-after-toindex-byteoffset.js | 4 ++-- ...detached-buffer-before-outofrange-byteoffset.js | 2 +- .../prototype/getBigUint64/detached-buffer.js | 2 +- .../getBigUint64/index-is-out-of-range.js | 14 +++++++------- .../getBigUint64/negative-byteoffset-throws.js | 4 ++-- .../return-abrupt-from-tonumber-byteoffset.js | 12 ++++++++++-- .../prototype/getBigUint64/this-is-not-object.js | 2 +- .../detached-buffer-after-bigint-value.js | 6 +++++- .../index-check-before-value-conversion.js | 4 +++- .../range-check-after-value-conversion.js | 6 +++++- .../return-abrupt-from-tobigint-value.js | 12 ++++++++++-- .../return-abrupt-from-tonumber-byteoffset.js | 12 ++++++++++-- .../setBigInt64/set-values-return-undefined.js | 8 ++++---- .../prototype/setBigInt64/toindex-byteoffset.js | 12 ++++++++++-- .../prototype/setInt32/toindex-byteoffset.js | 2 +- 22 files changed, 96 insertions(+), 46 deletions(-) diff --git a/test/built-ins/DataView/prototype/getBigInt64/detached-buffer-after-toindex-byteoffset.js b/test/built-ins/DataView/prototype/getBigInt64/detached-buffer-after-toindex-byteoffset.js index 163513c770..2e493d64ef 100644 --- a/test/built-ins/DataView/prototype/getBigInt64/detached-buffer-after-toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/getBigInt64/detached-buffer-after-toindex-byteoffset.js @@ -30,7 +30,7 @@ var sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); 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), - "DataView access at index -1 should throw"); + "DataView access at index -1 should throw"); diff --git a/test/built-ins/DataView/prototype/getBigInt64/detached-buffer-before-outofrange-byteoffset.js b/test/built-ins/DataView/prototype/getBigInt64/detached-buffer-before-outofrange-byteoffset.js index e2aae64359..b25d05470b 100644 --- a/test/built-ins/DataView/prototype/getBigInt64/detached-buffer-before-outofrange-byteoffset.js +++ b/test/built-ins/DataView/prototype/getBigInt64/detached-buffer-before-outofrange-byteoffset.js @@ -32,4 +32,4 @@ sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); assert.throws(TypeError, () => sample.getBigInt64(13), - "detached DataView access should throw"); + "detached DataView access should throw"); diff --git a/test/built-ins/DataView/prototype/getBigInt64/detached-buffer.js b/test/built-ins/DataView/prototype/getBigInt64/detached-buffer.js index ed1b5a8c64..53fd563ae3 100644 --- a/test/built-ins/DataView/prototype/getBigInt64/detached-buffer.js +++ b/test/built-ins/DataView/prototype/getBigInt64/detached-buffer.js @@ -27,4 +27,4 @@ var sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); assert.throws(TypeError, () => sample.getBigInt64(0), - "detached DataView access should throw"); + "detached DataView access should throw"); diff --git a/test/built-ins/DataView/prototype/getBigInt64/index-is-out-of-range.js b/test/built-ins/DataView/prototype/getBigInt64/index-is-out-of-range.js index 57e75e8e95..5172653142 100644 --- a/test/built-ins/DataView/prototype/getBigInt64/index-is-out-of-range.js +++ b/test/built-ins/DataView/prototype/getBigInt64/index-is-out-of-range.js @@ -30,7 +30,7 @@ var buffer = new ArrayBuffer(12); sample = new DataView(buffer, 0); 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"); @@ -52,24 +52,24 @@ assert.throws(RangeError, () => sample.getBigInt64(5), "5 + 8 > 12"); sample = new DataView(buffer, 8); assert.throws(RangeError, () => sample.getBigInt64(1), - "1 + 8 > 4 (offset)"); + "1 + 8 > 4 (offset)"); sample = new DataView(buffer, 9); assert.throws(RangeError, () => sample.getBigInt64(0), - "0 + 8 > 3 (offset)"); + "0 + 8 > 3 (offset)"); sample = new DataView(buffer, 0, 8); assert.throws(RangeError, () => sample.getBigInt64(1), - "1 + 8 > 8 (length)"); + "1 + 8 > 8 (length)"); sample = new DataView(buffer, 0, 7); assert.throws(RangeError, () => sample.getBigInt64(0), - "0 + 8 > 7 (length)"); + "0 + 8 > 7 (length)"); sample = new DataView(buffer, 4, 8); assert.throws(RangeError, () => sample.getBigInt64(1), - "1 + 8 > 8 (offset+length)"); + "1 + 8 > 8 (offset+length)"); sample = new DataView(buffer, 4, 7); assert.throws(RangeError, () => sample.getBigInt64(0), - "0 + 8 > 7 (offset+length)"); + "0 + 8 > 7 (offset+length)"); diff --git a/test/built-ins/DataView/prototype/getBigInt64/negative-byteoffset-throws.js b/test/built-ins/DataView/prototype/getBigInt64/negative-byteoffset-throws.js index eb466a69d1..2b17f822b3 100644 --- a/test/built-ins/DataView/prototype/getBigInt64/negative-byteoffset-throws.js +++ b/test/built-ins/DataView/prototype/getBigInt64/negative-byteoffset-throws.js @@ -24,7 +24,7 @@ var buffer = new ArrayBuffer(12); var sample = new DataView(buffer, 0); 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), - "DataView access at index -Infinity should throw"); + "DataView access at index -Infinity should throw"); diff --git a/test/built-ins/DataView/prototype/getBigInt64/return-abrupt-from-tonumber-byteoffset.js b/test/built-ins/DataView/prototype/getBigInt64/return-abrupt-from-tonumber-byteoffset.js index 51a723d82e..6e71746c8d 100644 --- a/test/built-ins/DataView/prototype/getBigInt64/return-abrupt-from-tonumber-byteoffset.js +++ b/test/built-ins/DataView/prototype/getBigInt64/return-abrupt-from-tonumber-byteoffset.js @@ -23,8 +23,16 @@ features: [DataView, ArrayBuffer, BigInt, arrow-function] var buffer = new ArrayBuffer(1); var sample = new DataView(buffer, 0); -var bo1 = { valueOf() { throw new Test262Error(); } }; -var bo2 = { toString() { throw new Test262Error(); } }; +var bo1 = { + valueOf() { + throw new Test262Error(); + } +}; +var bo2 = { + toString() { + throw new Test262Error(); + } +}; assert.throws(Test262Error, () => sample.getBigInt64(bo1), "valueOf"); diff --git a/test/built-ins/DataView/prototype/getBigInt64/this-is-not-object.js b/test/built-ins/DataView/prototype/getBigInt64/this-is-not-object.js index 1dad1108dd..cf8682a050 100644 --- a/test/built-ins/DataView/prototype/getBigInt64/this-is-not-object.js +++ b/test/built-ins/DataView/prototype/getBigInt64/this-is-not-object.js @@ -21,7 +21,7 @@ features: [DataView, ArrayBuffer, Symbol, BigInt, arrow-function] var getBigInt64 = DataView.prototype.getBigInt64; assert.throws(TypeError, () => getBigInt64.call(undefined), - "undefined"); + "undefined"); assert.throws(TypeError, () => getBigInt64.call(null), "null"); diff --git a/test/built-ins/DataView/prototype/getBigUint64/detached-buffer-after-toindex-byteoffset.js b/test/built-ins/DataView/prototype/getBigUint64/detached-buffer-after-toindex-byteoffset.js index a96d8c9c5c..894b550687 100644 --- a/test/built-ins/DataView/prototype/getBigUint64/detached-buffer-after-toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/getBigUint64/detached-buffer-after-toindex-byteoffset.js @@ -15,7 +15,7 @@ var sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); 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), - "DataView access at index -1 should throw"); + "DataView access at index -1 should throw"); diff --git a/test/built-ins/DataView/prototype/getBigUint64/detached-buffer-before-outofrange-byteoffset.js b/test/built-ins/DataView/prototype/getBigUint64/detached-buffer-before-outofrange-byteoffset.js index 9b0fb3d272..4155c6d698 100644 --- a/test/built-ins/DataView/prototype/getBigUint64/detached-buffer-before-outofrange-byteoffset.js +++ b/test/built-ins/DataView/prototype/getBigUint64/detached-buffer-before-outofrange-byteoffset.js @@ -17,4 +17,4 @@ sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); assert.throws(TypeError, () => sample.getBigUint64(13), - "detached DataView access should throw"); + "detached DataView access should throw"); diff --git a/test/built-ins/DataView/prototype/getBigUint64/detached-buffer.js b/test/built-ins/DataView/prototype/getBigUint64/detached-buffer.js index b3fdb8b29d..de42ea2981 100644 --- a/test/built-ins/DataView/prototype/getBigUint64/detached-buffer.js +++ b/test/built-ins/DataView/prototype/getBigUint64/detached-buffer.js @@ -14,4 +14,4 @@ var sample = new DataView(buffer, 0); $DETACHBUFFER(buffer); assert.throws(TypeError, () => sample.getBigUint64(0), - "detached DataView access should throw"); + "detached DataView access should throw"); diff --git a/test/built-ins/DataView/prototype/getBigUint64/index-is-out-of-range.js b/test/built-ins/DataView/prototype/getBigUint64/index-is-out-of-range.js index 88f38cb64a..7f25d2e677 100644 --- a/test/built-ins/DataView/prototype/getBigUint64/index-is-out-of-range.js +++ b/test/built-ins/DataView/prototype/getBigUint64/index-is-out-of-range.js @@ -14,7 +14,7 @@ var buffer = new ArrayBuffer(12); sample = new DataView(buffer, 0); 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"); @@ -36,24 +36,24 @@ assert.throws(RangeError, () => sample.getBigUint64(5), "5 + 8 > 12"); sample = new DataView(buffer, 8); assert.throws(RangeError, () => sample.getBigUint64(1), - "1 + 8 > 4 (offset)"); + "1 + 8 > 4 (offset)"); sample = new DataView(buffer, 9); assert.throws(RangeError, () => sample.getBigUint64(0), - "0 + 8 > 3 (offset)"); + "0 + 8 > 3 (offset)"); sample = new DataView(buffer, 0, 8); assert.throws(RangeError, () => sample.getBigUint64(1), - "1 + 8 > 8 (length)"); + "1 + 8 > 8 (length)"); sample = new DataView(buffer, 0, 7); assert.throws(RangeError, () => sample.getBigUint64(0), - "0 + 8 > 7 (length)"); + "0 + 8 > 7 (length)"); sample = new DataView(buffer, 4, 8); assert.throws(RangeError, () => sample.getBigUint64(1), - "1 + 8 > 8 (offset+length)"); + "1 + 8 > 8 (offset+length)"); sample = new DataView(buffer, 4, 7); assert.throws(RangeError, () => sample.getBigUint64(0), - "0 + 8 > 7 (offset+length)"); + "0 + 8 > 7 (offset+length)"); diff --git a/test/built-ins/DataView/prototype/getBigUint64/negative-byteoffset-throws.js b/test/built-ins/DataView/prototype/getBigUint64/negative-byteoffset-throws.js index 3216d86c88..ea981f6878 100644 --- a/test/built-ins/DataView/prototype/getBigUint64/negative-byteoffset-throws.js +++ b/test/built-ins/DataView/prototype/getBigUint64/negative-byteoffset-throws.js @@ -12,7 +12,7 @@ var buffer = new ArrayBuffer(12); var sample = new DataView(buffer, 0); 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), - "DataView access at index -Infinity should throw"); + "DataView access at index -Infinity should throw"); diff --git a/test/built-ins/DataView/prototype/getBigUint64/return-abrupt-from-tonumber-byteoffset.js b/test/built-ins/DataView/prototype/getBigUint64/return-abrupt-from-tonumber-byteoffset.js index 4f7bb95960..5482c5d1b6 100644 --- a/test/built-ins/DataView/prototype/getBigUint64/return-abrupt-from-tonumber-byteoffset.js +++ b/test/built-ins/DataView/prototype/getBigUint64/return-abrupt-from-tonumber-byteoffset.js @@ -11,8 +11,16 @@ features: [DataView, ArrayBuffer, BigInt, arrow-function] var buffer = new ArrayBuffer(1); var sample = new DataView(buffer, 0); -var bo1 = { valueOf() { throw new Test262Error(); } }; -var bo2 = { toString() { throw new Test262Error(); } }; +var bo1 = { + valueOf() { + throw new Test262Error(); + } +}; +var bo2 = { + toString() { + throw new Test262Error(); + } +}; assert.throws(Test262Error, () => sample.getBigUint64(bo1), "valueOf"); diff --git a/test/built-ins/DataView/prototype/getBigUint64/this-is-not-object.js b/test/built-ins/DataView/prototype/getBigUint64/this-is-not-object.js index a60b3cca3e..4c3d250c69 100644 --- a/test/built-ins/DataView/prototype/getBigUint64/this-is-not-object.js +++ b/test/built-ins/DataView/prototype/getBigUint64/this-is-not-object.js @@ -10,7 +10,7 @@ features: [DataView, ArrayBuffer, Symbol, BigInt, arrow-function] var getBigUint64 = DataView.prototype.getBigUint64; assert.throws(TypeError, () => getBigUint64.call(undefined), - "undefined"); + "undefined"); assert.throws(TypeError, () => getBigUint64.call(null), "null"); diff --git a/test/built-ins/DataView/prototype/setBigInt64/detached-buffer-after-bigint-value.js b/test/built-ins/DataView/prototype/setBigInt64/detached-buffer-after-bigint-value.js index 7a96e21ca8..48a491cb6c 100644 --- a/test/built-ins/DataView/prototype/setBigInt64/detached-buffer-after-bigint-value.js +++ b/test/built-ins/DataView/prototype/setBigInt64/detached-buffer-after-bigint-value.js @@ -12,7 +12,11 @@ features: [DataView, ArrayBuffer, BigInt] var buffer = new ArrayBuffer(8); var sample = new DataView(buffer, 0); -var v = { valueOf() { throw new Test262Error(); } }; +var v = { + valueOf() { + throw new Test262Error(); + } +}; $DETACHBUFFER(buffer); assert.throws(Test262Error, function() { diff --git a/test/built-ins/DataView/prototype/setBigInt64/index-check-before-value-conversion.js b/test/built-ins/DataView/prototype/setBigInt64/index-check-before-value-conversion.js index a092a47c3c..0852b54985 100644 --- a/test/built-ins/DataView/prototype/setBigInt64/index-check-before-value-conversion.js +++ b/test/built-ins/DataView/prototype/setBigInt64/index-check-before-value-conversion.js @@ -12,7 +12,9 @@ features: [DataView, ArrayBuffer, BigInt] var dataView = new DataView(new ArrayBuffer(8), 0); var poisoned = { - valueOf() { throw new Test262Error("valueOf called"); } + valueOf() { + throw new Test262Error("valueOf called"); + } }; assert.throws(RangeError, function() { diff --git a/test/built-ins/DataView/prototype/setBigInt64/range-check-after-value-conversion.js b/test/built-ins/DataView/prototype/setBigInt64/range-check-after-value-conversion.js index 85e88974cc..6c05febdd8 100644 --- a/test/built-ins/DataView/prototype/setBigInt64/range-check-after-value-conversion.js +++ b/test/built-ins/DataView/prototype/setBigInt64/range-check-after-value-conversion.js @@ -10,7 +10,11 @@ features: [DataView, ArrayBuffer, BigInt] var dataView = new DataView(new ArrayBuffer(8), 0); -var poisoned = { valueOf() { throw new Test262Error(); } }; +var poisoned = { + valueOf() { + throw new Test262Error(); + } +}; assert.throws(Test262Error, function() { dataView.setBigInt64(100, poisoned); diff --git a/test/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tobigint-value.js b/test/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tobigint-value.js index 0411fe56b0..d09e12b13a 100644 --- a/test/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tobigint-value.js +++ b/test/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tobigint-value.js @@ -11,8 +11,16 @@ features: [DataView, ArrayBuffer, BigInt] var buffer = new ArrayBuffer(8); var sample = new DataView(buffer, 0); -var bo1 = { valueOf() { throw new Test262Error(); } }; -var bo2 = { toString() { throw new Test262Error(); } }; +var bo1 = { + valueOf() { + throw new Test262Error(); + } +}; +var bo2 = { + toString() { + throw new Test262Error(); + } +}; assert.throws(Test262Error, function() { sample.setBigInt64(0, bo1); diff --git a/test/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tonumber-byteoffset.js b/test/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tonumber-byteoffset.js index c54224decf..2e9c13a8db 100644 --- a/test/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tonumber-byteoffset.js +++ b/test/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tonumber-byteoffset.js @@ -11,8 +11,16 @@ features: [DataView, ArrayBuffer, BigInt] var buffer = new ArrayBuffer(1); var sample = new DataView(buffer, 0); -var bo1 = { valueOf() { throw new Test262Error(); } }; -var bo2 = { toString() { throw new Test262Error(); } }; +var bo1 = { + valueOf() { + throw new Test262Error(); + } +}; +var bo2 = { + toString() { + throw new Test262Error(); + } +}; assert.throws(Test262Error, function() { sample.setBigInt64(bo1, 1n); diff --git a/test/built-ins/DataView/prototype/setBigInt64/set-values-return-undefined.js b/test/built-ins/DataView/prototype/setBigInt64/set-values-return-undefined.js index a92ede6c69..4e2d481c1f 100644 --- a/test/built-ins/DataView/prototype/setBigInt64/set-values-return-undefined.js +++ b/test/built-ins/DataView/prototype/setBigInt64/set-values-return-undefined.js @@ -17,13 +17,13 @@ var values = byteConversionValues.values; values.forEach(function(value, i) { if (value === undefined) { assert.throws(TypeError, - () => sample.setBigInt64(0, BigInt(value), false), - "value: " + value); + () => sample.setBigInt64(0, BigInt(value), false), + "value: " + value); return; } else if (!Number.isInteger(value) || value > 9007199254740991) { assert.throws(RangeError, - () => sample.setBigInt64(0, BigInt(value), false), - "value " + value); + () => sample.setBigInt64(0, BigInt(value), false), + "value " + value); return; } diff --git a/test/built-ins/DataView/prototype/setBigInt64/toindex-byteoffset.js b/test/built-ins/DataView/prototype/setBigInt64/toindex-byteoffset.js index a55f905ae3..8858ee9486 100644 --- a/test/built-ins/DataView/prototype/setBigInt64/toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/setBigInt64/toindex-byteoffset.js @@ -11,8 +11,16 @@ features: [DataView, ArrayBuffer, BigInt] var buffer = new ArrayBuffer(12); var sample = new DataView(buffer, 0); -var obj1 = { valueOf() { return 3; } }; -var obj2 = { toString() { return 4; } }; +var obj1 = { + valueOf() { + return 3; + } +}; +var obj2 = { + toString() { + return 4; + } +}; sample.setBigInt64(0, 0n); sample.setBigInt64(-0, 42n); diff --git a/test/built-ins/DataView/prototype/setInt32/toindex-byteoffset.js b/test/built-ins/DataView/prototype/setInt32/toindex-byteoffset.js index f5b45a5ae9..0d71d4dfbc 100644 --- a/test/built-ins/DataView/prototype/setInt32/toindex-byteoffset.js +++ b/test/built-ins/DataView/prototype/setInt32/toindex-byteoffset.js @@ -106,4 +106,4 @@ assert.sameValue(sample.getInt32(0), 42, "undefined"); sample.setInt32(0, 7); sample.setInt32(); -assert.sameValue(sample.getInt32(0), 0, "no arg"); \ No newline at end of file +assert.sameValue(sample.getInt32(0), 0, "no arg");