From 7ce0e0df279c817e6109c39bc9818455379a792f Mon Sep 17 00:00:00 2001 From: Dave Townsend Date: Wed, 6 Jan 2016 10:10:35 -0800 Subject: [PATCH] Bug 1237340: Fix browser and toolkit eslint failures. r=Felipe --- .eslintignore | 1 + browser/extensions/pocket/content/main.js | 4 ++-- .../pocket/content/panels/js/messages.js | 2 +- .../extensions/pocket/content/panels/js/tmpl.js | 2 +- browser/extensions/pocket/content/pktApi.jsm | 2 +- testing/mochitest/browser.eslintrc | 2 -- testing/mochitest/chrome.eslintrc | 2 -- testing/mochitest/mochitest.eslintrc | 2 -- testing/xpcshell/xpcshell.eslintrc | 2 -- .../components/extensions/ExtensionUtils.jsm | 2 +- toolkit/content/aboutProfiles.js | 17 ++++++++--------- toolkit/content/jar.mn | 2 +- .../test/xpcshell/test_duplicateplugins.js | 3 --- 13 files changed, 16 insertions(+), 27 deletions(-) diff --git a/.eslintignore b/.eslintignore index 0bc9207534b..0b5a61b43c7 100644 --- a/.eslintignore +++ b/.eslintignore @@ -83,6 +83,7 @@ browser/components/tabview/** browser/components/translation/** browser/components/uitour/** browser/extensions/pdfjs/** +browser/extensions/pocket/content/panels/js/vendor/** browser/extensions/shumway/** browser/fuel/** browser/locales/** diff --git a/browser/extensions/pocket/content/main.js b/browser/extensions/pocket/content/main.js index c13435551e0..4eda540b193 100644 --- a/browser/extensions/pocket/content/main.js +++ b/browser/extensions/pocket/content/main.js @@ -197,7 +197,7 @@ var pktUI = (function() { // Send error message for invalid url if (!isValidURL) { // TODO: Pass key for localized error in error object - var error = { + let error = { message: 'Only links can be saved', localizedKey: "onlylinkssaved" }; @@ -208,7 +208,7 @@ var pktUI = (function() { // Check online state if (!navigator.onLine) { // TODO: Pass key for localized error in error object - var error = { + let error = { message: 'You must be connected to the Internet in order to save to Pocket. Please connect to the Internet and try again.' }; pktUIMessaging.sendErrorMessageToPanel(panelId, saveLinkMessageId, error); diff --git a/browser/extensions/pocket/content/panels/js/messages.js b/browser/extensions/pocket/content/panels/js/messages.js index 5cf52a030b7..2ef91046bb6 100644 --- a/browser/extensions/pocket/content/panels/js/messages.js +++ b/browser/extensions/pocket/content/panels/js/messages.js @@ -75,4 +75,4 @@ var pktPanelMessaging = (function() { removeMessageListener : removeMessageListener, sendMessage: sendMessage }; -}()); \ No newline at end of file +}()); diff --git a/browser/extensions/pocket/content/panels/js/tmpl.js b/browser/extensions/pocket/content/panels/js/tmpl.js index 469ccfc8456..4ab06e8a19a 100644 --- a/browser/extensions/pocket/content/panels/js/tmpl.js +++ b/browser/extensions/pocket/content/panels/js/tmpl.js @@ -147,4 +147,4 @@ templates['signupstoryboard_shell'] = template({"1":function(depth0,helpers,part + escapeExpression(((helper = (helper = helpers.loginnow || (depth0 != null ? depth0.loginnow : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"loginnow","hash":{},"data":data}) : helper))) + ".

\n"; },"useData":true}); -})(); \ No newline at end of file +})(); diff --git a/browser/extensions/pocket/content/pktApi.jsm b/browser/extensions/pocket/content/pktApi.jsm index 2e0033f38dc..c5e89431cca 100644 --- a/browser/extensions/pocket/content/pktApi.jsm +++ b/browser/extensions/pocket/content/pktApi.jsm @@ -123,7 +123,7 @@ var pktApi = (function() { // https://developer.mozilla.org/en-US/Add-ons/Overlay_Extensions/XUL_School/Local_Storage if (!prefBranch.prefHasUserValue(key)) - return; + return undefined; return prefBranch.getComplexValue(key, Components.interfaces.nsISupportsString).data; } diff --git a/testing/mochitest/browser.eslintrc b/testing/mochitest/browser.eslintrc index 80f3b9a5aac..ee4efb7c55a 100644 --- a/testing/mochitest/browser.eslintrc +++ b/testing/mochitest/browser.eslintrc @@ -1,8 +1,6 @@ // Parent config file for all browser-chrome files. { "rules": { - // Head files want to define globals so don't warn for unused globals - "no-unused-vars": [2, {"vars": "local", "args": "none"}], "mozilla/import-headjs-globals": 1, "mozilla/import-browserjs-globals": 1, }, diff --git a/testing/mochitest/chrome.eslintrc b/testing/mochitest/chrome.eslintrc index ec110aee117..5a56d84195a 100644 --- a/testing/mochitest/chrome.eslintrc +++ b/testing/mochitest/chrome.eslintrc @@ -1,8 +1,6 @@ // Parent config file for all mochitest files. { rules: { - // Head files want to define globals so don't warn for unused globals - "no-unused-vars": [2, {"vars": "local", "args": "none"}], "mozilla/import-headjs-globals": 1, }, diff --git a/testing/mochitest/mochitest.eslintrc b/testing/mochitest/mochitest.eslintrc index ec110aee117..5a56d84195a 100644 --- a/testing/mochitest/mochitest.eslintrc +++ b/testing/mochitest/mochitest.eslintrc @@ -1,8 +1,6 @@ // Parent config file for all mochitest files. { rules: { - // Head files want to define globals so don't warn for unused globals - "no-unused-vars": [2, {"vars": "local", "args": "none"}], "mozilla/import-headjs-globals": 1, }, diff --git a/testing/xpcshell/xpcshell.eslintrc b/testing/xpcshell/xpcshell.eslintrc index 60567f51e71..d4394fabc4e 100644 --- a/testing/xpcshell/xpcshell.eslintrc +++ b/testing/xpcshell/xpcshell.eslintrc @@ -1,8 +1,6 @@ // Parent config file for all xpcshell files. { rules: { - // Head files want to define globals so don't warn for unused globals - "no-unused-vars": [2, {"vars": "local", "args": "none"}], "mozilla/import-headjs-globals": 1, }, diff --git a/toolkit/components/extensions/ExtensionUtils.jsm b/toolkit/components/extensions/ExtensionUtils.jsm index f0e6c1c03f6..881702981eb 100644 --- a/toolkit/components/extensions/ExtensionUtils.jsm +++ b/toolkit/components/extensions/ExtensionUtils.jsm @@ -659,7 +659,7 @@ Port.prototype = { function getMessageManager(target) { if (target instanceof Ci.nsIFrameLoaderOwner) { return target.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader.messageManager; - } + } return target; } diff --git a/toolkit/content/aboutProfiles.js b/toolkit/content/aboutProfiles.js index d4dd581abd9..48d6e9439cd 100644 --- a/toolkit/content/aboutProfiles.js +++ b/toolkit/content/aboutProfiles.js @@ -8,6 +8,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; Cu.import('resource://gre/modules/Services.jsm'); Cu.import('resource://gre/modules/XPCOMUtils.jsm'); +Cu.import('resource://gre/modules/AppConstants.jsm'); XPCOMUtils.defineLazyServiceGetter( this, @@ -176,15 +177,13 @@ function display(profileData) { if (dir) { td.appendChild(document.createTextNode(' ')); let button = document.createElement('button'); - let buttonText = document.createTextNode(bundle.GetStringFromName( -#ifdef XP_WIN - 'winOpenDir' -#elif XP_MACOSX - 'macOpenDir' -#else - 'openDir' -#endif - )); + let string = 'openDir'; + if (AppConstants.platform == "win") { + string = 'winOpenDir'; + } else if (AppConstants.platform == "macosx") { + string = 'macOpenDir'; + } + let buttonText = document.createTextNode(bundle.GetStringFromName(string)); button.appendChild(buttonText); td.appendChild(button); diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn index 82fc28b646d..3682627e55d 100644 --- a/toolkit/content/jar.mn +++ b/toolkit/content/jar.mn @@ -24,7 +24,7 @@ toolkit.jar: content/global/aboutNetworking.js content/global/aboutNetworking.xhtml #ifndef ANDROID -* content/global/aboutProfiles.js + content/global/aboutProfiles.js content/global/aboutProfiles.xhtml #endif content/global/aboutServiceWorkers.js diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_duplicateplugins.js b/toolkit/mozapps/extensions/test/xpcshell/test_duplicateplugins.js index bba452ca9d6..e17d108ca45 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_duplicateplugins.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_duplicateplugins.js @@ -28,7 +28,6 @@ var PLUGINS = [{ get disabled() { return this.enabledState == Ci.nsIPluginTag.STATE_DISABLED; }, - filename: "", filename: "/usr/lib/plugins/dupplugin1.so" }, { name: "Duplicate Plugin 2", @@ -49,7 +48,6 @@ var PLUGINS = [{ get disabled() { return this.enabledState == Ci.nsIPluginTag.STATE_DISABLED; }, - filename: "", filename: "/usr/lib/plugins/dupplugin2.so" }, { name: "Non-duplicate Plugin", // 3 @@ -70,7 +68,6 @@ var PLUGINS = [{ get disabled() { return this.enabledState == Ci.nsIPluginTag.STATE_DISABLED; }, - filename: "", filename: "/usr/lib/plugins/dupplugin4.so" }, { name: "Another Non-duplicate Plugin", // 5