Bug 1372427 - add "dot-location" rule so that dots are on the same line as properties. r=mattn
MozReview-Commit-ID: A6IKfSiVXAN
--- a/toolkit/components/satchel/.eslintrc.js
+++ b/toolkit/components/satchel/.eslintrc.js
@@ -35,10 +35,11 @@ module.exports = {
}],
"block-scoped-var": "error",
"no-use-before-define": ["error", {
functions: false,
}],
complexity: ["error", {
max: 20,
}],
+ "dot-location": ["error", "property"],
},
};
--- a/toolkit/components/satchel/FormHistory.jsm
+++ b/toolkit/components/satchel/FormHistory.jsm
@@ -125,23 +125,23 @@ var Prefs = {
function log(aMessage) {
if (Prefs.debug) {
Services.console.logStringMessage("FormHistory: " + aMessage);
}
}
function sendNotification(aType, aData) {
if (typeof aData == "string") {
- let strWrapper = Cc["@mozilla.org/supports-string;1"].
- createInstance(Ci.nsISupportsString);
+ let strWrapper = Cc["@mozilla.org/supports-string;1"]
+ .createInstance(Ci.nsISupportsString);
strWrapper.data = aData;
aData = strWrapper;
} else if (typeof aData == "number") {
- let intWrapper = Cc["@mozilla.org/supports-PRInt64;1"].
- createInstance(Ci.nsISupportsPRInt64);
+ let intWrapper = Cc["@mozilla.org/supports-PRInt64;1"]
+ .createInstance(Ci.nsISupportsPRInt64);
intWrapper.data = aData;
aData = intWrapper;
} else if (aData) {
throw Components.Exception("Invalid type " + (typeof aType) + " passed to sendNotification",
Cr.NS_ERROR_ILLEGAL_VALUE);
}
Services.obs.notifyObservers(aData, "satchel-storage-changed", aType);
--- a/toolkit/components/satchel/FormHistoryStartup.js
+++ b/toolkit/components/satchel/FormHistoryStartup.js
@@ -53,18 +53,18 @@ FormHistoryStartup.prototype = {
// triggers needed service cleanup and db shutdown
Services.obs.addObserver(this, "profile-before-change", true);
Services.obs.addObserver(this, "formhistory-expire-now", true);
Services.ppmm.loadProcessScript("chrome://satchel/content/formSubmitListener.js", true);
Services.ppmm.addMessageListener("FormHistory:FormSubmitEntries", this);
- let messageManager = Cc["@mozilla.org/globalmessagemanager;1"].
- getService(Ci.nsIMessageListenerManager);
+ let messageManager = Cc["@mozilla.org/globalmessagemanager;1"]
+ .getService(Ci.nsIMessageListenerManager);
// For each of these messages, we could receive them from content,
// or we might receive them from the ppmm if the searchbar is
// having its history queried.
for (let manager of [messageManager, Services.ppmm]) {
manager.addMessageListener("FormHistory:AutoCompleteSearchAsync", this);
manager.addMessageListener("FormHistory:RemoveEntry", this);
}
},
--- a/toolkit/components/satchel/test/parent_utils.js
+++ b/toolkit/components/satchel/test/parent_utils.js
@@ -3,19 +3,19 @@
/* global assert */
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
Cu.import("resource://gre/modules/FormHistory.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://testing-common/ContentTaskUtils.jsm");
-var gAutocompletePopup = Services.ww.activeWindow.
- document.
- getElementById("PopupAutoComplete");
+var gAutocompletePopup = Services.ww.activeWindow
+ .document
+ .getElementById("PopupAutoComplete");
assert.ok(gAutocompletePopup, "Got autocomplete popup");
var ParentUtils = {
getMenuEntries() {
let entries = [];
let numRows = gAutocompletePopup.view.matchCount;
for (let i = 0; i < numRows; i++) {
entries.push(gAutocompletePopup.view.getValueAt(i));
--- a/toolkit/components/satchel/test/unit/head_satchel.js
+++ b/toolkit/components/satchel/test/unit/head_satchel.js
@@ -12,23 +12,23 @@ Cu.import("resource://gre/modules/FormHi
do_get_profile();
var dirSvc = Cc["@mozilla.org/file/directory_service;1"]
.getService(Ci.nsIProperties);
// Send the profile-after-change notification to the form history component to ensure
// that it has been initialized.
-var formHistoryStartup = Cc["@mozilla.org/satchel/form-history-startup;1"].
- getService(Ci.nsIObserver);
+var formHistoryStartup = Cc["@mozilla.org/satchel/form-history-startup;1"]
+ .getService(Ci.nsIObserver);
formHistoryStartup.observe(null, "profile-after-change", null);
function getDBVersion(dbfile) {
- var ss = Cc["@mozilla.org/storage/service;1"].
- getService(Ci.mozIStorageService);
+ var ss = Cc["@mozilla.org/storage/service;1"]
+ .getService(Ci.mozIStorageService);
var dbConnection = ss.openDatabase(dbfile);
var version = dbConnection.schemaVersion;
dbConnection.close();
return version;
}
const isGUID = /[A-Za-z0-9\+\/]{16}/;
--- a/toolkit/components/satchel/test/unit/test_notify.js
+++ b/toolkit/components/satchel/test/unit/test_notify.js
@@ -58,18 +58,17 @@ function* run_test_steps() {
yield updateEntry("remove", null, null, next_test);
yield countEntries(null, null, function(num) {
do_check_false(num, "Checking initial DB is empty");
next_test();
});
// Add the observer
- var os = Cc["@mozilla.org/observer-service;1"].
- getService(Ci.nsIObserverService);
+ var os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
os.addObserver(TestObserver, "satchel-storage-changed");
/* ========== 2 ========== */
testnum++;
testdesc = "addEntry";
expectedNotification = "formhistory-add";
expectedData = entry1;
--- a/toolkit/components/satchel/test/unit/test_previous_result.js
+++ b/toolkit/components/satchel/test/unit/test_previous_result.js
@@ -13,12 +13,12 @@ var aaListener = {
onSearchResult(search, result) {
do_check_eq(result.searchString, "aa");
search.startSearch("aaa", "", result, aaaListener);
}
};
function run_test() {
do_test_pending();
- let search = Cc["@mozilla.org/autocomplete/search;1?name=form-history"].
- getService(Ci.nsIAutoCompleteSearch);
+ let search = Cc["@mozilla.org/autocomplete/search;1?name=form-history"]
+ .getService(Ci.nsIAutoCompleteSearch);
search.startSearch("aa", "", null, aaListener);
}