Bug 1330791 - Enable the no-useless-call eslint rule for /services and fix associated errors. r=markh

MozReview-Commit-ID: Ixd7jk5G5CB

--HG--
extra : rebase_source : 0f5817cb03f26c28d401706069ba9aa23f6acce3
This commit is contained in:
Jared Wein 2017-01-12 18:08:10 -05:00
Родитель 7cb8b041fe
Коммит d019dbcaa8
5 изменённых файлов: 5 добавлений и 6 удалений

Просмотреть файл

@ -21,6 +21,5 @@ module.exports = {
"no-redeclare": "warn",
"no-unreachable": "warn",
"no-unsafe-finally": "warn",
"no-useless-call": "warn"
}
};

Просмотреть файл

@ -54,7 +54,7 @@ EventSource.prototype = {
CommonUtils.nextTick(
function() {
for (let listener of this.listeners.get(type)) {
listener.call(undefined, arg);
listener(arg);
}
},
this

Просмотреть файл

@ -12,7 +12,7 @@ const StubAlertsService = {
showAlertNotification(image, title, text, clickable, cookie, clickCallback) {
// We can't simulate a click on the alert popup,
// so instead we call the click listener ourselves directly
clickCallback.observe.call(clickCallback, null, "alertclickcallback", null);
clickCallback.observe(null, "alertclickcallback", null);
}
}

Просмотреть файл

@ -487,7 +487,7 @@ AddonsReconciler.prototype = {
for (let listener of this._listeners) {
try {
listener.changeListener.call(listener, date, change, state);
listener.changeListener(date, change, state);
} catch (ex) {
this._log.warn("Exception calling change listener", ex);
}

Просмотреть файл

@ -1082,7 +1082,7 @@ add_task(async function test_upload_after_reboot() {
engine.sendCommand("displayURI", ["https://example.com", engine.localID, "Yak Herders Anonymous"], deviceBID);
const oldUploadOutgoing = SyncEngine.prototype._uploadOutgoing;
SyncEngine.prototype._uploadOutgoing = () => engine._onRecordsWritten.call(engine, [], [deviceBID]);
SyncEngine.prototype._uploadOutgoing = () => engine._onRecordsWritten([], [deviceBID]);
engine._sync();
let collection = server.getCollection("foo", "clients");
@ -1182,7 +1182,7 @@ add_task(async function test_keep_cleared_commands_after_reboot() {
let collection = server.getCollection("foo", "clients");
const oldUploadOutgoing = SyncEngine.prototype._uploadOutgoing;
SyncEngine.prototype._uploadOutgoing = () => engine._onRecordsWritten.call(engine, [], [deviceBID]);
SyncEngine.prototype._uploadOutgoing = () => engine._onRecordsWritten([], [deviceBID]);
let commandsProcessed = 0;
engine._handleDisplayURIs = (uris) => { commandsProcessed = uris.length };