Bug 1271084 - Apply ESLint autofixes to ignored /devtools files. r=tromey
For simple rules like function spacing, we can auto-fix these across the code base so they are followed in a consistent way. To generate this patch, I ran: ./mach eslint devtools --no-ignore --fix After this, I reverted any changes to third party files that we really do want to ignore. MozReview-Commit-ID: 6Q8BApkAW20
This commit is contained in:
@@ -29,7 +29,7 @@ var Promise = require("promise");
|
||||
*/
|
||||
exports.asyncOnce = function asyncOnce(func) {
|
||||
const promises = new WeakMap();
|
||||
return function(...args) {
|
||||
return function (...args) {
|
||||
let promise = promises.get(this);
|
||||
if (!promise) {
|
||||
promise = Task.spawn(func.apply(this, args));
|
||||
@@ -53,11 +53,11 @@ exports.asyncOnce = function asyncOnce(func) {
|
||||
* happens
|
||||
*/
|
||||
exports.listenOnce = function listenOnce(element, event, useCapture) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
var onEvent = function(ev) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
var onEvent = function (ev) {
|
||||
element.removeEventListener(event, onEvent, useCapture);
|
||||
resolve(ev);
|
||||
}
|
||||
};
|
||||
element.addEventListener(event, onEvent, useCapture);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user