Bug 1372427 - add "no-use-before-define" rule. r=MattN

MozReview-Commit-ID: BRhwhnxzlpG

--HG--
extra : rebase_source : 45f74a002a90f9a9869fbd14516cb73d19ce6d84
This commit is contained in:
Jonathan Guillotte-Blouin 2017-06-13 14:34:12 -07:00
Родитель 5a66b3e817
Коммит cc4c1778c4
4 изменённых файлов: 22 добавлений и 19 удалений

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

@ -34,5 +34,8 @@ module.exports = {
requireReturnDescription: false,
}],
"block-scoped-var": "error",
"no-use-before-define": ["error", {
functions: false,
}],
},
};

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

@ -462,6 +462,20 @@ function dbInit() {
}
}
var Migrators = {
/*
* Updates the DB schema to v3 (bug 506402).
* Adds deleted form history table.
*/
dbMigrateToVersion4() {
if (!_dbConnection.tableExists("moz_deleted_formhistory")) {
let table = dbSchema.tables["moz_deleted_formhistory"];
let tSQL = Object.keys(table).map(col => [col, table[col]].join(" ")).join(", ");
_dbConnection.createTable("moz_deleted_formhistory", tSQL);
}
}
};
function dbCreate() {
log("Creating DB -- tables");
for (let name in dbSchema.tables) {
@ -525,20 +539,6 @@ function dbMigrate(oldVersion) {
log("DB migration completed.");
}
var Migrators = {
/*
* Updates the DB schema to v3 (bug 506402).
* Adds deleted form history table.
*/
dbMigrateToVersion4() {
if (!_dbConnection.tableExists("moz_deleted_formhistory")) {
let table = dbSchema.tables["moz_deleted_formhistory"];
let tSQL = Object.keys(table).map(col => [col, table[col]].join(" ")).join(", ");
_dbConnection.createTable("moz_deleted_formhistory", tSQL);
}
}
};
/**
* Sanity check to ensure that the columns this version of the code expects
* are present in the DB we're using.

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

@ -92,6 +92,7 @@ FormHistoryStartup.prototype = {
}
let mm;
let query = null;
if (message.target instanceof Ci.nsIMessageListenerManager) {
// The target is the PPMM, meaning that the parent process
// is requesting FormHistory data on the searchbar.
@ -110,7 +111,7 @@ FormHistoryStartup.prototype = {
// Check that the current query is still the one we created. Our
// query might have been canceled shortly before completing, in
// that case we don't want to call the callback anymore.
if (query == this.pendingQuery) {
if (query === this.pendingQuery) {
this.pendingQuery = null;
if (!aReason) {
mm.sendAsyncMessage("FormHistory:AutoCompleteSearchResults",
@ -120,8 +121,7 @@ FormHistoryStartup.prototype = {
}
};
let query = FormHistory.getAutoCompleteResults(searchString, params,
processResults);
query = FormHistory.getAutoCompleteResults(searchString, params, processResults);
this.pendingQuery = query;
break;
}

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

@ -79,6 +79,8 @@ function checkSelectedIndexAfterResponseTime(expectedIndex) {
});
}
let input = $_(1, "field1");
function doKeyUnprivileged(key) {
let keyName = "DOM_VK_" + key.toUpperCase();
let keycode, charcode, alwaysval;
@ -127,8 +129,6 @@ function doClickWithMouseEventUnprivileged() {
input.dispatchEvent(ckEvent);
}
let input = $_(1, "field1");
add_task(async function test_initialize() {
await new Promise(resolve => updateFormHistory([
{ op: "remove" },