Bug 1440718 - Enable no-unused-vars for global scope on jsm files in services/sync/. r=kitcambridge

MozReview-Commit-ID: 77z0qScZw2P

--HG--
extra : rebase_source : a2fa7688e72e225bc54a047c2e46822f13af21f2
This commit is contained in:
Mark Banner 2018-02-23 17:05:05 +00:00
parent ad4d52eb38
commit 4bc9f77582
3 changed files with 5 additions and 33 deletions

View File

@ -55,7 +55,6 @@ module.exports = {
"files": [
"browser/components/**/*.jsm",
"browser/extensions/**/*.jsm",
"services/sync/**/*.jsm",
"toolkit/**/*.jsm",
],
"rules": {

View File

@ -6,41 +6,13 @@
var EXPORTED_SYMBOLS = ["Addon", "STATE_ENABLED", "STATE_DISABLED"];
ChromeUtils.import("resource://gre/modules/AddonManager.jsm");
ChromeUtils.import("resource://gre/modules/addons/AddonRepository.jsm");
ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
ChromeUtils.import("resource://services-sync/addonutils.js");
ChromeUtils.import("resource://services-sync/util.js");
ChromeUtils.import("resource://tps/logger.jsm");
const ADDONSGETURL = "http://127.0.0.1:4567/";
const STATE_ENABLED = 1;
const STATE_DISABLED = 2;
function GetFileAsText(file) {
let channel = NetUtil.newChannel({
uri: file,
loadUsingSystemPrincipal: true
});
let inputStream = channel.open2();
if (channel instanceof Ci.nsIHttpChannel &&
channel.responseStatus != 200) {
return "";
}
let streamBuf = "";
let sis = Cc["@mozilla.org/scriptableinputstream;1"]
.createInstance(Ci.nsIScriptableInputStream);
sis.init(inputStream);
let available;
while ((available = sis.available()) != 0) {
streamBuf += sis.read(available);
}
inputStream.close();
return streamBuf;
}
function Addon(TPS, id) {
this.TPS = TPS;
this.id = id;

View File

@ -7,7 +7,11 @@
* listed symbols will exposed on import, and only when and where imported.
*/
var EXPORTED_SYMBOLS = ["ACTIONS", "TPS"];
var EXPORTED_SYMBOLS = [
"ACTIONS", "Addons", "Addresses", "Bookmarks",
"Formdata", "History", "Passwords", "Prefs",
"Tabs", "TPS", "Windows"
];
var module = this;
@ -46,9 +50,6 @@ ChromeUtils.import("resource://tps/modules/prefs.jsm");
ChromeUtils.import("resource://tps/modules/tabs.jsm");
ChromeUtils.import("resource://tps/modules/windows.jsm");
var hh = Cc["@mozilla.org/network/protocol;1?name=http"]
.getService(Ci.nsIHttpProtocolHandler);
XPCOMUtils.defineLazyGetter(this, "fileProtocolHandler", () => {
let fileHandler = Services.io.getProtocolHandler("file");
return fileHandler.QueryInterface(Ci.nsIFileProtocolHandler);