Adjust the brace-style
ESLint rule to disallow single lines (and also enable no-iterator
)
See http://eslint.org/docs/rules/brace-style. Having the opening/closing braces on the same line can often make the code slightly more difficult to read, in particular for `if`/`else if` statements, compared to using new lines. This patch also, for consistency with `mozilla-central`, enables the [`no-iterator`](http://eslint.org/docs/rules/no-iterator) rule. Note that this rule didn't require a single code change.
This commit is contained in:
parent
92e5fb099e
commit
bc736fdc7d
18 changed files with 129 additions and 46 deletions
|
@ -84,7 +84,9 @@ function createExtensionGlobal() {
|
|||
// Network-related mocks.
|
||||
window.Request = {};
|
||||
window.Request.prototype = {
|
||||
get mode() { throw new TypeError('Illegal invocation'); },
|
||||
get mode() {
|
||||
throw new TypeError('Illegal invocation');
|
||||
},
|
||||
};
|
||||
window.fetch = function(url, options) {
|
||||
assert.equal(url, LOG_URL);
|
||||
|
@ -339,7 +341,9 @@ var tests = [
|
|||
var window = createExtensionGlobal();
|
||||
var didWarn = false;
|
||||
window.console = {};
|
||||
window.console.warn = function() { didWarn = true; };
|
||||
window.console.warn = function() {
|
||||
didWarn = true;
|
||||
};
|
||||
window.chrome.runtime.id = 'abcdefghijklmnopabcdefghijklmnop';
|
||||
telemetryScript.runInNewContext(window);
|
||||
assert.deepEqual(window.test_requests, []);
|
||||
|
@ -373,7 +377,9 @@ var tests = [
|
|||
function test_fetch_mode_not_supported() {
|
||||
var window = createExtensionGlobal();
|
||||
delete window.Request.prototype.mode;
|
||||
window.fetch = function() { throw new Error('Unexpected call to fetch!'); };
|
||||
window.fetch = function() {
|
||||
throw new Error('Unexpected call to fetch!');
|
||||
};
|
||||
telemetryScript.runInNewContext(window);
|
||||
assert.deepEqual(window.test_requests, [{
|
||||
'Deduplication-Id': '4242424242',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue