From f490858f8f122ae3507fc78984d23d6717be53ba Mon Sep 17 00:00:00 2001 From: Alexandre Poirot Date: Tue, 4 Jul 2017 17:05:12 +0200 Subject: [PATCH] Bug 1378151 - Remove toolbox-process-window.js preprocessing and enable eslint. r=jdescottes MozReview-Commit-ID: 6qPg0jSsdsR --HG-- extra : rebase_source : af62ae660071fe119c73be173741152a81b848a2 --- .eslintignore | 3 -- .../framework/toolbox-process-window.js | 39 +++++++++++-------- devtools/client/jar.mn | 2 +- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/.eslintignore b/.eslintignore index 77676bc9ef92..4efd344d71f1 100644 --- a/.eslintignore +++ b/.eslintignore @@ -138,9 +138,6 @@ devtools/shared/tests/mochitest/*.html devtools/shared/webconsole/test/test_*.html # Ignore devtools pre-processed files -devtools/client/framework/toolbox-process-window.js -devtools/client/performance/system.js -devtools/client/webide/webide-prefs.js devtools/client/preferences/** # Ignore devtools third-party libs diff --git a/devtools/client/framework/toolbox-process-window.js b/devtools/client/framework/toolbox-process-window.js index 1acc3e8ce256..850e7b229118 100644 --- a/devtools/client/framework/toolbox-process-window.js +++ b/devtools/client/framework/toolbox-process-window.js @@ -31,7 +31,7 @@ var Prefs = new PrefsHelper("devtools.debugger", { var gToolbox, gClient; -var connect = Task.async(function*() { +var connect = Task.async(function* () { window.removeEventListener("load", connect); // Initiate the connection let transport = yield DebuggerClient.socketConnect({ @@ -68,7 +68,7 @@ function setPrefDefaults() { Services.prefs.setBoolPref("devtools.debugger.client-source-maps-enabled", true); } -window.addEventListener("load", function() { +window.addEventListener("load", function () { let cmdClose = document.getElementById("toolbox-cmd-close"); cmdClose.addEventListener("command", onCloseCommand); setPrefDefaults(); @@ -99,10 +99,10 @@ function openToolbox({ form, chrome, isTabActor }) { // But if we are testing, then it should always open the debugger panel. let selectedTool = Services.prefs.getCharPref("devtools.browsertoolbox.panel", - Services.prefs.getCharPref("devtools.toolbox.selectedTool", - "jsdebugger")); + Services.prefs.getCharPref("devtools.toolbox.selectedTool", + "jsdebugger")); - let options = { customIframe: frame }; + options = { customIframe: frame }; gDevTools.showToolbox(target, selectedTool, Toolbox.HostType.CUSTOM, @@ -115,7 +115,8 @@ function onNewToolbox(toolbox) { gToolbox = toolbox; bindToolboxHandlers(); raise(); - let env = Components.classes["@mozilla.org/process/environment;1"].getService(Components.interfaces.nsIEnvironment); + let env = Components.classes["@mozilla.org/process/environment;1"] + .getService(Components.interfaces.nsIEnvironment); let testScript = env.get("MOZ_TOOLBOX_TEST_SCRIPT"); if (testScript) { // Only allow executing random chrome scripts when a special @@ -139,15 +140,16 @@ function bindToolboxHandlers() { gToolbox.once("destroyed", quitApp); window.addEventListener("unload", onUnload); -#ifdef XP_MACOSX - // Badge the dock icon to differentiate this process from the main application process. - updateBadgeText(false); + if (Services.appinfo.OS == "Darwin") { + // Badge the dock icon to differentiate this process from the main application + // process. + updateBadgeText(false); - // Once the debugger panel opens listen for thread pause / resume. - gToolbox.getPanelWhenReady("jsdebugger").then(panel => { - setupThreadListeners(panel); - }); -#endif + // Once the debugger panel opens listen for thread pause / resume. + gToolbox.getPanelWhenReady("jsdebugger").then(panel => { + setupThreadListeners(panel); + }); + } } function setupThreadListeners(panel) { @@ -165,7 +167,8 @@ function setupThreadListeners(panel) { } function updateBadgeText(paused) { - let dockSupport = Cc["@mozilla.org/widget/macdocksupport;1"].getService(Ci.nsIMacDockSupport); + let dockSupport = Cc["@mozilla.org/widget/macdocksupport;1"] + .getService(Ci.nsIMacDockSupport); dockSupport.badgeText = paused ? "▐▐ " : " ▶"; } @@ -188,7 +191,9 @@ function onMessage(event) { setTitle(json.data.value); break; } - } catch(e) { console.error(e); } + } catch (e) { + console.error(e); + } } window.addEventListener("message", onMessage); @@ -212,7 +217,7 @@ function quitApp() { } } -function getParameterByName (name) { +function getParameterByName(name) { name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); let regex = new RegExp("[\\?&]" + name + "=([^&#]*)"); let results = regex.exec(window.location.search); diff --git a/devtools/client/jar.mn b/devtools/client/jar.mn index f8309a4b80be..cee78efe515d 100644 --- a/devtools/client/jar.mn +++ b/devtools/client/jar.mn @@ -84,7 +84,7 @@ devtools.jar: content/framework/toolbox-init.js (framework/toolbox-init.js) content/framework/options-panel.css (framework/options-panel.css) content/framework/toolbox-process-window.xul (framework/toolbox-process-window.xul) -* content/framework/toolbox-process-window.js (framework/toolbox-process-window.js) + content/framework/toolbox-process-window.js (framework/toolbox-process-window.js) content/framework/dev-edition-promo/dev-edition-promo.xul (framework/dev-edition-promo/dev-edition-promo.xul) * content/framework/dev-edition-promo/dev-edition-promo.css (framework/dev-edition-promo/dev-edition-promo.css) content/framework/dev-edition-promo/dev-edition-logo.png (framework/dev-edition-promo/dev-edition-logo.png)