mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
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
|
@ -1193,7 +1193,9 @@ function createPromiseCapability() {
|
|||
}
|
||||
if (typeof globalScope.Promise.resolve !== 'function') {
|
||||
globalScope.Promise.resolve = function (value) {
|
||||
return new globalScope.Promise(function (resolve) { resolve(value); });
|
||||
return new globalScope.Promise(function (resolve) {
|
||||
resolve(value);
|
||||
});
|
||||
};
|
||||
}
|
||||
if (typeof globalScope.Promise.reject !== 'function') {
|
||||
|
@ -1401,7 +1403,9 @@ if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('MOZCENTRAL')) {
|
|||
* @returns {Promise}
|
||||
*/
|
||||
Promise.resolve = function Promise_resolve(value) {
|
||||
return new Promise(function (resolve) { resolve(value); });
|
||||
return new Promise(function (resolve) {
|
||||
resolve(value);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -1410,7 +1414,9 @@ if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('MOZCENTRAL')) {
|
|||
* @returns {Promise}
|
||||
*/
|
||||
Promise.reject = function Promise_reject(reason) {
|
||||
return new Promise(function (resolve, reject) { reject(reason); });
|
||||
return new Promise(function (resolve, reject) {
|
||||
reject(reason);
|
||||
});
|
||||
};
|
||||
|
||||
Promise.prototype = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue