built-ins/ArrayBuffer/*: make all indentation consistent (depth & character) (#1421)

This commit is contained in:
Rick Waldron 2018-02-15 15:54:16 -05:00 committed by Leo Balter
parent 319a5bdb08
commit 93d0256d87
16 changed files with 54 additions and 27 deletions

View File

@ -23,9 +23,9 @@ info: |
features: [Reflect.construct]
---*/
function DummyError() { }
function DummyError() {}
var newTarget = function(){}.bind(null);
var newTarget = function() {}.bind(null);
Object.defineProperty(newTarget, "prototype", {
get: function() {
throw new DummyError();

View File

@ -22,7 +22,7 @@ info: |
features: [Reflect.construct, Symbol]
---*/
function newTarget() { }
function newTarget() {}
newTarget.prototype = undefined;
var arrayBuffer = Reflect.construct(ArrayBuffer, [1], newTarget);

View File

@ -25,7 +25,7 @@ features: [Reflect.construct]
var arrayBuffer = Reflect.construct(ArrayBuffer, [8], Object);
assert.sameValue(Object.getPrototypeOf(arrayBuffer), Object.prototype, "NewTarget is built-in Object constructor");
var newTarget = function(){}.bind(null);
var newTarget = function() {}.bind(null);
Object.defineProperty(newTarget, "prototype", {
get: function() {
return Array.prototype;

View File

@ -17,6 +17,7 @@ info: |
var arrayBuffer = new ArrayBuffer(8);
var start = 6, end = undefined;
var start = 6,
end = undefined;
var result = arrayBuffer.slice(start, end);
assert.sameValue(result.byteLength, 2);

View File

@ -16,14 +16,17 @@ info: |
var arrayBuffer = new ArrayBuffer(8);
var start = 1, end = 12;
var start = 1,
end = 12;
var result = arrayBuffer.slice(start, end);
assert.sameValue(result.byteLength, 7, "slice(1, 12)");
var start = 2, end = 0x100000000;
var start = 2,
end = 0x100000000;
var result = arrayBuffer.slice(start, end);
assert.sameValue(result.byteLength, 6, "slice(2, 0x100000000)");
var start = 3, end = +Infinity;
var start = 3,
end = +Infinity;
var result = arrayBuffer.slice(start, end);
assert.sameValue(result.byteLength, 5, "slice(3, Infinity)");

View File

@ -16,14 +16,17 @@ info: |
var arrayBuffer = new ArrayBuffer(8);
var start = 2, end = -4;
var start = 2,
end = -4;
var result = arrayBuffer.slice(start, end);
assert.sameValue(result.byteLength, 2, "slice(2, -4)");
var start = 2, end = -10;
var start = 2,
end = -10;
var result = arrayBuffer.slice(start, end);
assert.sameValue(result.byteLength, 0, "slice(2, -10)");
var start = 2, end = -Infinity;
var start = 2,
end = -Infinity;
var result = arrayBuffer.slice(start, end);
assert.sameValue(result.byteLength, 0, "slice(2, -Infinity)");

View File

@ -16,14 +16,17 @@ info: |
var arrayBuffer = new ArrayBuffer(8);
var start = -5, end = 6;
var start = -5,
end = 6;
var result = arrayBuffer.slice(start, end);
assert.sameValue(result.byteLength, 3, "slice(-5, 6)");
var start = -12, end = 6;
var start = -12,
end = 6;
var result = arrayBuffer.slice(start, end);
assert.sameValue(result.byteLength, 6, "slice(-12, 6)");
var start = -Infinity, end = 6;
var start = -Infinity,
end = 6;
var result = arrayBuffer.slice(start, end);
assert.sameValue(result.byteLength, 6, "slice(-Infinity, 6)");

View File

@ -18,4 +18,6 @@ info: |
assert.sameValue(Object.prototype.hasOwnProperty.call(ArrayBuffer.prototype.slice, "prototype"), false);
var arrayBuffer = new ArrayBuffer(8);
assert.throws(TypeError, function() { new arrayBuffer.slice(); });
assert.throws(TypeError, function() {
new arrayBuffer.slice();
});

View File

@ -26,7 +26,9 @@ features: [Symbol]
var arrayBuffer = new ArrayBuffer(8);
function callSlice() { arrayBuffer.slice(); }
function callSlice() {
arrayBuffer.slice();
}
arrayBuffer.constructor = null;
assert.throws(TypeError, callSlice, "`constructor` value is null");

View File

@ -29,7 +29,9 @@ var speciesConstructor = {};
var arrayBuffer = new ArrayBuffer(8);
arrayBuffer.constructor = speciesConstructor;
function callSlice() { arrayBuffer.slice(); }
function callSlice() {
arrayBuffer.slice();
}
speciesConstructor[Symbol.species] = {};
assert.throws(TypeError, callSlice, "`constructor[Symbol.species]` value is Object");

View File

@ -29,7 +29,9 @@ var speciesConstructor = {};
var arrayBuffer = new ArrayBuffer(8);
arrayBuffer.constructor = speciesConstructor;
function callSlice() { arrayBuffer.slice(); }
function callSlice() {
arrayBuffer.slice();
}
speciesConstructor[Symbol.species] = true;
assert.throws(TypeError, callSlice, "`constructor[Symbol.species]` value is Boolean");

View File

@ -17,6 +17,7 @@ info: |
var arrayBuffer = new ArrayBuffer(8);
var start = undefined, end = 6;
var start = undefined,
end = 6;
var result = arrayBuffer.slice(start, end);
assert.sameValue(result.byteLength, 6);

View File

@ -16,6 +16,7 @@ info: |
var arrayBuffer = new ArrayBuffer(8);
var start = 5, end = 4;
var start = 5,
end = 4;
var result = arrayBuffer.slice(start, end);
assert.sameValue(result.byteLength, 0);

View File

@ -16,14 +16,17 @@ info: |
var arrayBuffer = new ArrayBuffer(8);
var start = 10, end = 8;
var start = 10,
end = 8;
var result = arrayBuffer.slice(start, end);
assert.sameValue(result.byteLength, 0, "slice(10, 8)");
var start = 0x100000000, end = 7;
var start = 0x100000000,
end = 7;
var result = arrayBuffer.slice(start, end);
assert.sameValue(result.byteLength, 0, "slice(0x100000000, 7)");
var start = +Infinity, end = 6;
var start = +Infinity,
end = 6;
var result = arrayBuffer.slice(start, end);
assert.sameValue(result.byteLength, 0, "slice(+Infinity, 6)");

View File

@ -17,10 +17,12 @@ info: |
var arrayBuffer = new ArrayBuffer(8);
var start = 0, end = 4.5;
var start = 0,
end = 4.5;
var result = arrayBuffer.slice(start, end);
assert.sameValue(result.byteLength, 4, "slice(0, 4.5)");
var start = 0, end = NaN;
var start = 0,
end = NaN;
var result = arrayBuffer.slice(start, end);
assert.sameValue(result.byteLength, 0, "slice(0, NaN)");

View File

@ -17,10 +17,12 @@ info: |
var arrayBuffer = new ArrayBuffer(8);
var start = 4.5, end = 8;
var start = 4.5,
end = 8;
var result = arrayBuffer.slice(start, end);
assert.sameValue(result.byteLength, 4, "slice(4.5, 8)");
var start = NaN, end = 8;
var start = NaN,
end = 8;
var result = arrayBuffer.slice(start, end);
assert.sameValue(result.byteLength, 8, "slice(NaN, 8)");