--- a/devtools/client/animationinspector/animation-controller.js
+++ b/devtools/client/animationinspector/animation-controller.js
@@ -59,20 +59,20 @@ var shutdown = Task.async(function* () {
if (typeof AnimationsPanel !== "undefined") {
yield AnimationsPanel.destroy();
}
gToolbox = gInspector = null;
});
// This is what makes the sidebar widget able to load/unload the panel.
function setPanel(panel) {
- return startup(panel).catch(e => console.error(e));
+ return startup(panel).catch(console.error);
}
function destroy() {
- return shutdown().catch(e => console.error(e));
+ return shutdown().catch(console.error);
}
/**
* Get all the server-side capabilities (traits) so the UI knows whether or not
* features should be enabled/disabled.
* @param {Target} target The current toolbox target.
* @return {Object} An object with boolean properties.
*/
@@ -256,17 +256,17 @@ var AnimationsController = {
*/
toggleAll: function () {
if (!this.traits.hasToggleAll) {
return promise.resolve();
}
return this.animationsFront.toggleAll()
.then(() => this.emit(this.ALL_ANIMATIONS_TOGGLED_EVENT, this))
- .catch(e => console.error(e));
+ .catch(console.error);
},
/**
* Similar to toggleAll except that it only plays/pauses the currently known
* animations (those listed in this.animationPlayers).
* @param {Boolean} shouldPause True if the animations should be paused, false
* if they should be played.
* @return {Promise} Resolves when the playState has been changed.
--- a/devtools/client/animationinspector/animation-panel.js
+++ b/devtools/client/animationinspector/animation-panel.js
@@ -174,19 +174,19 @@ var AnimationsPanel = {
},
onKeyDown: function (event) {
// If the space key is pressed, it should toggle the play state of
// the animations displayed in the panel, or of all the animations on
// the page if the selected node does not have any animation on it.
if (event.keyCode === KeyCodes.DOM_VK_SPACE) {
if (AnimationsController.animationPlayers.length > 0) {
- this.playPauseTimeline().catch(ex => console.error(ex));
+ this.playPauseTimeline().catch(console.error);
} else {
- this.toggleAll().catch(ex => console.error(ex));
+ this.toggleAll().catch(console.error);
}
event.preventDefault();
}
},
togglePlayers: function (isVisible) {
if (isVisible) {
document.body.removeAttribute("empty");
@@ -203,30 +203,30 @@ var AnimationsPanel = {
this.pickerButtonEl.classList.add("checked");
},
onPickerStopped: function () {
this.pickerButtonEl.classList.remove("checked");
},
onToggleAllClicked: function () {
- this.toggleAll().catch(ex => console.error(ex));
+ this.toggleAll().catch(console.error);
},
/**
* Toggle (pause/play) all animations in the current target
* and update the UI the toggleAll button.
*/
toggleAll: Task.async(function* () {
this.toggleAllButtonEl.classList.toggle("paused");
yield AnimationsController.toggleAll();
}),
onTimelinePlayClicked: function () {
- this.playPauseTimeline().catch(ex => console.error(ex));
+ this.playPauseTimeline().catch(console.error);
},
/**
* Depending on the state of the timeline either pause or play the animations
* displayed in it.
* If the animations are finished, this will play them from the start again.
* If the animations are playing, this will pause them.
* If the animations are paused, this will resume them.
@@ -236,17 +236,17 @@ var AnimationsPanel = {
*/
playPauseTimeline: function () {
return AnimationsController
.toggleCurrentAnimations(this.timelineData.isMoving)
.then(() => this.refreshAnimationsStateAndUI());
},
onTimelineRewindClicked: function () {
- this.rewindTimeline().catch(ex => console.error(ex));
+ this.rewindTimeline().catch(console.error);
},
/**
* Reset the startTime of all current animations shown in the timeline and
* pause them.
*
* @return {Promise} Resolves when currentTime is set and the UI is refreshed
*/
@@ -258,17 +258,17 @@ var AnimationsPanel = {
/**
* Set the playback rate of all current animations shown in the timeline to
* the value of this.rateSelectorEl.
*/
onRateChanged: function (e, rate) {
AnimationsController.setPlaybackRateAll(rate)
.then(() => this.refreshAnimationsStateAndUI())
- .catch(ex => console.error(ex));
+ .catch(console.error);
},
onTabNavigated: function () {
this.toggleAllButtonEl.classList.remove("paused");
},
onTimelineDataChanged: function (e, data) {
this.timelineData = data;
@@ -284,17 +284,17 @@ var AnimationsPanel = {
// If the timeline data changed as a result of the user dragging the
// scrubber, then pause all animations and set their currentTimes.
// (Note that we want server-side requests to be sequenced, so we only do
// this after the previous currentTime setting was done).
if (isUserDrag && !this.setCurrentTimeAllPromise) {
this.setCurrentTimeAllPromise =
AnimationsController.setCurrentTimeAll(time, true)
- .catch(error => console.error(error))
+ .catch(console.error)
.then(() => {
this.setCurrentTimeAllPromise = null;
});
}
this.displayTimelineCurrentTime();
},
--- a/devtools/client/canvasdebugger/callslist.js
+++ b/devtools/client/canvasdebugger/callslist.js
@@ -283,17 +283,17 @@ var CallsListView = Heritage.extend(Widg
setConditionalTimeout("screenshot-display", SCREENSHOT_DISPLAY_DELAY, () => {
return !this._isSliding;
}, () => {
let frameSnapshot = SnapshotsListView.selectedItem.attachment.actor;
let functionCall = callItem.attachment.actor;
frameSnapshot.generateScreenshotFor(functionCall).then(screenshot => {
this.showScreenshot(screenshot);
this.highlightedThumbnail = screenshot.index;
- }).catch(e => console.error(e));
+ }).catch(console.error);
});
},
/**
* The mousedown listener for the call selection slider.
*/
_onSlideMouseDown: function () {
this._isSliding = true;
--- a/devtools/client/inspector/boxmodel/box-model.js
+++ b/devtools/client/inspector/boxmodel/box-model.js
@@ -297,37 +297,37 @@ BoxModel.prototype = {
properties.push({ name: bprop, value: "solid" });
}
}
if (property.substring(0, 9) == "position-") {
properties[0].name = property.substring(9);
}
- session.setProperties(properties).catch(e => console.error(e));
+ session.setProperties(properties).catch(console.error);
},
done: (value, commit) => {
editor.elt.parentNode.classList.remove("boxmodel-editing");
if (!commit) {
session.revert().then(() => {
session.destroy();
- }, e => console.error(e));
+ }, console.error);
return;
}
if (!this.inspector) {
return;
}
let node = this.inspector.selection.nodeFront;
this.inspector.pageStyle.getLayout(node, {
autoMargins: true,
}).then(layout => {
this.store.dispatch(updateLayout(layout));
- }, e => console.error(e));
+ }, console.error);
},
cssProperties: getCssProperties(this.inspector.toolbox)
}, event);
},
/**
* Shows the box-model highlighter on the currently selected element.
*
--- a/devtools/client/inspector/computed/computed.js
+++ b/devtools/client/inspector/computed/computed.js
@@ -504,17 +504,17 @@ CssComputedView.prototype = {
this.inspector.emit("computed-view-refreshed");
resolve(undefined);
}
}
);
this._refreshProcess.schedule();
});
- }).catch((err) => console.error(err));
+ }).catch(console.error);
},
/**
* Handle the shortcut events in the computed view.
*/
_onShortcut: function (name, event) {
if (!event.target.closest("#sidebar-panel-computedview")) {
return;
--- a/devtools/client/inspector/inspector-commands.js
+++ b/devtools/client/inspector/inspector-commands.js
@@ -53,33 +53,33 @@ exports.items = [{
}, {
name: "hide",
type: "boolean",
hidden: true
}]
}],
exec: function* (args, context) {
if (args.hide) {
- context.updateExec("eyedropper_server_hide").catch(e => console.error(e));
+ context.updateExec("eyedropper_server_hide").catch(console.error);
return;
}
// If the inspector is already picking a color from the page, cancel it.
let target = context.environment.target;
let toolbox = gDevTools.getToolbox(target);
if (toolbox) {
let inspector = toolbox.getPanel("inspector");
if (inspector) {
yield inspector.hideEyeDropper();
}
}
let telemetry = new Telemetry();
telemetry.toolOpened(args.frommenu ? "menueyedropper" : "eyedropper");
- context.updateExec("eyedropper_server").catch(e => console.error(e));
+ context.updateExec("eyedropper_server").catch(console.error);
}
}, {
item: "command",
runAt: "server",
name: "eyedropper_server",
hidden: true,
exec: function (args, {environment}) {
let eyeDropper = windowEyeDroppers.get(environment.window);
--- a/devtools/client/inspector/inspector-search.js
+++ b/devtools/client/inspector/inspector-search.js
@@ -67,17 +67,17 @@ InspectorSearch.prototype = {
this.searchClearButton.removeEventListener("click", this._onClearSearch);
this.searchBox = null;
this.searchClearButton = null;
this.autocompleter.destroy();
},
_onSearch: function (reverse = false) {
this.doFullTextSearch(this.searchBox.value, reverse)
- .catch(e => console.error(e));
+ .catch(console.error);
},
doFullTextSearch: Task.async(function* (query, reverse) {
let lastSearched = this._lastSearched;
this._lastSearched = query;
if (query.length === 0) {
this.searchBox.classList.remove("devtools-style-searchbox-no-match");
--- a/devtools/client/inspector/inspector.js
+++ b/devtools/client/inspector/inspector.js
@@ -219,23 +219,23 @@ Inspector.prototype = {
this._supportsResolveRelativeURL = false;
// Use getActorDescription first so that all actorHasMethod calls use
// a cached response from the server.
return this._target.getActorDescription("domwalker").then(desc => {
return promise.all([
this._target.actorHasMethod("domwalker", "duplicateNode").then(value => {
this._supportsDuplicateNode = value;
- }).catch(e => console.error(e)),
+ }).catch(console.error),
this._target.actorHasMethod("domnode", "scrollIntoView").then(value => {
this._supportsScrollIntoView = value;
- }).catch(e => console.error(e)),
+ }).catch(console.error),
this._target.actorHasMethod("inspector", "resolveRelativeURL").then(value => {
this._supportsResolveRelativeURL = value;
- }).catch(e => console.error(e)),
+ }).catch(console.error),
]);
});
},
_deferredOpen: function (defaultSelection) {
this.breadcrumbs = new HTMLBreadcrumbs(this);
this.walker.on("new-root", this.onNewRoot);
@@ -1622,34 +1622,34 @@ Inspector.prototype = {
if (!this.eyeDropperButton) {
return null;
}
this.telemetry.toolOpened("toolbareyedropper");
this.eyeDropperButton.classList.add("checked");
this.startEyeDropperListeners();
return this.inspector.pickColorFromPage(this.toolbox, {copyOnSelect: true})
- .catch(e => console.error(e));
+ .catch(console.error);
},
/**
* Hide the eyedropper.
* @return {Promise} resolves when the eyedropper is hidden.
*/
hideEyeDropper: function () {
// The eyedropper button doesn't exist, most probably because the actor doesn't
// support the pickColorFromPage, or because the page isn't HTML.
if (!this.eyeDropperButton) {
return null;
}
this.eyeDropperButton.classList.remove("checked");
this.stopEyeDropperListeners();
return this.inspector.cancelPickColorFromPage()
- .catch(e => console.error(e));
+ .catch(console.error);
},
/**
* Create a new node as the last child of the current selection, expand the
* parent and select the new node.
*/
addNode: Task.async(function* () {
if (!this.canAddHTMLChild()) {
@@ -1834,74 +1834,74 @@ Inspector.prototype = {
* @param {Promise} longStringActorPromise
* promise expected to resolve a LongStringActor instance
* @return {Promise} promise resolving (with no argument) when the
* string is sent to the clipboard
*/
_copyLongString: function (longStringActorPromise) {
return this._getLongString(longStringActorPromise).then(string => {
clipboardHelper.copyString(string);
- }).catch(e => console.error(e));
+ }).catch(console.error);
},
/**
* Retrieve the content of a longString (via a promise resolving a LongStringActor)
* @param {Promise} longStringActorPromise
* promise expected to resolve a LongStringActor instance
* @return {Promise} promise resolving with the retrieved string as argument
*/
_getLongString: function (longStringActorPromise) {
return longStringActorPromise.then(longStringActor => {
return longStringActor.string().then(string => {
- longStringActor.release().catch(e => console.error(e));
+ longStringActor.release().catch(console.error);
return string;
});
- }).catch(e => console.error(e));
+ }).catch(console.error);
},
/**
* Copy a unique selector of the selected Node to the clipboard.
*/
copyUniqueSelector: function () {
if (!this.selection.isNode()) {
return;
}
this.telemetry.toolOpened("copyuniquecssselector");
this.selection.nodeFront.getUniqueSelector().then(selector => {
clipboardHelper.copyString(selector);
- }).catch(e => console.error);
+ }).catch(console.error);
},
/**
* Copy the full CSS Path of the selected Node to the clipboard.
*/
copyCssPath: function () {
if (!this.selection.isNode()) {
return;
}
this.telemetry.toolOpened("copyfullcssselector");
this.selection.nodeFront.getCssPath().then(path => {
clipboardHelper.copyString(path);
- }).catch(e => console.error);
+ }).catch(console.error);
},
/**
* Copy the XPath of the selected Node to the clipboard.
*/
copyXPath: function () {
if (!this.selection.isNode()) {
return;
}
this.telemetry.toolOpened("copyxpath");
this.selection.nodeFront.getXPath().then(path => {
clipboardHelper.copyString(path);
- }).catch(e => console.error);
+ }).catch(console.error);
},
/**
* Initiate gcli screenshot command on selected node.
*/
screenshotNode: Task.async(function* () {
const command = Services.prefs.getBoolPref("devtools.screenshot.clipboard.enabled") ?
"screenshot --file --clipboard --selector" :
@@ -1937,17 +1937,17 @@ Inspector.prototype = {
duplicateNode: function () {
let selection = this.selection;
if (!selection.isElementNode() ||
selection.isRoot() ||
selection.isAnonymousNode() ||
selection.isPseudoElementNode()) {
return;
}
- this.walker.duplicateNode(selection.nodeFront).catch(e => console.error(e));
+ this.walker.duplicateNode(selection.nodeFront).catch(console.error);
},
/**
* Delete the selected node.
*/
deleteNode: function () {
if (!this.selection.isNode() ||
this.selection.isRoot()) {
@@ -2038,28 +2038,28 @@ Inspector.prototype = {
let browserWin = this.target.tab.ownerDocument.defaultView;
browserWin.openUILinkIn(url, "tab");
} else if (type === "cssresource") {
return this.toolbox.viewSourceInStyleEditor(url);
} else if (type === "jsresource") {
return this.toolbox.viewSourceInDebugger(url);
}
return null;
- }).catch(e => console.error(e));
+ }).catch(console.error);
} else if (type == "idref") {
// Select the node in the same document.
this.walker.document(this.selection.nodeFront).then(doc => {
return this.walker.querySelector(doc, "#" + CSS.escape(link)).then(node => {
if (!node) {
this.emit("idref-attribute-link-failed");
return;
}
this.selection.setNodeFront(node);
});
- }).catch(e => console.error(e));
+ }).catch(console.error);
}
},
/**
* This method is here for the benefit of the node-menu-link-copy menu item
* in the inspector contextual-menu.
*/
onCopyLink: function () {
--- a/devtools/client/inspector/markup/markup.js
+++ b/devtools/client/inspector/markup/markup.js
@@ -179,17 +179,17 @@ MarkupView.prototype = {
_disableImagePreviewTooltip: function () {
this.imagePreviewTooltip.stopTogglingOnHover();
},
_onToolboxPickerHover: function (event, nodeFront) {
this.showNode(nodeFront).then(() => {
this._showContainerAsHovered(nodeFront);
- }, e => console.error(e));
+ }, console.error);
},
/**
* If the element picker gets canceled, make sure and re-center the view on the
* current selected element.
*/
_onToolboxPickerCanceled: function () {
if (this._selectedContainer) {
--- a/devtools/client/inspector/rules/rules.js
+++ b/devtools/client/inspector/rules/rules.js
@@ -892,17 +892,17 @@ CssRuleView.prototype = {
this._clearRules();
let onEditorsReady = this._createEditors();
this.refreshPseudoClassPanel();
// Notify anyone that cares that we refreshed.
return onEditorsReady.then(() => {
this.emit("ruleview-refreshed");
- }, e => console.error(e));
+ }, console.error);
}).catch(promiseWarn);
},
/**
* Show the user that the rule view has no node selected.
*/
_showEmpty: function () {
if (this.styleDocument.getElementById("ruleview-no-results")) {
--- a/devtools/client/inspector/rules/views/rule-editor.js
+++ b/devtools/client/inspector/rules/views/rule-editor.js
@@ -270,17 +270,17 @@ RuleEditor.prototype = {
let showOrig = Services.prefs.getBoolPref(PREF_ORIG_SOURCES);
if (showOrig && !this.rule.isSystem &&
this.rule.domRule.type !== ELEMENT_STYLE) {
// Only get the original source link if the right pref is set, if the rule
// isn't a system rule and if it isn't an inline rule.
this.rule.getOriginalSourceStrings().then((strings) => {
sourceLabel.textContent = strings.short;
sourceLabel.setAttribute("title", strings.full);
- }, e => console.error(e)).then(() => {
+ }, console.error).then(() => {
this.emit("source-link-updated");
});
} else {
// If we're not getting the original source link, then we can emit the
// event immediately (but still asynchronously to give consumers a chance
// to register it after having instantiated the RuleEditor).
promise.resolve().then(() => {
this.emit("source-link-updated");
--- a/devtools/client/inspector/shared/dom-node-preview.js
+++ b/devtools/client/inspector/shared/dom-node-preview.js
@@ -191,17 +191,17 @@ DomNodePreview.prototype = {
this.inspector.off("markupmutation", this.onMarkupMutations);
this.previewEl.removeEventListener("mouseover", this.onPreviewMouseOver);
this.previewEl.removeEventListener("mouseout", this.onPreviewMouseOut);
this.previewEl.removeEventListener("click", this.onSelectElClick);
this.highlightNodeEl.removeEventListener("click", this.onHighlightElClick);
},
destroy: function () {
- HighlighterLock.unhighlight().catch(e => console.error(e));
+ HighlighterLock.unhighlight().catch(console.error);
this.stopListeners();
this.el.remove();
this.el = this.tagNameEl = this.idEl = this.classEl = this.pseudoEl = null;
this.highlightNodeEl = this.previewEl = null;
this.nodeFront = this.inspector = null;
},
@@ -213,25 +213,25 @@ DomNodePreview.prototype = {
return null;
},
onPreviewMouseOver: function () {
if (!this.nodeFront || !this.highlighterUtils) {
return;
}
this.highlighterUtils.highlightNodeFront(this.nodeFront)
- .catch(e => console.error(e));
+ .catch(console.error);
},
onPreviewMouseOut: function () {
if (!this.nodeFront || !this.highlighterUtils) {
return;
}
this.highlighterUtils.unhighlight()
- .catch(e => console.error(e));
+ .catch(console.error);
},
onSelectElClick: function () {
if (!this.nodeFront) {
return;
}
this.inspector.selection.setNodeFront(this.nodeFront, "dom-node-preview");
},
@@ -241,22 +241,22 @@ DomNodePreview.prototype = {
let classList = this.highlightNodeEl.classList;
let isHighlighted = classList.contains("selected");
if (isHighlighted) {
classList.remove("selected");
HighlighterLock.unhighlight().then(() => {
this.emit("target-highlighter-unlocked");
- }, error => console.error(error));
+ }, console.error);
} else {
classList.add("selected");
HighlighterLock.highlight(this).then(() => {
this.emit("target-highlighter-locked");
- }, error => console.error(error));
+ }, console.error);
}
},
onHighlighterLocked: function (e, domNodePreview) {
if (domNodePreview !== this) {
this.highlightNodeEl.classList.remove("selected");
}
},
--- a/devtools/client/inspector/shared/highlighters-overlay.js
+++ b/devtools/client/inspector/shared/highlighters-overlay.js
@@ -530,17 +530,17 @@ HighlightersOverlay.prototype = {
}
// For some reason, the call to highlighter.hide doesn't always return a
// promise. This causes some tests to fail when trying to install a
// rejection handler on the result of the call. To avoid this, check
// whether the result is truthy before installing the handler.
let onHidden = this.highlighters[this.hoveredHighlighterShown].hide();
if (onHidden) {
- onHidden.catch(e => console.error(e));
+ onHidden.catch(console.error);
}
this.hoveredHighlighterShown = null;
this.emit("highlighter-hidden");
},
/**
* Is the current hovered node a css transform property value in the
--- a/devtools/client/responsive.html/manager.js
+++ b/devtools/client/responsive.html/manager.js
@@ -184,17 +184,17 @@ const ResponsiveUIManager = exports.Resp
case "resize off":
completed = this.closeIfNeeded(window, tab, { command: true });
break;
case "resize toggle":
completed = this.toggle(window, tab, { command: true });
break;
default:
}
- completed.catch(e => console.error(e));
+ completed.catch(console.error);
},
handleMenuCheck({target}) {
ResponsiveUIManager.setMenuCheckFor(target);
},
initMenuCheckListenerFor(window) {
let { tabContainer } = window.gBrowser;
--- a/devtools/client/scratchpad/scratchpad.js
+++ b/devtools/client/scratchpad/scratchpad.js
@@ -1731,17 +1731,17 @@ var Scratchpad = {
if (state)
this.dirty = !state.saved;
this.initialized = true;
this._triggerObservers("Ready");
this.populateRecentFilesMenu();
PreferenceObserver.init();
CloseObserver.init();
- }).catch((err) => console.error(err));
+ }).catch(console.error);
this._setupCommandListeners();
this._updateViewMenuItems();
this._setupPopupShowingListeners();
// Change the accesskey for the help menu as it can be specific on Windows
// some localizations of Windows (ex:french, german) use "?"
// for the help button in the menubar but Gnome does not.
if (Services.appinfo.OS == "WINNT") {
--- a/devtools/client/shadereditor/shadereditor.js
+++ b/devtools/client/shadereditor/shadereditor.js
@@ -309,17 +309,17 @@ var ShadersListView = Heritage.extend(Wi
vs: vertexShaderText,
fs: fragmentShaderText
});
}
getShaders()
.then(getSources)
.then(showSources)
- .catch(e => console.error(e));
+ .catch(console.error);
},
/**
* The check listener for the programs container.
*/
_onProgramCheck: function ({ detail: { checked }, target }) {
let sourceItem = this.getItemForElement(target);
let attachment = sourceItem.attachment;
--- a/devtools/client/shared/widgets/FilterWidget.js
+++ b/devtools/client/shared/widgets/FilterWidget.js
@@ -570,25 +570,25 @@ CSSFilterEditorWidget.prototype = {
let id = +preset.dataset.id;
this.getPresets().then(presets => {
if (el.classList.contains("remove-button")) {
// If the click happened on the remove button.
presets.splice(id, 1);
this.setPresets(presets).then(this.renderPresets,
- ex => console.error(ex));
+ console.error);
} else {
// Or if the click happened on a preset.
let p = presets[id];
this.setCssValue(p.value);
this.addPresetInput.value = p.name;
}
- }, ex => console.error(ex));
+ }, console.error);
},
_togglePresets: function () {
this.el.classList.toggle("show-presets");
this.emit("render");
},
_savePreset: function (e) {
@@ -607,18 +607,18 @@ CSSFilterEditorWidget.prototype = {
if (index > -1) {
presets[index].value = value;
} else {
presets.push({name, value});
}
this.setPresets(presets).then(this.renderPresets,
- ex => console.error(ex));
- }, ex => console.error(ex));
+ console.error);
+ }, console.error);
},
/**
* Workaround needed to reset the focus when using a HTML select inside a XUL panel.
* See Bug 1294366.
*/
_resetFocus: function () {
this.filterSelect.ownerDocument.defaultView.focus();
@@ -947,22 +947,22 @@ CSSFilterEditorWidget.prototype = {
getPresets: function () {
return asyncStorage.getItem("cssFilterPresets").then(presets => {
if (!presets) {
return [];
}
return presets;
- }, e => console.error(e));
+ }, console.error);
},
setPresets: function (presets) {
return asyncStorage.setItem("cssFilterPresets", presets)
- .catch(e => console.error(e));
+ .catch(console.error);
}
};
// Fixes JavaScript's float precision
function fixFloat(a, number) {
let fixed = parseFloat(a).toFixed(1);
return number ? parseFloat(fixed) : fixed;
}
--- a/devtools/client/shared/widgets/tooltip/SwatchColorPickerTooltip.js
+++ b/devtools/client/shared/widgets/tooltip/SwatchColorPickerTooltip.js
@@ -166,17 +166,17 @@ SwatchColorPickerTooltip.prototype = ext
telemetry.toolOpened("pickereyedropper");
inspector.pickColorFromPage(toolbox, {copyOnSelect: false}).then(() => {
this.eyedropperOpen = true;
// close the colorpicker tooltip so that only the eyedropper is open.
this.hide();
this.tooltip.emit("eyedropper-opened");
- }, e => console.error(e));
+ }, console.error);
inspector.once("color-picked", color => {
toolbox.win.focus();
this._selectColor(color);
this._onEyeDropperDone();
});
inspector.once("color-pick-canceled", () => {
--- a/devtools/client/sourceeditor/autocomplete.js
+++ b/devtools/client/sourceeditor/autocomplete.js
@@ -232,17 +232,17 @@ function autoComplete({ ed, cm }) {
popup.setItems(suggestions);
popup.once("popup-opened", () => {
// This event is used in tests.
ed.emit("after-suggest");
});
popup.openPopup(cursorElement, -1 * left, 0);
autocompleteOpts.suggestionInsertedOnce = false;
- }).catch(e => console.error(e));
+ }).catch(console.error);
}
/**
* Inserts a popup item into the current cursor location
* in the editor.
*/
function insertPopupItem(ed, popupItem) {
let {preLabel, text} = popupItem;
--- a/devtools/client/styleeditor/StyleEditorUI.jsm
+++ b/devtools/client/styleeditor/StyleEditorUI.jsm
@@ -229,17 +229,17 @@ StyleEditorUI.prototype = {
* @param {string} event
* Event name
* @param {StyleSheet} styleSheet
* StyleSheet object for new sheet
*/
_onNewDocument: function () {
this._debuggee.getStyleSheets().then((styleSheets) => {
return this._resetStyleSheetList(styleSheets);
- }).catch(e => console.error(e));
+ }).catch(console.error);
},
/**
* Add editors for all the given stylesheets to the UI.
*
* @param {array} styleSheets
* Array of StyleSheetFront
*/
@@ -629,17 +629,17 @@ StyleEditorUI.prototype = {
let lineCount = editorText.split("\n").length;
let ruleCount = showEditor.styleSheet.ruleCount;
if (lineCount >= ruleCount) {
showEditor.addUnusedRegions(reports);
} else {
this.emit("error", { key: "error-compressed", level: "info" });
}
}
- }.bind(this)).catch(e => console.error(e));
+ }.bind(this)).catch(console.error);
}
});
},
/**
* Switch to the editor that has been marked to be selected.
*
* @return {Promise}
@@ -914,17 +914,17 @@ StyleEditorUI.prototype = {
div.appendChild(link);
list.appendChild(div);
}
sidebar.hidden = !showSidebar || !inSource;
this.emit("media-list-changed", editor);
- }.bind(this)).catch(e => console.error(e));
+ }.bind(this)).catch(console.error);
},
/**
* Used to safely inject media query links
*
* @param {HTMLElement} element
* The element corresponding to the media sidebar condition
* @param {String} rawText
--- a/devtools/client/styleeditor/StyleSheetEditor.jsm
+++ b/devtools/client/styleeditor/StyleSheetEditor.jsm
@@ -122,17 +122,17 @@ function StyleSheetEditor(styleSheet, wi
this._onMouseMove = this._onMouseMove.bind(this);
this._focusOnSourceEditorReady = false;
this.cssSheet.on("property-change", this._onPropertyChange);
this.styleSheet.on("error", this._onError);
this.mediaRules = [];
if (this.cssSheet.getMediaRules) {
this.cssSheet.getMediaRules().then(this._onMediaRulesChanged,
- e => console.error(e));
+ console.error);
}
this.cssSheet.on("media-rules-changed", this._onMediaRulesChanged);
this.cssSheet.on("style-applied", this._onStyleApplied);
this.savedFile = file;
this.linkCSSFile();
}
this.StyleSheetEditor = StyleSheetEditor;
@@ -513,17 +513,17 @@ StyleSheetEditor.prototype = {
}
this.focus();
},
/**
* Toggled the disabled state of the underlying stylesheet.
*/
toggleDisabled: function () {
- this.styleSheet.toggleDisabled().catch(e => console.error(e));
+ this.styleSheet.toggleDisabled().catch(console.error);
},
/**
* Queue a throttled task to update the live style sheet.
*/
updateStyleSheet: function () {
if (this._updateTask) {
// cancel previous queued task not executed within throttle delay
@@ -555,17 +555,17 @@ StyleSheetEditor.prototype = {
this._updateTask = null;
if (this.sourceEditor) {
this._state.text = this.sourceEditor.getText();
}
this._isUpdating = true;
this.styleSheet.update(this._state.text, this.transitionsEnabled)
- .catch(e => console.error(e));
+ .catch(console.error);
},
/**
* Handle mousemove events, calling _highlightSelectorAt after a delay only
* and reseting the delay everytime.
*/
_onMouseMove: function (e) {
this.highlighter.hide();
--- a/devtools/client/webconsole/console-output.js
+++ b/devtools/client/webconsole/console-output.js
@@ -3067,17 +3067,17 @@ Widgets.ObjectRenderers.add({
}
this._text(">");
// Register this widget in the owner message so that it gets destroyed when
// the message is destroyed.
this.message.widgets.add(this);
- this.linkToInspector().catch(e => console.error(e));
+ this.linkToInspector().catch(console.error);
},
/**
* If the DOMNode being rendered can be highlit in the page, this function
* will attach mouseover/out event listeners to do so, and the inspector icon
* to open the node in the inspector.
* @return a promise that resolves when the node has been linked to the
* inspector, or rejects if it wasn't (either if no toolbox could be found to
@@ -3155,17 +3155,17 @@ Widgets.ObjectRenderers.add({
/**
* Unhighlight a previously highlit node
* @see highlightDomNode
* @return a promise that resolves when the highlighter has been hidden
*/
unhighlightDomNode: function () {
return this.linkToInspector().then(() => {
return this.toolbox.highlighterUtils.unhighlight();
- }).catch(e => console.error(e));
+ }).catch(console.error);
},
/**
* Open the DOMNode corresponding to the ObjectActor in the inspector panel
* @return a promise that resolves when the inspector has been switched to
* and the node has been selected, or rejects if the node cannot be selected
* (detached from the DOM). Note that in any case, the inspector panel will
* be switched to.
--- a/devtools/client/webconsole/test/browser_webconsole_block_mixedcontent_securityerrors.js
+++ b/devtools/client/webconsole/test/browser_webconsole_block_mixedcontent_securityerrors.js
@@ -92,17 +92,17 @@ function mixedContentOverrideTest2(hud,
text: "Loading mixed (insecure) display content" +
" \u201chttp://example.com/tests/image/test/mochitest/blue.png\u201d" +
" on a secure page",
category: CATEGORY_SECURITY,
severity: SEVERITY_WARNING,
objects: true,
},
],
- }).then(msgs => deferred.resolve(msgs), e => console.error(e));
+ }).then(msgs => deferred.resolve(msgs), console.error);
return deferred.promise;
}
function testClickOpenNewTab(hud, match) {
let warningNode = match.clickableElements[0];
ok(warningNode, "link element");
ok(warningNode.classList.contains("learn-more-link"), "link class name");
--- a/devtools/client/webide/content/runtimedetails.js
+++ b/devtools/client/webide/content/runtimedetails.js
@@ -97,17 +97,17 @@ function CheckLockState() {
device.isRoot().then(isRoot => {
if (isRoot) {
adbCheckResult.textContent = sYes;
flipCertPerfButton.removeAttribute("disabled");
} else {
adbCheckResult.textContent = sNo;
adbRootAction.removeAttribute("hidden");
}
- }, e => console.error(e));
+ }, console.error);
} else {
adbCheckResult.textContent = sUnknown;
}
} else {
adbCheckResult.textContent = sNotUSB;
}
// forbid-certified-apps check
@@ -115,17 +115,17 @@ function CheckLockState() {
let prefFront = AppManager.preferenceFront;
prefFront.getBoolPref("devtools.debugger.forbid-certified-apps").then(isForbidden => {
if (isForbidden) {
devtoolsCheckResult.textContent = sNo;
flipCertPerfAction.removeAttribute("hidden");
} else {
devtoolsCheckResult.textContent = sYes;
}
- }, e => console.error(e));
+ }, console.error);
} catch (e) {
// Exception. pref actor is only accessible if forbird-certified-apps is false
devtoolsCheckResult.textContent = sNo;
flipCertPerfAction.removeAttribute("hidden");
}
}
@@ -142,10 +142,10 @@ function EnableCertApps() {
"echo 'user_pref(\"network.disable.ipc.security\", true);' >> prefs.js && " +
"echo 'user_pref(\"dom.webcomponents.enabled\", true);' >> prefs.js && " +
"start b2g"
);
}
function RootADB() {
let device = AppManager.selectedRuntime.device;
- device.summonRoot().then(CheckLockState, (e) => console.error(e));
+ device.summonRoot().then(CheckLockState, console.error);
}
--- a/devtools/docs/backend/backward-compatibility.md
+++ b/devtools/docs/backend/backward-compatibility.md
@@ -38,17 +38,17 @@ let hasProfilerActor = toolbox.target.ha
The `hasActor` method returns a boolean synchronously.
2. Detecting if an actor has a given method: same thing here, you need access to the toolbox:
```js
toolbox.target.actorHasMethod("domwalker", "duplicateNode").then(hasMethod => {
-}).catch(e => console.error(e));
+}).catch(console.error);
```
The `actorHasMethod` returns a promise that resolves to a boolean.
## Removing old backward compatibility code
We used to support old Firefox OS servers (back to Gecko 28), we don't anymore. Does this mean we can remove compatibility traits for it?
--- a/devtools/server/actors/highlighters/eye-dropper.js
+++ b/devtools/server/actors/highlighters/eye-dropper.js
@@ -378,17 +378,17 @@ EyeDropper.prototype = {
*/
selectColor() {
let onColorSelected = Promise.resolve();
if (this.options.copyOnSelect) {
onColorSelected = this.copyColor();
}
this.emit("selected", toColorString(this.centerColor, this.format));
- onColorSelected.then(() => this.hide(), e => console.error(e));
+ onColorSelected.then(() => this.hide(), console.error);
},
/**
* Handler for the keydown event. Either select the color or move the panel in a
* direction depending on the key pressed.
*/
handleKeyDown(e) {
// Bail out early if any unsupported modifier is used, so that we let
--- a/devtools/shared/protocol.js
+++ b/devtools/shared/protocol.js
@@ -1246,17 +1246,17 @@ Front.prototype = extend(Pool.prototype,
*/
send: function (packet) {
if (packet.to) {
this.conn._transport.send(packet);
} else {
this.actor().then(actorID => {
packet.to = actorID;
this.conn._transport.send(packet);
- }).catch(e => console.error(e));
+ }).catch(console.error);
}
},
/**
* Send a two-way request on the connection.
*/
request: function (packet) {
let deferred = defer();