Skip to content

Commit

Permalink
Fixup indentation from PR 21354
Browse files Browse the repository at this point in the history
#21354 used an approach
which was known to cause indentation problems in some cases. This commit
is an attempt to fixup any indentation issues, by running a (hacky)
script to parse the diff and locate places where indentation was broken.
  • Loading branch information
stephenmcgruer committed Jan 27, 2020
1 parent e4499c8 commit 88ab2f0
Show file tree
Hide file tree
Showing 41 changed files with 115 additions and 115 deletions.
2 changes: 1 addition & 1 deletion FileAPI/blob/Blob-constructor-endings.html
Expand Up @@ -37,7 +37,7 @@
{}
].forEach(value => test(t => {
assert_throws_js(TypeError, () => new Blob([], {endings: value}),
'Blob constructor should throw');
'Blob constructor should throw');
}, `Invalid "endings" value: ${JSON.stringify(value)}`));

test(t => {
Expand Down
2 changes: 1 addition & 1 deletion FileAPI/blob/Blob-constructor.html
Expand Up @@ -465,7 +465,7 @@
].forEach(arg => {
test(t => {
assert_throws_js(TypeError, () => new Blob([], arg),
'Blob constructor should throw with invalid property bag');
'Blob constructor should throw with invalid property bag');
}, `Passing ${JSON.stringify(arg)} for options should throw`);
});

Expand Down
2 changes: 1 addition & 1 deletion FileAPI/file/File-constructor-endings.html
Expand Up @@ -37,7 +37,7 @@
{}
].forEach(value => test(t => {
assert_throws_js(TypeError, () => new File([], "name", {endings: value}),
'File constructor should throw');
'File constructor should throw');
}, `Invalid "endings" value: ${JSON.stringify(value)}`));

test(t => {
Expand Down
14 changes: 7 additions & 7 deletions FileAPI/file/File-constructor.html
Expand Up @@ -15,9 +15,9 @@

test(t => {
assert_throws_js(TypeError, () => new File(),
'Bits argument is required');
'Bits argument is required');
assert_throws_js(TypeError, () => new File([]),
'Name argument is required');
'Name argument is required');
}, 'Required arguments');

function test_first_argument(arg1, expectedSize, testName) {
Expand Down Expand Up @@ -65,13 +65,13 @@
].forEach(arg => {
test(t => {
assert_throws_js(TypeError, () => new File(arg, 'world.html'),
'Constructor should throw for invalid bits argument');
'Constructor should throw for invalid bits argument');
}, `Invalid bits argument: ${JSON.stringify(arg)}`);
});

test(t => {
assert_throws_js(Error, () => new File([to_string_throws], 'name.txt'),
'Constructor should propagate exceptions');
'Constructor should propagate exceptions');
}, 'Bits argument: object that throws');


Expand Down Expand Up @@ -132,7 +132,7 @@
].forEach(arg => {
test(t => {
assert_throws_js(TypeError, () => new File(['bits'], 'name.txt', arg),
'Constructor should throw for invalid property bag type');
'Constructor should throw for invalid property bag type');
}, `Invalid property bag: ${JSON.stringify(arg)}`);
});

Expand All @@ -151,8 +151,8 @@

test(t => {
assert_throws_js(Error,
() => new File(['bits'], 'name.txt', {type: to_string_throws}),
'Constructor should propagate exceptions');
() => new File(['bits'], 'name.txt', {type: to_string_throws}),
'Constructor should propagate exceptions');
}, 'Property bag propagates exceptions');

</script>
2 changes: 1 addition & 1 deletion css/cssom/getComputedStyle-pseudo.html
Expand Up @@ -139,6 +139,6 @@
test(function() {
var div = document.getElementById('test');
assert_throws_js(TypeError, () => getComputedStyle(div, "totallynotapseudo"),
"getComputedStyle with an unknown pseudo-element throws");
"getComputedStyle with an unknown pseudo-element throws");
}, "Unknown pseudo-elements throw");
</script>
2 changes: 1 addition & 1 deletion dom/events/Event-constructors.html
Expand Up @@ -47,7 +47,7 @@
})
test(function() {
assert_throws_js(TypeError, function() { Event("test") },
'Calling Event constructor without "new" must throw');
'Calling Event constructor without "new" must throw');
})
test(function() {
var ev = new Event("I am an event", { bubbles: true, cancelable: false})
Expand Down
14 changes: 7 additions & 7 deletions encoding/streams/decode-attributes.any.js
Expand Up @@ -47,7 +47,7 @@ for (const trueValue of [true, 1, {}, [], 'yes']) {

test(() => {
assert_throws_js(RangeError, () => new TextDecoderStream(''),
'the constructor should throw');
'the constructor should throw');
}, 'constructing with an invalid encoding should throw');

test(() => {
Expand All @@ -58,14 +58,14 @@ test(() => {

test(() => {
assert_throws_js(Error,
() => new TextDecoderStream('utf-8', {
get fatal() { throw new Error(); }
}), 'the constructor should throw');
() => new TextDecoderStream('utf-8', {
get fatal() { throw new Error(); }
}), 'the constructor should throw');
}, 'a throwing fatal member should cause the constructor to throw');

test(() => {
assert_throws_js(Error,
() => new TextDecoderStream('utf-8', {
get ignoreBOM() { throw new Error(); }
}), 'the constructor should throw');
() => new TextDecoderStream('utf-8', {
get ignoreBOM() { throw new Error(); }
}), 'the constructor should throw');
}, 'a throwing ignoreBOM member should cause the constructor to throw');
4 changes: 2 additions & 2 deletions fetch/api/headers/headers-record.html
Expand Up @@ -257,7 +257,7 @@

// Returning duplicate keys from ownKeys() throws a TypeError.
assert_throws_js(TypeError,
function() { var h = new Headers(proxy); });
function() { var h = new Headers(proxy); });

assert_equals(log.length, 2);
// The first thing is the [[Get]] of Symbol.iterator to figure out whether
Expand All @@ -280,7 +280,7 @@
c: "d" };
var proxy = new Proxy(record, loggingHandler);
assert_throws_js(TypeError,
function() { var h = new Headers(proxy); });
function() { var h = new Headers(proxy); });

assert_equals(log.length, 7);
// The first thing is the [[Get]] of Symbol.iterator to figure out whether
Expand Down
8 changes: 4 additions & 4 deletions generic-sensor/generic-sensor-tests.js
Expand Up @@ -487,8 +487,8 @@ function runGenericSensorTests(sensorName,
];
invalidFreqs.map(freq => {
assert_throws_js(TypeError,
() => { new sensorType({frequency: freq}) },
`when freq is ${freq}`);
() => { new sensorType({frequency: freq}) },
`when freq is ${freq}`);
});
}, `${sensorName}: throw 'TypeError' if frequency is invalid.`);

Expand Down Expand Up @@ -539,8 +539,8 @@ function runGenericSensorTests(sensorName,
];
invalidRefFrames.map(refFrame => {
assert_throws_js(TypeError,
() => { new sensorType({referenceFrame: refFrame}) },
`when refFrame is ${refFrame}`);
() => { new sensorType({referenceFrame: refFrame}) },
`when refFrame is ${refFrame}`);
});
}, `${sensorName}: throw 'TypeError' if referenceFrame is not one of\
enumeration values.`);
Expand Down
Expand Up @@ -17,10 +17,10 @@

// No promise is passed.
assert_throws_js(TypeError,
function() {
new PromiseRejectionEvent('eventType', { bubbles: false });
},
'Cannot construct PromiseRejectionEventInit without promise');
function() {
new PromiseRejectionEvent('eventType', { bubbles: false });
},
'Cannot construct PromiseRejectionEventInit without promise');

// bubbles is passed.
assert_equals(new PromiseRejectionEvent('eventType', { bubbles: false, promise: p }).bubbles, false);
Expand Down
8 changes: 4 additions & 4 deletions mediacapture-image/ImageCapture-creation.https.html
Expand Up @@ -83,12 +83,12 @@
true
];
assert_throws_js(TypeError,
function() { var capturer = new ImageCapture(); },
'an ImageCapturer can not be created with no parameter');
function() { var capturer = new ImageCapture(); },
'an ImageCapturer cannot be created with no parameter');
invalidParameters.map(parameter => {
assert_throws_js(TypeError,
function() { var capturer = new ImageCapture(parameter); },
`an ImageCapturer can not be created with a ${parameter} parameter`);
function() { var capturer = new ImageCapture(parameter); },
`an ImageCapturer cannot be created with a ${parameter} parameter`);
});
}, 'throw "TypeError" if parameter is not MediaStreamTrack.');

Expand Down
10 changes: 5 additions & 5 deletions streams/piping/pipe-through.any.js
Expand Up @@ -100,8 +100,8 @@ const badReadables = [null, undefined, 0, NaN, true, 'ReadableStream', Object.cr
for (const readable of badReadables) {
test(() => {
assert_throws_js(TypeError,
ReadableStream.prototype.pipeThrough.bind(readable, uninterestingReadableWritablePair()),
'pipeThrough should throw');
ReadableStream.prototype.pipeThrough.bind(readable, uninterestingReadableWritablePair()),
'pipeThrough should throw');
}, `pipeThrough should brand-check this and not allow '${readable}'`);

test(() => {
Expand Down Expand Up @@ -176,7 +176,7 @@ for (const signal of badSignals) {
test(() => {
const rs = new ReadableStream();
assert_throws_js(TypeError, () => rs.pipeThrough(uninterestingReadableWritablePair(), { signal }),
'pipeThrough should throw');
'pipeThrough should throw');
}, `invalid values of signal should throw; specifically '${signal}'`);
}

Expand All @@ -191,7 +191,7 @@ test(() => {
const rs = new ReadableStream();
rs.getReader();
assert_throws_js(TypeError, () => rs.pipeThrough(uninterestingReadableWritablePair()),
'pipeThrough should throw');
'pipeThrough should throw');
}, 'pipeThrough should throw if this is locked');

test(() => {
Expand All @@ -200,7 +200,7 @@ test(() => {
const readable = new ReadableStream();
writable.getWriter();
assert_throws_js(TypeError, () => rs.pipeThrough({writable, readable}),
'pipeThrough should throw');
'pipeThrough should throw');
}, 'pipeThrough should throw if writable is locked');

test(() => {
Expand Down
6 changes: 3 additions & 3 deletions streams/readable-byte-streams/brand-checks.any.js
Expand Up @@ -107,14 +107,14 @@ test(() => {
test(() => {

assert_throws_js(TypeError, () => new ReadableByteStreamController(fakeRS()),
'Constructing a ReadableByteStreamController should throw');
'Constructing a ReadableByteStreamController should throw');

}, 'ReadableByteStreamController enforces a brand check on its arguments');

test(() => {

assert_throws_js(TypeError, () => new ReadableByteStreamController(realRS()),
'Constructing a ReadableByteStreamController should throw');
'Constructing a ReadableByteStreamController should throw');

}, 'ReadableByteStreamController can\'t be given a fully-constructed ReadableStream');

Expand Down Expand Up @@ -175,7 +175,7 @@ promise_test(t => {
function brandChecks() {
for (const badController of [fakeRBSController(), realRS(), realRSBYOBReader(), undefined, null]) {
assert_throws_js(TypeError, () => new ReadableStreamBYOBRequest(badController, new Uint8Array(1)),
'ReadableStreamBYOBRequest constructor must throw for an invalid controller argument');
'ReadableStreamBYOBRequest constructor must throw for an invalid controller argument');
}
getterThrowsForAll(ReadableStreamBYOBRequest.prototype, 'view',
[fakeRSBYOBRequest(), realRS(), realRSBYOBReader(), realRBSController(), undefined, null]);
Expand Down
Expand Up @@ -49,7 +49,7 @@ function runTests(ReadableStreamBYOBRequest) {
const view = createDummyObject(Uint8Array.prototype, viewType, () => new Uint8Array(16));
test(() => {
assert_throws_js(TypeError, () => new ReadableStreamBYOBRequest(controller, view),
'constructor should throw');
'constructor should throw');
}, `ReadableStreamBYOBRequest constructor should throw when passed a ${controllerType} ` +
`ReadableByteStreamController and a ${viewType} view`);
}
Expand Down
14 changes: 7 additions & 7 deletions streams/readable-byte-streams/general.any.js
Expand Up @@ -1990,7 +1990,7 @@ promise_test(() => {
const reader = rs.getReader({ mode: 'byob' });
return reader.read(newView()).then(() => {
assert_throws_js(TypeError, () => byobRequest.respondWithNewView(newView()),
'respondWithNewView() should throw a TypeError');
'respondWithNewView() should throw a TypeError');
});
}, 'calling respondWithNewView() twice on the same byobRequest should throw');

Expand Down Expand Up @@ -2102,20 +2102,20 @@ test(() => {
}), 'constructor should throw for size function');

assert_throws_js(RangeError, () => new ReadableStream({ type: 'bytes' }, { size: null }),
'constructor should throw for size defined');
'constructor should throw for size defined');

assert_throws_js(RangeError,
() => new ReadableStream({ type: 'bytes' }, new CountQueuingStrategy({ highWaterMark: 1 })),
'constructor should throw when strategy is CountQueuingStrategy');
() => new ReadableStream({ type: 'bytes' }, new CountQueuingStrategy({ highWaterMark: 1 })),
'constructor should throw when strategy is CountQueuingStrategy');

assert_throws_js(RangeError,
() => new ReadableStream({ type: 'bytes' }, new ByteLengthQueuingStrategy({ highWaterMark: 512 })),
'constructor should throw when strategy is ByteLengthQueuingStrategy');
() => new ReadableStream({ type: 'bytes' }, new ByteLengthQueuingStrategy({ highWaterMark: 512 })),
'constructor should throw when strategy is ByteLengthQueuingStrategy');

class HasSizeMethod {
size() {}
}

assert_throws_js(RangeError, () => new ReadableStream({ type: 'bytes' }, new HasSizeMethod()),
'constructor should throw when size on the prototype chain');
'constructor should throw when size on the prototype chain');
}, 'ReadableStream constructor should not accept a strategy with a size defined if type is "bytes"');
6 changes: 3 additions & 3 deletions streams/readable-streams/brand-checks.any.js
Expand Up @@ -120,7 +120,7 @@ test(() => {
test(() => {

assert_throws_js(TypeError, () => new ReadableStreamDefaultReader(fakeRS()),
'Constructing a ReadableStreamDefaultReader should throw');
'Constructing a ReadableStreamDefaultReader should throw');

}, 'ReadableStreamDefaultReader enforces a brand check on its argument');

Expand Down Expand Up @@ -155,14 +155,14 @@ test(() => {
test(() => {

assert_throws_js(TypeError, () => new ReadableStreamDefaultController(fakeRS()),
'Constructing a ReadableStreamDefaultController should throw');
'Constructing a ReadableStreamDefaultController should throw');

}, 'ReadableStreamDefaultController enforces a brand check on its argument');

test(() => {

assert_throws_js(TypeError, () => new ReadableStreamDefaultController(realRS()),
'Constructing a ReadableStreamDefaultController should throw');
'Constructing a ReadableStreamDefaultController should throw');

}, 'ReadableStreamDefaultController can\'t be given a fully-constructed ReadableStream');

Expand Down
2 changes: 1 addition & 1 deletion streams/readable-streams/default-reader.any.js
Expand Up @@ -69,7 +69,7 @@ test(() => {
const rs = new ReadableStream();
new ReadableStreamDefaultReader(rs); // Constructing directly the first time should be fine.
assert_throws_js(TypeError, () => new ReadableStreamDefaultReader(rs),
'constructing directly the second time should fail');
'constructing directly the second time should fail');

}, 'Constructing a ReadableStreamDefaultReader directly should fail if the stream is already locked (via direct ' +
'construction)');
Expand Down
2 changes: 1 addition & 1 deletion streams/resources/test-utils.js
Expand Up @@ -44,7 +44,7 @@ self.methodThrowsForAll = (obj, methodName, targets, args) => {

self.constructorThrowsForAll = (constructor, firstArgs) => {
firstArgs.forEach(firstArg => assert_throws_js(TypeError, () => new constructor(firstArg),
'constructor should throw a TypeError'));
'constructor should throw a TypeError'));
};

self.garbageCollect = () => {
Expand Down
8 changes: 4 additions & 4 deletions streams/transform-streams/strategies.any.js
Expand Up @@ -87,13 +87,13 @@ promise_test(t => {

test(() => {
assert_throws_js(RangeError, () => new TransformStream(undefined, { highWaterMark: -1 }),
'should throw RangeError for negative writableHighWaterMark');
'should throw RangeError for negative writableHighWaterMark');
assert_throws_js(RangeError, () => new TransformStream(undefined, undefined, { highWaterMark: -1 }),
'should throw RangeError for negative readableHighWaterMark');
'should throw RangeError for negative readableHighWaterMark');
assert_throws_js(RangeError, () => new TransformStream(undefined, { highWaterMark: NaN }),
'should throw RangeError for NaN writableHighWaterMark');
'should throw RangeError for NaN writableHighWaterMark');
assert_throws_js(RangeError, () => new TransformStream(undefined, undefined, { highWaterMark: NaN }),
'should throw RangeError for NaN readableHighWaterMark');
'should throw RangeError for NaN readableHighWaterMark');
}, 'a RangeError should be thrown for an invalid highWaterMark');

const objectThatConvertsTo42 = {
Expand Down

0 comments on commit 88ab2f0

Please sign in to comment.