diff --git a/browser/devtools/framework/target.js b/browser/devtools/framework/target.js index 0e5680c4c16e..c268b21f73e5 100644 --- a/browser/devtools/framework/target.js +++ b/browser/devtools/framework/target.js @@ -303,6 +303,7 @@ TabTarget.prototype = { this._form = tab; return true; } + return false; }); if (!this._form) { this._form = aResponse.tabs[aResponse.selected]; diff --git a/browser/devtools/framework/toolbox.js b/browser/devtools/framework/toolbox.js index 11f0bbe29bfc..f23dd98f4b41 100644 --- a/browser/devtools/framework/toolbox.js +++ b/browser/devtools/framework/toolbox.js @@ -35,6 +35,7 @@ loader.lazyGetter(this, "toolboxStrings", () => { return bundle.formatStringFromName(name, args, args.length); } catch (ex) { Services.console.logStringMessage("Error reading '" + name + "'"); + return null; } }; }); @@ -585,6 +586,7 @@ Toolbox.prototype = { deck.insertBefore(vbox, deck.childNodes[i]); return true; } + return false; }); } @@ -867,7 +869,7 @@ Toolbox.prototype = { */ switchHost: function(hostType) { if (hostType == this._host.type || !this._target.isLocalTab) { - return; + return null; } let newHost = this._createHost(hostType); @@ -1016,12 +1018,13 @@ Toolbox.prototype = { // This is done after other destruction tasks since it may tear down // fronts and the debugger transport which earlier destroy methods may // require to complete. - if (this._target) { - let target = this._target; - this._target = null; - target.off("close", this.destroy); - return target.destroy(); + if (!this._target) { + return null; } + let target = this._target; + this._target = null; + target.off("close", this.destroy); + return target.destroy(); }).then(() => { this.emit("destroyed"); // Free _host after the call to destroyed in order to let a chance diff --git a/browser/devtools/layoutview/view.js b/browser/devtools/layoutview/view.js index 3d24f7e8d728..532fac0316be 100644 --- a/browser/devtools/layoutview/view.js +++ b/browser/devtools/layoutview/view.js @@ -199,7 +199,7 @@ LayoutView.prototype = { // If the view is dimmed, no need to do anything more. if (this.dimmed) { this.inspector.emit("layoutview-updated"); - return; + return null; } for (let i in this.map) { @@ -247,7 +247,9 @@ LayoutView.prototype = { } this.inspector.emit("layoutview-updated"); + return null; }); + this._lastRequest = lastRequest; return this._lastRequest; } diff --git a/browser/devtools/sourceeditor/debugger.js b/browser/devtools/sourceeditor/debugger.js index dcaf5b3494d0..ef76e686cb4f 100644 --- a/browser/devtools/sourceeditor/debugger.js +++ b/browser/devtools/sourceeditor/debugger.js @@ -34,8 +34,10 @@ function doSearch(ctx, rev, query) { let { cm } = ctx; let state = getSearchState(cm); - if (state.query) - return searchNext(ctx, rev); + if (state.query) { + searchNext(ctx, rev); + return; + } cm.operation(function () { if (state.query) return; diff --git a/browser/devtools/sourceeditor/editor.js b/browser/devtools/sourceeditor/editor.js index 0f68d5231662..d7f4c4d3d20a 100644 --- a/browser/devtools/sourceeditor/editor.js +++ b/browser/devtools/sourceeditor/editor.js @@ -145,8 +145,10 @@ function Editor(config) { // Overwrite default config with user-provided, if needed. Object.keys(config).forEach((k) => { - if (k != "extraKeys") - return this.config[k] = config[k]; + if (k != "extraKeys") { + this.config[k] = config[k]; + return; + } if (!config.extraKeys) return; @@ -161,11 +163,15 @@ function Editor(config) { // indenting with tabs, insert one tab. Otherwise insert N // whitespaces where N == indentUnit option. this.config.extraKeys.Tab = (cm) => { - if (cm.somethingSelected()) - return void cm.indentSelection("add"); + if (cm.somethingSelected()) { + cm.indentSelection("add"); + return; + } - if (this.config.indentWithTabs) - return void cm.replaceSelection("\t", "end", "+input"); + if (this.config.indentWithTabs) { + cm.replaceSelection("\t", "end", "+input"); + return; + } var num = cm.getOption("indentUnit"); if (cm.getCursor().ch !== 0) num -= 1; @@ -250,8 +256,10 @@ Editor.prototype = { let tail = { line: line, ch: this.getText(line).length }; // Shift-click on a gutter selects the whole line. - if (ev.shiftKey) - return void cm.setSelection(head, tail); + if (ev.shiftKey) { + cm.setSelection(head, tail); + return; + } this.emit("gutterClick", line); }); @@ -325,12 +333,15 @@ Editor.prototype = { replaceText: function (value, from, to) { let cm = editors.get(this); - if (!from) - return void this.setText(value); + if (!from) { + this.setText(value); + return; + } if (!to) { let text = cm.getRange({ line: 0, ch: 0 }, from); - return void this.setText(text + value); + this.setText(text + value); + return; } cm.replaceRange(value, from, to); @@ -757,8 +768,10 @@ Editor.prototype = { let cm = editors.get(this); let ctx = { ed: this, cm: cm }; - if (name === "initialize") - return void funcs[name](ctx); + if (name === "initialize") { + funcs[name](ctx); + return; + } this[name] = funcs[name].bind(null, ctx); }); @@ -901,8 +914,10 @@ function controller(ed) { "cmd_findAgain": "findNext" }; - if (map[cmd]) - return void cm.execCommand(map[cmd]); + if (map[cmd]) { + cm.execCommand(map[cmd]); + return; + } if (cmd == "cmd_gotoLine") ed.jumpToLine(cm); diff --git a/toolkit/devtools/css-color.js b/toolkit/devtools/css-color.js index 71598528a927..4c52738c8f83 100644 --- a/toolkit/devtools/css-color.js +++ b/toolkit/devtools/css-color.js @@ -121,9 +121,7 @@ CssColor.prototype = { }, get specialValue() { - if (SPECIALVALUES.has(this.authored)) { - return this.authored; - } + return SPECIALVALUES.has(this.authored) ? this.authored : null; }, get name() {