--- a/devtools/client/aboutdebugging/components/workers/Panel.js
+++ b/devtools/client/aboutdebugging/components/workers/Panel.js
@@ -128,17 +128,18 @@ class WorkersPanel extends Component {
}
renderServiceWorkersError() {
const isWindowPrivate = PrivateBrowsingUtils.isContentWindowPrivate(window);
const isPrivateBrowsingMode = PrivateBrowsingUtils.permanentPrivateBrowsing;
const isServiceWorkerDisabled = !Services.prefs
.getBoolPref("dom.serviceWorkers.enabled");
- const isDisabled = isWindowPrivate || isPrivateBrowsingMode || isServiceWorkerDisabled;
+ const isDisabled =
+ isWindowPrivate || isPrivateBrowsingMode || isServiceWorkerDisabled;
if (!isDisabled) {
return "";
}
return dom.p(
{
className: "service-worker-disabled"
},
dom.div({ className: "warning" }),
--- a/devtools/client/aboutdebugging/test/browser_addons_debug_info.js
+++ b/devtools/client/aboutdebugging/test/browser_addons_debug_info.js
@@ -67,17 +67,18 @@ add_task(async function testTemporaryWeb
await waitForInitialAddonList(document);
await installAddon({
document,
path: "addons/test-devtools-webextension-noid/manifest.json",
name: addonName,
isWebExtension: true
});
- const addons = document.querySelectorAll("#temporary-extensions .addon-target-container");
+ const addons =
+ document.querySelectorAll("#temporary-extensions .addon-target-container");
// Assuming that our temporary add-on is now at the top.
const container = addons[addons.length - 1];
const addonId = container.dataset.addonId;
const extensionID = container.querySelector(".extension-id span");
ok(extensionID.textContent.endsWith("@temporary-addon"));
const temporaryID = container.querySelector(".temporary-id-url");
--- a/devtools/client/application/initializer.js
+++ b/devtools/client/application/initializer.js
@@ -61,17 +61,18 @@ window.Application = {
},
/**
* Retrieve message contexts for the current locales, and return them as an array of
* MessageContext elements.
*/
async createMessageContexts() {
const locales = Services.locale.getAppLocalesAsBCP47();
- const generator = L10nRegistry.generateContexts(locales, ["devtools/application.ftl"]);
+ const generator =
+ L10nRegistry.generateContexts(locales, ["devtools/application.ftl"]);
// Return value of generateContexts is a generator and should be converted to
// a sync iterable before using it with React.
const contexts = [];
for await (const message of generator) {
contexts.push(message);
}
--- a/devtools/client/inspector/boxmodel/test/browser_boxmodel_editablemodel_allproperties.js
+++ b/devtools/client/inspector/boxmodel/test/browser_boxmodel_editablemodel_allproperties.js
@@ -27,17 +27,18 @@ add_task(async function() {
async function testEditing(inspector, boxmodel, testActor) {
info("When all properties are set on the node editing one should work");
await setStyle(testActor, "#div1", "padding", "5px");
await waitForUpdate(inspector);
await selectNode("#div1", inspector);
- const span = boxmodel.document.querySelector(".boxmodel-padding.boxmodel-bottom > span");
+ const span =
+ boxmodel.document.querySelector(".boxmodel-padding.boxmodel-bottom > span");
is(span.textContent, 5, "Should have the right value in the box model.");
EventUtils.synthesizeMouseAtCenter(span, {}, boxmodel.document.defaultView);
const editor = boxmodel.document.querySelector(".styleinspector-propertyeditor");
ok(editor, "Should have opened the editor.");
is(editor.value, "5px", "Should have the right value in the editor.");
EventUtils.synthesizeKey("7", {}, boxmodel.document.defaultView);
--- a/devtools/client/inspector/boxmodel/test/browser_boxmodel_sync.js
+++ b/devtools/client/inspector/boxmodel/test/browser_boxmodel_sync.js
@@ -12,17 +12,18 @@ add_task(async function() {
await addTab("data:text/html," + encodeURIComponent(TEST_URI));
const {inspector, boxmodel} = await openLayoutView();
info("When a property is edited, it should sync in the rule view");
await selectNode("p", inspector);
info("Modify padding-bottom in box model view");
- const span = boxmodel.document.querySelector(".boxmodel-padding.boxmodel-bottom > span");
+ const span =
+ boxmodel.document.querySelector(".boxmodel-padding.boxmodel-bottom > span");
EventUtils.synthesizeMouseAtCenter(span, {}, boxmodel.document.defaultView);
const editor = boxmodel.document.querySelector(".styleinspector-propertyeditor");
const onRuleViewRefreshed = once(inspector, "rule-view-refreshed");
EventUtils.synthesizeKey("7", {}, boxmodel.document.defaultView);
await waitForUpdate(inspector);
await onRuleViewRefreshed;
is(editor.value, "7", "Should have the right value in the editor.");
--- a/devtools/client/inspector/fonts/fonts.js
+++ b/devtools/client/inspector/fonts/fonts.js
@@ -173,17 +173,18 @@ class FontInspector {
}
async getFontsForNode(node, options) {
// In case we've been destroyed in the meantime
if (!this.document) {
return [];
}
- const fonts = await this.pageStyle.getUsedFontFaces(node, options).catch(console.error);
+ const fonts =
+ await this.pageStyle.getUsedFontFaces(node, options).catch(console.error);
if (!fonts) {
return [];
}
return fonts;
}
async getFontsNotInNode(nodeFonts, options) {
--- a/devtools/client/inspector/inspector.js
+++ b/devtools/client/inspector/inspector.js
@@ -1060,17 +1060,18 @@ Inspector.prototype = {
this.onEyeDropperDone = this.onEyeDropperDone.bind(this);
this.onEyeDropperButtonClicked = this.onEyeDropperButtonClicked.bind(this);
this.eyeDropperButton = this.panelDoc
.getElementById("inspector-eyedropper-toggle");
this.eyeDropperButton.disabled = false;
this.eyeDropperButton.title = INSPECTOR_L10N.getStr("inspector.eyedropper.label");
this.eyeDropperButton.addEventListener("click", this.onEyeDropperButtonClicked);
} else {
- const eyeDropperButton = this.panelDoc.getElementById("inspector-eyedropper-toggle");
+ const eyeDropperButton =
+ this.panelDoc.getElementById("inspector-eyedropper-toggle");
eyeDropperButton.disabled = true;
eyeDropperButton.title = INSPECTOR_L10N.getStr("eyedropper.disabled.title");
}
},
teardownToolbar: function() {
if (this.addNodeButton) {
this.addNodeButton.removeEventListener("click", this.addNode);
--- a/devtools/client/inspector/markup/markup.js
+++ b/devtools/client/inspector/markup/markup.js
@@ -643,25 +643,25 @@ MarkupView.prototype = {
}
if (!selection.isNode()) {
this.unmarkSelectedNode();
return;
}
const done = this.inspector.updating("markup-view");
- let onShowBoxModel, onShow;
+ let onShowBoxModel;
// Highlight the element briefly if needed.
if (this._shouldNewSelectionBeHighlighted()) {
onShowBoxModel = this._brieflyShowBoxModel(selection.nodeFront);
}
const slotted = selection.isSlotted();
- onShow = this.showNode(selection.nodeFront, { slotted }).then(() => {
+ const onShow = this.showNode(selection.nodeFront, { slotted }).then(() => {
// We could be destroyed by now.
if (this._destroyer) {
return promise.reject("markupview destroyed");
}
// Mark the node as selected.
const container = this.getContainer(selection.nodeFront, slotted);
this._markContainerAsSelected(container);
--- a/devtools/client/inspector/markup/test/browser_markup_display_node_02.js
+++ b/devtools/client/inspector/markup/test/browser_markup_display_node_02.js
@@ -79,18 +79,18 @@ const TEST_DATA = [
after: {
textContent: "flex",
display: "inline-block"
}
}
];
add_task(async function() {
- const {inspector, testActor} = await openInspectorForURL("data:text/html;charset=utf-8," +
- encodeURIComponent(TEST_URI));
+ const {inspector, testActor} = await openInspectorForURL(
+ "data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
for (const data of TEST_DATA) {
info("Running test case: " + data.desc);
await runTestData(inspector, testActor, data);
}
});
async function runTestData(inspector, testActor,
--- a/devtools/client/inspector/rules/test/browser_rules_completion-existing-property_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_completion-existing-property_01.js
@@ -110,17 +110,19 @@ async function testCompletion([key, comp
onSuggest = once(editor.input, "keypress");
} else {
info("Waiting for after-suggest event on the editor");
onSuggest = editor.once("after-suggest");
}
// Also listening for popup opened/closed events if needed.
const popupEvent = open ? "popup-opened" : "popup-closed";
- const onPopupEvent = editor.popup.isOpen !== open ? once(editor.popup, popupEvent) : null;
+ const onPopupEvent = editor.popup.isOpen !== open
+ ? once(editor.popup, popupEvent)
+ : null;
info("Synthesizing key " + key);
EventUtils.synthesizeKey(key, {}, view.styleWindow);
// Flush the debounce for the preview text.
view.debounce.flush();
await onSuggest;
--- a/devtools/client/inspector/rules/test/browser_rules_completion-existing-property_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_completion-existing-property_02.js
@@ -90,17 +90,19 @@ async function testCompletion([key, modi
? editor.once("after-suggest")
: null;
}
info("Synthesizing key " + key + ", modifiers: " + Object.keys(modifiers));
// Also listening for popup opened/closed events if needed.
const popupEvent = open ? "popup-opened" : "popup-closed";
- const onPopupEvent = editor.popup.isOpen !== open ? once(editor.popup, popupEvent) : null;
+ const onPopupEvent = editor.popup.isOpen !== open
+ ? once(editor.popup, popupEvent)
+ : null;
EventUtils.synthesizeKey(key, modifiers, view.styleWindow);
// Flush the debounce for the preview text.
view.debounce.flush();
await onDone;
await onPopupEvent;
--- a/devtools/client/inspector/rules/test/browser_rules_completion-new-property_01.js
+++ b/devtools/client/inspector/rules/test/browser_rules_completion-new-property_01.js
@@ -76,17 +76,19 @@ async function testCompletion([key, comp
onSuggest = once(editor.input, "keypress");
} else {
info("Waiting for after-suggest event on the editor");
onSuggest = editor.once("after-suggest");
}
// Also listening for popup opened/closed events if needed.
const popupEvent = open ? "popup-opened" : "popup-closed";
- const onPopupEvent = editor.popup.isOpen !== open ? once(editor.popup, popupEvent) : null;
+ const onPopupEvent = editor.popup.isOpen !== open
+ ? once(editor.popup, popupEvent)
+ : null;
info("Synthesizing key " + key);
EventUtils.synthesizeKey(key, {}, view.styleWindow);
await onSuggest;
await onPopupEvent;
info("Checking the state");
--- a/devtools/client/inspector/rules/test/browser_rules_completion-new-property_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_completion-new-property_02.js
@@ -97,17 +97,19 @@ async function testCompletion([key, modi
// closed).
onDone = key !== "VK_RIGHT" && key !== "VK_BACK_SPACE"
? editor.once("after-suggest")
: null;
}
// Also listening for popup opened/closed events if needed.
const popupEvent = open ? "popup-opened" : "popup-closed";
- const onPopupEvent = editor.popup.isOpen !== open ? once(editor.popup, popupEvent) : null;
+ const onPopupEvent = editor.popup.isOpen !== open
+ ? once(editor.popup, popupEvent)
+ : null;
info("Synthesizing key " + key + ", modifiers: " + Object.keys(modifiers));
EventUtils.synthesizeKey(key, modifiers, view.styleWindow);
// Flush the debounce for the preview text.
view.debounce.flush();
await onDone;
--- a/devtools/client/inspector/rules/test/browser_rules_edit-value-after-name_04.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-value-after-name_04.js
@@ -20,17 +20,18 @@ add_task(async function() {
await addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
const {inspector, view} = await openRuleView();
info("Test click on background-image url while editing property name");
await selectNode("#testid", inspector);
const ruleEditor = getRuleViewRuleEditor(view, 1);
const propEditor = ruleEditor.rule.textProps[0].editor;
- const anchor = propEditor.valueSpan.querySelector(".ruleview-propertyvalue .theme-link");
+ const anchor =
+ propEditor.valueSpan.querySelector(".ruleview-propertyvalue .theme-link");
info("Focus the background name span");
await focusEditableField(view, propEditor.nameSpan);
const editor = inplaceEditor(propEditor.doc.activeElement);
info("Modify the property to background to trigger the " +
"property-value-updated event");
editor.input.value = "background-image";
--- a/devtools/client/inspector/rules/test/browser_rules_gridline-names-autocomplete.js
+++ b/devtools/client/inspector/rules/test/browser_rules_gridline-names-autocomplete.js
@@ -135,17 +135,19 @@ async function testCompletion([key, modi
// closed).
onDone = key !== "VK_RIGHT" && key !== "VK_BACK_SPACE"
? editor.once("after-suggest")
: null;
}
// Also listening for popup opened/closed events if needed.
const popupEvent = open ? "popup-opened" : "popup-closed";
- const onPopupEvent = editor.popup.isOpen !== open ? once(editor.popup, popupEvent) : null;
+ const onPopupEvent = editor.popup.isOpen !== open
+ ? once(editor.popup, popupEvent)
+ : null;
info("Synthesizing key " + key + ", modifiers: " + Object.keys(modifiers));
EventUtils.synthesizeKey(key, modifiers, view.styleWindow);
// Flush the debounce for the preview text.
view.debounce.flush();
--- a/devtools/client/inspector/rules/test/browser_rules_shapes-toggle_02.js
+++ b/devtools/client/inspector/rules/test/browser_rules_shapes-toggle_02.js
@@ -25,17 +25,18 @@ add_task(async function() {
await addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
const {inspector, view} = await openRuleView();
await selectNode("#shape", inspector);
const container = getRuleViewProperty(view, "#shape", "clip-path").valueSpan;
const shapeToggle = container.querySelector(".ruleview-shapeswatch");
const shapeToggleStyle = getComputedStyle(shapeToggle);
const overriddenContainer = getRuleViewProperty(view, "div", "clip-path").valueSpan;
- const overriddenShapeToggle = overriddenContainer.querySelector(".ruleview-shapeswatch");
+ const overriddenShapeToggle =
+ overriddenContainer.querySelector(".ruleview-shapeswatch");
const overriddenShapeToggleStyle = getComputedStyle(overriddenShapeToggle);
ok(shapeToggle && overriddenShapeToggle,
"Shapes highlighter toggles exist in the DOM.");
ok(!shapeToggle.classList.contains("active") &&
!overriddenShapeToggle.classList.contains("active"),
"Shapes highlighter toggle buttons are not active.");
--- a/devtools/client/inspector/rules/views/class-list-previewer.js
+++ b/devtools/client/inspector/rules/views/class-list-previewer.js
@@ -68,19 +68,20 @@ ClassListPreviewerModel.prototype = {
get currentClasses() {
if (!this.currentNode) {
return [];
}
if (!CLASSES.has(this.currentNode)) {
// Use the proxy node to get a clean list of classes.
this.classListProxyNode.className = this.currentNode.className;
- const nodeClasses = [...new Set([...this.classListProxyNode.classList])].map(name => {
- return { name, isApplied: true };
- });
+ const nodeClasses = [...new Set([...this.classListProxyNode.classList])]
+ .map(name => {
+ return { name, isApplied: true };
+ });
CLASSES.set(this.currentNode, nodeClasses);
}
return CLASSES.get(this.currentNode);
},
/**
--- a/devtools/client/inspector/test/browser_inspector_highlighter-cssshape_03.js
+++ b/devtools/client/inspector/test/browser_inspector_highlighter-cssshape_03.js
@@ -22,17 +22,18 @@ add_task(async function() {
await helper.finalize();
});
async function testZoomSize(testActor, helper) {
await helper.show("#polygon", {mode: "cssClipPath"});
const quads = await testActor.getAllAdjustedQuads("#polygon");
const { top, left, width, height } = quads.border[0].bounds;
- const expectedStyle = `top:${top}px;left:${left}px;width:${width}px;height:${height}px;`;
+ const expectedStyle =
+ `top:${top}px;left:${left}px;width:${width}px;height:${height}px;`;
// The top/left/width/height of the highlighter should not change at any zoom level.
// It should always match the element being highlighted.
for (const zoom of TEST_LEVELS) {
info(`Setting zoom level to ${zoom}.`);
await testActor.zoomPageTo(zoom, helper.actorID);
const style = await helper.getElementAttribute("shapes-shape-container", "style");
--- a/devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-show-hide.js
+++ b/devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-show-hide.js
@@ -4,18 +4,19 @@
"use strict";
// Test the basic structure of the eye-dropper highlighter.
const HIGHLIGHTER_TYPE = "EyeDropper";
const ID = "eye-dropper-";
add_task(async function() {
- const helper = await openInspectorForURL("data:text/html;charset=utf-8,eye-dropper test")
- .then(getHighlighterHelperFor(HIGHLIGHTER_TYPE));
+ const helper =
+ await openInspectorForURL("data:text/html;charset=utf-8,eye-dropper test")
+ .then(getHighlighterHelperFor(HIGHLIGHTER_TYPE));
helper.prefix = ID;
await isInitiallyHidden(helper);
await canBeShownAndHidden(helper);
helper.finalize();
});
--- a/devtools/client/inspector/test/browser_inspector_highlighter-rulers_02.js
+++ b/devtools/client/inspector/test/browser_inspector_highlighter-rulers_02.js
@@ -42,17 +42,17 @@ async function isUpdatedAfterScroll(high
is(xAxisRulerTransform, null, "x axis ruler is positioned properly");
is(xAxisTextTransform, null, "x axis text are positioned properly");
is(yAxisRulerTransform, null, "y axis ruler is positioned properly");
is(yAxisTextTransform, null, "y axis text are positioned properly");
info("Ask the content window to scroll to specific coords");
- let x = 200, y = 300;
+ const x = 200, y = 300;
let data = await testActor.scrollWindow(x, y);
is(data.x, x, "window scrolled properly horizontally");
is(data.y, y, "window scrolled properly vertically");
info("Check the rulers are properly positioned after the scrolling");
--- a/devtools/client/inspector/test/browser_inspector_highlighter-zoom.js
+++ b/devtools/client/inspector/test/browser_inspector_highlighter-zoom.js
@@ -45,11 +45,12 @@ add_task(async function() {
"The style attribute of the root element is correct");
info("Unhighlight the node");
await highlighterUtils.unhighlight();
}
});
async function getElementsNodeStyle(testActor) {
- const value = await testActor.getHighlighterNodeAttribute("box-model-elements", "style");
+ const value =
+ await testActor.getHighlighterNodeAttribute("box-model-elements", "style");
return value;
}
--- a/devtools/client/jsonview/test/browser_jsonview_expand_collapse.js
+++ b/devtools/client/jsonview/test/browser_jsonview_expand_collapse.js
@@ -7,32 +7,32 @@
const TEST_JSON_URL = URL_ROOT + "array_json.json";
const EXPAND_THRESHOLD = 100 * 1024;
add_task(async function() {
info("Test expand/collapse JSON started");
await addJsonViewTab(TEST_JSON_URL);
- let browser = gBrowser.selectedBrowser, selector, countAfter, countBefore, json;
+ const browser = gBrowser.selectedBrowser;
/* Initial sanity check */
- countBefore = await getElementCount(".treeRow");
+ const countBefore = await getElementCount(".treeRow");
ok(countBefore == 6, "There must be six rows");
/* Test the "Collapse All" button */
- selector = ".jsonPanelBox .toolbar button.collapse";
+ let selector = ".jsonPanelBox .toolbar button.collapse";
await BrowserTestUtils.synthesizeMouseAtCenter(selector, {}, browser);
- countAfter = await getElementCount(".treeRow");
+ let countAfter = await getElementCount(".treeRow");
ok(countAfter == 3, "There must be three rows");
/* Test the "Expand All" button */
selector = ".jsonPanelBox .toolbar button.expand";
await BrowserTestUtils.synthesizeMouseAtCenter(selector, {}, browser);
countAfter = await getElementCount(".treeRow");
ok(countAfter == 6, "There must be six expanded rows");
/* Test big file handling */
- json = JSON.stringify({data: Array(1e5).fill().map(x => "hoot"), status: "ok"});
+ const json = JSON.stringify({data: Array(1e5).fill().map(x => "hoot"), status: "ok"});
ok(json.length > EXPAND_THRESHOLD, "The generated JSON must be larger than 100kB");
await addJsonViewTab("data:application/json," + json);
ok(document.querySelector(selector) == null, "The Expand All button must be gone");
});
--- a/devtools/client/netmonitor/src/actions/ui.js
+++ b/devtools/client/netmonitor/src/actions/ui.js
@@ -22,17 +22,19 @@ const { getDisplayedRequests } = require
/**
* Change network details panel.
*
* @param {boolean} open - expected network details panel open state
*/
function openNetworkDetails(open) {
return (dispatch, getState) => {
const visibleRequestItems = getDisplayedRequests(getState());
- const defaultSelectedId = visibleRequestItems.length ? visibleRequestItems[0].id : null;
+ const defaultSelectedId = visibleRequestItems.length
+ ? visibleRequestItems[0].id
+ : null;
return dispatch({
type: OPEN_NETWORK_DETAILS,
open,
defaultSelectedId,
});
};
}
--- a/devtools/client/netmonitor/src/components/RequestListColumnSetCookies.js
+++ b/devtools/client/netmonitor/src/components/RequestListColumnSetCookies.js
@@ -35,17 +35,19 @@ class RequestListColumnSetCookies extend
currResponseCookies = currResponseCookies.cookies || currResponseCookies;
nextResponseCookies = nextResponseCookies.cookies || nextResponseCookies;
return currResponseCookies !== nextResponseCookies;
}
render() {
let { responseCookies = { cookies: [] } } = this.props.item;
responseCookies = responseCookies.cookies || responseCookies;
- const responseCookiesLength = responseCookies.length > 0 ? responseCookies.length : "";
+ const responseCookiesLength = responseCookies.length > 0
+ ? responseCookies.length
+ : "";
return (
div({
className: "requests-list-column requests-list-set-cookies",
title: responseCookiesLength
}, responseCookiesLength)
);
}
}
--- a/devtools/client/netmonitor/src/connector/chrome/request.js
+++ b/devtools/client/netmonitor/src/connector/chrome/request.js
@@ -59,20 +59,20 @@ function Header(id, headers) {
from: id,
headers: header,
headersSize: headersSize,
rawHeaders: undefined,
};
}
function PostData(id, postData, header) {
const {headers, headersSize} = header;
- let payload = {},
- requestPostData = {
- from: id, postDataDiscarded: false, postData: {}
- };
+ const payload = {};
+ const requestPostData = {
+ from: id, postDataDiscarded: false, postData: {}
+ };
if (postData) {
requestPostData.postData.text = postData;
payload.requestPostData = Object.assign({}, requestPostData);
payload.requestHeadersFromUploadStream = {headers, headersSize};
}
return payload;
}
--- a/devtools/client/netmonitor/src/connector/firefox-data-provider.js
+++ b/devtools/client/netmonitor/src/connector/firefox-data-provider.js
@@ -476,17 +476,18 @@ class FirefoxDataProvider {
* @return {Promise} return a promise resolved when data is received.
*/
async _requestData(actor, method) {
// Calculate real name of the client getter.
const clientMethodName = `get${method.charAt(0).toUpperCase()}${method.slice(1)}`;
// The name of the callback that processes request response
const callbackMethodName = `on${method.charAt(0).toUpperCase()}${method.slice(1)}`;
// And the event to fire before updating this data
- const updatingEventName = `UPDATING_${method.replace(/([A-Z])/g, "_$1").toUpperCase()}`;
+ const updatingEventName =
+ `UPDATING_${method.replace(/([A-Z])/g, "_$1").toUpperCase()}`;
// Emit event that tell we just start fetching some data
this.emit(EVENTS[updatingEventName], actor);
let response = await new Promise((resolve, reject) => {
// Do a RDP request to fetch data from the actor.
if (typeof this.webConsoleClient[clientMethodName] === "function") {
// Make sure we fetch the real actor data instead of cloned actor
--- a/devtools/client/netmonitor/src/widgets/WaterfallBackground.js
+++ b/devtools/client/netmonitor/src/widgets/WaterfallBackground.js
@@ -102,17 +102,18 @@ class WaterfallBackground {
alphaComponent += REQUESTS_WATERFALL.BACKGROUND_TICKS_OPACITY_ADD;
}
function drawTimestamp(timestamp, color) {
if (timestamp === -1) {
return;
}
- const delta = Math.floor((timestamp - state.firstRequestStartedMillis) * state.scale);
+ const delta =
+ Math.floor((timestamp - state.firstRequestStartedMillis) * state.scale);
drawPixelAt(delta, color);
}
const { DOMCONTENTLOADED_TICKS_COLOR, LOAD_TICKS_COLOR } = REQUESTS_WATERFALL;
drawTimestamp(state.timingMarkers.firstDocumentDOMContentLoadedTimestamp,
this.getThemeColorAsRgba(DOMCONTENTLOADED_TICKS_COLOR, state.theme));
drawTimestamp(state.timingMarkers.firstDocumentLoadTimestamp,
--- a/devtools/client/netmonitor/test/browser_net_columns_last_column.js
+++ b/devtools/client/netmonitor/test/browser_net_columns_last_column.js
@@ -39,12 +39,13 @@ add_task(async function() {
}
await teardown(monitor);
async function testLastMenuItem(column) {
EventUtils.sendMouseEvent({ type: "contextmenu" },
document.querySelector(`#requests-list-${column}-button`));
- const menuItem = parent.document.querySelector(`#request-list-header-${column}-toggle`);
+ const menuItem =
+ parent.document.querySelector(`#request-list-header-${column}-toggle`);
ok(menuItem.disabled, "Last visible column menu item should be disabled.");
}
});
--- a/devtools/client/netmonitor/test/browser_net_footer-summary.js
+++ b/devtools/client/netmonitor/test/browser_net_footer-summary.js
@@ -62,20 +62,21 @@ add_task(async function() {
.replace("#1", requestsSummary.count);
if (!totalRequestsCount || !requestsSummary.count) {
is(valueCount, L10N.getStr("networkMenu.summary.requestsCountEmpty"),
"The current summary text is incorrect, expected an 'empty' label.");
return;
}
- const valueTransfer = document.querySelector(".requests-list-network-summary-transfer")
- .textContent;
+ const valueTransfer =
+ document.querySelector(".requests-list-network-summary-transfer").textContent;
info("Current summary transfer: " + valueTransfer);
- const expectedTransfer = L10N.getFormatStrWithNumbers("networkMenu.summary.transferred",
+ const expectedTransfer = L10N.getFormatStrWithNumbers(
+ "networkMenu.summary.transferred",
getFormattedSize(requestsSummary.contentSize),
getFormattedSize(requestsSummary.transferredSize));
const valueFinish = document.querySelector(".requests-list-network-summary-finish")
.textContent;
info("Current summary finish: " + valueFinish);
const expectedFinish = L10N.getFormatStrWithNumbers("networkMenu.summary.finish",
getFormattedTime(requestsSummary.millis));
--- a/devtools/client/netmonitor/test/browser_net_open_request_in_tab.js
+++ b/devtools/client/netmonitor/test/browser_net_open_request_in_tab.js
@@ -64,13 +64,14 @@ add_task(async function() {
content.wrappedJSObject.performRequest(meth);
});
await wait;
}
async function checkTabResponse(checkedTab, method) {
await ContentTask.spawn(checkedTab.linkedBrowser, method, async function(met) {
const { body } = content.wrappedJSObject.document;
- const responseRE = RegExp(met + (met == "POST" ? "\n*\s*foo\=bar\&baz\=42" : ""));
+ const responseRE =
+ RegExp(met + (met == "POST" ? "\n*\s*foo\=bar\&baz\=42" : ""));
ok(body.innerHTML.match(responseRE), "Tab method and data match original request");
});
}
});
--- a/devtools/client/performance/performance-controller.js
+++ b/devtools/client/performance/performance-controller.js
@@ -251,17 +251,18 @@ var PerformanceController = {
* Checks whether or not a new recording is supported by the PerformanceFront.
* @return Promise:boolean
*/
async canCurrentlyRecord() {
const hasActor = await gTarget.hasActor("performance");
if (!hasActor) {
return true;
}
- const actorCanCheck = await gTarget.actorHasMethod("performance", "canCurrentlyRecord");
+ const actorCanCheck =
+ await gTarget.actorHasMethod("performance", "canCurrentlyRecord");
if (!actorCanCheck) {
return true;
}
return (await gFront.canCurrentlyRecord()).success;
},
/**
* Starts recording with the PerformanceFront.
--- a/devtools/client/performance/performance-view.js
+++ b/devtools/client/performance/performance-view.js
@@ -220,17 +220,18 @@ var PerformanceView = {
if (state === "console-recording") {
const recording = PerformanceController.getCurrentRecording();
let label = recording.getLabel() || "";
// Wrap the label in quotes if it exists for the commands.
label = label ? `"${label}"` : "";
- const startCommand = $(".console-profile-recording-notice .console-profile-command");
+ const startCommand =
+ $(".console-profile-recording-notice .console-profile-command");
const stopCommand = $(".console-profile-stop-notice .console-profile-command");
startCommand.value = `console.profile(${label})`;
stopCommand.value = `console.profileEnd(${label})`;
}
this.updateBufferStatus();
this.emit(EVENTS.UI_STATE_CHANGED, state);
--- a/devtools/client/performance/test/helpers/event-utils.js
+++ b/devtools/client/performance/test/helpers/event-utils.js
@@ -22,17 +22,18 @@ exports.once = function(target, eventNam
};
/**
* Waits for any event to be fired a specified amount of times on a target, no
* matter what kind of event emitter.
* Possible options: `useCapture`, `spreadArgs`, `expectedArgs`
*/
exports.times = function(target, eventName, receiveCount, options = {}) {
- const msg = `Waiting for event: '${eventName}' on ${target} for ${receiveCount} time(s)`;
+ const msg =
+ `Waiting for event: '${eventName}' on ${target} for ${receiveCount} time(s)`;
if ("expectedArgs" in options) {
dump(`${msg} with arguments: ${JSON.stringify(options.expectedArgs)}.\n`);
} else {
dump(`${msg}.\n`);
}
return new Promise((resolve, reject) => {
if (typeof eventName != "string") {
--- a/devtools/client/performance/test/helpers/tab-utils.js
+++ b/devtools/client/performance/test/helpers/tab-utils.js
@@ -40,13 +40,14 @@ exports.removeTab = function(tab) {
BrowserTestUtils.removeTab(tab);
};
/**
* Adds a browser window with the provided options.
*/
exports.addWindow = async function(options) {
- const { OpenBrowserWindow } = Services.wm.getMostRecentWindow(gDevTools.chromeWindowType);
+ const { OpenBrowserWindow } =
+ Services.wm.getMostRecentWindow(gDevTools.chromeWindowType);
const win = OpenBrowserWindow(options);
await waitForDelayedStartupFinished(win);
return win;
};
--- a/devtools/client/performance/views/details-js-call-tree.js
+++ b/devtools/client/performance/views/details-js-call-tree.js
@@ -58,17 +58,18 @@ var JsCallTreeView = extend(DetailsSubvi
const showOptimizations = PerformanceController.getOption("show-jit-optimizations");
const options = {
contentOnly: !PerformanceController.getOption("show-platform-data"),
invertTree: PerformanceController.getOption("invert-call-tree"),
flattenRecursion: PerformanceController.getOption("flatten-tree-recursion"),
showOptimizationHint: showOptimizations
};
- const threadNode = this.threadNode = this._prepareCallTree(profile, interval, options);
+ const threadNode =
+ this.threadNode = this._prepareCallTree(profile, interval, options);
this._populateCallTree(threadNode, options);
// For better or worse, re-rendering loses frame selection,
// so we should always hide opts on rerender
this.hideOptimizations();
this.emit(EVENTS.UI_JS_CALL_TREE_RENDERED);
},
@@ -132,18 +133,18 @@ var JsCallTreeView = extend(DetailsSubvi
/**
* Called when the recording is stopped and prepares data to
* populate the call tree.
*/
_prepareCallTree: function(profile, { startTime, endTime }, options) {
const thread = profile.threads[0];
const { contentOnly, invertTree, flattenRecursion } = options;
- const threadNode = new ThreadNode(thread, { startTime, endTime, contentOnly, invertTree,
- flattenRecursion });
+ const threadNode = new ThreadNode(thread,
+ { startTime, endTime, contentOnly, invertTree, flattenRecursion });
// Real profiles from nsProfiler (i.e. not synthesized from allocation
// logs) always have a (root) node. Go down one level in the uninverted
// view to avoid displaying both the synthesized root node and the (root)
// node from the profiler.
if (!invertTree) {
threadNode.calls = threadNode.calls[0].calls;
}
--- a/devtools/client/responsive.html/test/browser/browser_device_custom.js
+++ b/devtools/client/responsive.html/test/browser/browser_device_custom.js
@@ -58,17 +58,18 @@ addRDMTask(TEST_URL, async function({ ui
const deviceCb = [...document.querySelectorAll(".device-input-checkbox")].find(cb => {
return cb.value == device.name;
});
ok(deviceCb, "Custom device checkbox added to modal");
ok(deviceCb.checked, "Custom device enabled");
submitButton.click();
info("Look for custom device in device selector");
- const selectorOption = [...deviceSelector.options].find(opt => opt.value == device.name);
+ const selectorOption =
+ [...deviceSelector.options].find(opt => opt.value == device.name);
ok(selectorOption, "Custom device option added to device selector");
});
addRDMTask(TEST_URL, async function({ ui }) {
const { toolWindow } = ui;
const { store, document } = toolWindow;
// Wait until the viewport has been added and the device list has been loaded
@@ -98,17 +99,18 @@ addRDMTask(TEST_URL, async function({ ui
]);
deviceRemoveButton.click();
await removed;
submitButton.click();
info("Ensure custom device was removed from device selector");
await waitUntilState(store, state => state.viewports[0].device == "");
is(deviceSelector.value, "", "Device selector reset to no device");
- const selectorOption = [...deviceSelector.options].find(opt => opt.value == device.name);
+ const selectorOption =
+ [...deviceSelector.options].find(opt => opt.value == device.name);
ok(!selectorOption, "Custom device option removed from device selector");
info("Ensure device properties like UA have been reset");
await testUserAgent(ui, navigator.userAgent);
});
addRDMTask(TEST_URL, async function({ ui }) {
const { toolWindow } = ui;
@@ -162,17 +164,18 @@ addRDMTask(TEST_URL, async function({ ui
opt.value == unicodeDevice.name);
ok(selectorOption, "Custom unicode device option present in device selector");
});
function testDeviceAdder(ui, expected) {
const { document } = ui.toolWindow;
const nameInput = document.querySelector("#device-adder-name input");
- const [ widthInput, heightInput ] = document.querySelectorAll("#device-adder-size input");
+ const [ widthInput, heightInput ] =
+ document.querySelectorAll("#device-adder-size input");
const pixelRatioInput = document.querySelector("#device-adder-pixel-ratio input");
const userAgentInput = document.querySelector("#device-adder-user-agent input");
const touchInput = document.querySelector("#device-adder-touch input");
is(nameInput.value, expected.name, "Device name matches");
is(parseInt(widthInput.value, 10), expected.width, "Width matches");
is(parseInt(heightInput.value, 10), expected.height, "Height matches");
is(parseFloat(pixelRatioInput.value), expected.pixelRatio,
--- a/devtools/client/responsive.html/test/browser/browser_device_custom_remove.js
+++ b/devtools/client/responsive.html/test/browser/browser_device_custom_remove.js
@@ -95,21 +95,23 @@ addRDMTask(TEST_URL, async function({ ui
// Wait until the viewport has been added and the device list has been loaded
await waitUntilState(store, state => state.viewports.length == 1
&& state.devices.listState == Types.loadableState.LOADED);
const deviceSelector = document.querySelector(".viewport-device-selector");
info("Ensure device 1 is still in device selector");
- const deviceOption1 = [...deviceSelector.options].find(opt => opt.value == device1.name);
+ const deviceOption1 =
+ [...deviceSelector.options].find(opt => opt.value == device1.name);
ok(deviceOption1, "Test device 1 option exists");
info("Ensure device 2 is no longer in device selector");
- const deviceOption2 = [...deviceSelector.options].find(opt => opt.value == device2.name);
+ const deviceOption2 =
+ [...deviceSelector.options].find(opt => opt.value == device2.name);
ok(!deviceOption2, "Test device 2 option removed");
openDeviceModal(ui);
info("Ensure device 1 is still in device modal");
const deviceCbs =
[...document.querySelectorAll(".device-type-custom .device-input-checkbox")];
is(deviceCbs.length, 1, "Only 1 custom present in modal");
--- a/devtools/client/responsive.html/test/browser/browser_device_width.js
+++ b/devtools/client/responsive.html/test/browser/browser_device_width.js
@@ -29,17 +29,17 @@ addRDMTask(TEST_URL, async function({ ui
docShell.deviceSizeIsPageSize = false;
});
info("Checking for screen props once again.");
await checkScreenProps2(ui);
});
async function setViewportSizeWithInputKeys(ui) {
- let width = 320, height = 500;
+ const width = 320, height = 500;
let resized = waitForViewportResizeTo(ui, width, height);
ui.setViewportSize({ width, height });
await resized;
const dimensions = ui.toolWindow.document.querySelectorAll(".viewport-dimension-input");
// Increase width value to 420 by using the Up arrow key
resized = waitForViewportResizeTo(ui, 420, height);
--- a/devtools/client/responsive.html/test/browser/head.js
+++ b/devtools/client/responsive.html/test/browser/head.js
@@ -389,17 +389,18 @@ async function testUserAgentFromBrowser(
* function adds `device` via the form, saves it, and waits for it to appear in the store.
*/
function addDeviceInModal(ui, device) {
const { Simulate } =
ui.toolWindow.require("devtools/client/shared/vendor/react-dom-test-utils");
const { store, document } = ui.toolWindow;
const nameInput = document.querySelector("#device-adder-name input");
- const [ widthInput, heightInput ] = document.querySelectorAll("#device-adder-size input");
+ const [ widthInput, heightInput ] =
+ document.querySelectorAll("#device-adder-size input");
const pixelRatioInput = document.querySelector("#device-adder-pixel-ratio input");
const userAgentInput = document.querySelector("#device-adder-user-agent input");
const touchInput = document.querySelector("#device-adder-touch input");
nameInput.value = device.name;
Simulate.change(nameInput);
widthInput.value = device.width;
Simulate.change(widthInput);
--- a/devtools/client/scratchpad/scratchpad.js
+++ b/devtools/client/scratchpad/scratchpad.js
@@ -1078,18 +1078,19 @@ var Scratchpad = {
/**
* Get content converted to unicode, using a list of input charset to try.
*
* @param string aContent
* @param array of string aCharsetArray
* @return string
*/
_getUnicodeContent: function SP__getUnicodeContent(aContent, aCharsetArray) {
- let content = null,
- converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Ci.nsIScriptableUnicodeConverter);
+ const converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Ci.nsIScriptableUnicodeConverter);
+
+ let content = null;
aCharsetArray.some(charset => {
try {
converter.charset = charset;
content = converter.ConvertToUnicode(aContent);
return true;
} catch (e) {
this.notificationBox.appendNotification(
this.strings.formatStringFromName("importFromFile.convert.failed",
--- a/devtools/client/scratchpad/test/browser_scratchpad_throw_output.js
+++ b/devtools/client/scratchpad/test/browser_scratchpad_throw_output.js
@@ -9,17 +9,17 @@ function test() {
BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(function() {
openScratchpad(testThrowOutput);
});
gBrowser.loadURI("data:text/html;charset=utf8,<p>Test throw outputs in Scratchpad</p>");
}
function testThrowOutput() {
- let scratchpad = gScratchpadWindow.Scratchpad, tests = [];
+ const scratchpad = gScratchpadWindow.Scratchpad, tests = [];
const falsyValues = ["false", "0", "-0", "null", "undefined", "Infinity",
"-Infinity", "NaN"];
falsyValues.forEach(function(value) {
tests.push({
method: "display",
code: "throw " + value + ";",
result: "throw " + value + ";\n/*\nException: " + value + "\n*/",
--- a/devtools/client/shadereditor/test/doc_multiple-contexts.html
+++ b/devtools/client/shadereditor/test/doc_multiple-contexts.html
@@ -28,17 +28,17 @@
<body>
<canvas id="canvas1" width="128" height="128"></canvas>
<canvas id="canvas2" width="128" height="128"></canvas>
<script type="text/javascript">
"use strict";
- let canvas = [], gl = [];
+ const canvas = [], gl = [];
const program = [];
const squareVerticesPositionBuffer = [];
const vertexPositionAttribute = [];
const colorUniform = [];
window.onload = function() {
for (let i = 0; i < 2; i++) {
canvas[i] = document.querySelector("#canvas" + (i + 1));
--- a/devtools/client/shared/node-attribute-parser.js
+++ b/devtools/client/shared/node-attribute-parser.js
@@ -259,17 +259,19 @@ function hasAttribute(attributes, attrib
* Split a string by a given character and return an array of objects parts.
* The array will contain objects for the split character too, marked with
* TYPE_STRING type.
* @param {String} value The string to parse.
* @param {String} splitChar A 1 length split character.
* @return {Array}
*/
function splitBy(value, splitChar) {
- let data = [], i = 0, buffer = "";
+ const data = [];
+
+ let i = 0, buffer = "";
while (i <= value.length) {
if (i === value.length && buffer) {
data.push({value: buffer});
}
if (value[i] === splitChar) {
if (buffer) {
data.push({value: buffer});
}
--- a/devtools/client/shared/output-parser.js
+++ b/devtools/client/shared/output-parser.js
@@ -331,18 +331,18 @@ OutputParser.prototype = {
outerMostFunctionTakesColor = COLOR_TAKING_FUNCTIONS.includes(
token.text);
}
++parenDepth;
} else if (token.text === "var" && options.isVariableInUse) {
const variableNode = this._parseVariable(token, text, tokenStream, options);
this.parsed.push(variableNode);
} else {
- const {functionData, sawVariable} = this._parseMatchingParens(text, tokenStream,
- options);
+ const {functionData, sawVariable} =
+ this._parseMatchingParens(text, tokenStream, options);
const functionName = text.substring(token.startOffset, token.endOffset);
if (sawVariable) {
// If function contains variable, we need to add both strings
// and nodes.
this._appendTextNode(functionName);
for (const data of functionData) {
--- a/devtools/client/shared/test/browser_filter-editor-02.js
+++ b/devtools/client/shared/test/browser_filter-editor-02.js
@@ -88,17 +88,17 @@ add_task(async function() {
}
const filters = container.querySelectorAll(".filter");
testRenderedFilters(filters, expected);
}
});
function testRenderedFilters(filters, expected) {
for (const [index, filter] of [...filters].entries()) {
- let [name, value] = filter.children,
+ const [name, value] = filter.children,
label = name.children[1],
[input, unit] = value.children;
const eq = expected[index];
is(label.textContent, eq.label, "Label should match");
is(input.value, eq.value, "Values should match");
if (eq.unit) {
is(unit.textContent, eq.unit, "Unit should match");
--- a/devtools/client/shared/test/browser_html_tooltip-04.js
+++ b/devtools/client/shared/test/browser_html_tooltip-04.js
@@ -30,17 +30,17 @@ add_task(async function() {
const div = doc.createElementNS(HTML_NS, "div");
div.style.height = "100%";
tooltip.setContent(div, {width: TOOLTIP_WIDTH, height: TOOLTIP_HEIGHT});
const box1 = doc.getElementById("box1");
const box2 = doc.getElementById("box2");
const box3 = doc.getElementById("box3");
const box4 = doc.getElementById("box4");
- let height = TOOLTIP_HEIGHT, width = TOOLTIP_WIDTH;
+ const height = TOOLTIP_HEIGHT, width = TOOLTIP_WIDTH;
// box1: Can only fit below box1
info("Display the tooltip on box1.");
await showTooltip(tooltip, box1);
let expectedTooltipGeometry = {position: "bottom", height, width};
checkTooltipGeometry(tooltip, box1, expectedTooltipGeometry);
await hideTooltip(tooltip);
--- a/devtools/client/shared/test/browser_html_tooltip_consecutive-show.js
+++ b/devtools/client/shared/test/browser_html_tooltip_consecutive-show.js
@@ -25,17 +25,17 @@ function getTooltipContent(doc) {
add_task(async function() {
const [,, doc] = await createHost("bottom", TEST_URI);
const box1 = doc.getElementById("box1");
const box2 = doc.getElementById("box2");
const box3 = doc.getElementById("box3");
const box4 = doc.getElementById("box4");
- let width = 100, height = 50;
+ const width = 100, height = 50;
const tooltip = new HTMLTooltip(doc, {useXulWrapper: false});
tooltip.setContent(getTooltipContent(doc), {width, height});
info("Show the tooltip on each of the 4 hbox, without calling hide in between");
info("Show tooltip on box1");
tooltip.show(box1);
--- a/devtools/client/shared/test/browser_html_tooltip_hover.js
+++ b/devtools/client/shared/test/browser_html_tooltip_hover.js
@@ -14,17 +14,17 @@ const TEST_URI = CHROME_URL_ROOT + "doc_
const {HTMLTooltip} = require("devtools/client/shared/widgets/tooltip/HTMLTooltip");
loadHelperScript("helper_html_tooltip.js");
add_task(async function() {
const [,, doc] = await createHost("bottom", TEST_URI);
// Wait for full page load before synthesizing events on the page.
await waitUntil(() => doc.readyState === "complete");
- let width = 100, height = 50;
+ const width = 100, height = 50;
const tooltipContent = doc.createElementNS(HTML_NS, "div");
tooltipContent.textContent = "tooltip";
const tooltip = new HTMLTooltip(doc, {useXulWrapper: false});
tooltip.setContent(tooltipContent, {width, height});
const container = doc.getElementById("container");
tooltip.startTogglingOnHover(container, () => true);
--- a/devtools/client/shared/test/shared-head.js
+++ b/devtools/client/shared/test/shared-head.js
@@ -20,17 +20,20 @@ function scopedCuImport(path) {
}
const {ScratchpadManager} = scopedCuImport("resource://devtools/client/scratchpad/scratchpad-manager.jsm");
const {loader, require} = scopedCuImport("resource://devtools/shared/Loader.jsm");
const {gDevTools} = require("devtools/client/framework/devtools");
const {TargetFactory} = require("devtools/client/framework/target");
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
-const promise = require("promise");
+
+// This is overridden in files that load shared-head via loadSubScript.
+// eslint-disable-next-line prefer-const
+let promise = require("promise");
const defer = require("devtools/shared/defer");
const Services = require("Services");
const KeyShortcuts = require("devtools/client/shared/key-shortcuts");
const TEST_DIR = gTestPath.substr(0, gTestPath.lastIndexOf("/"));
const CHROME_URL_ROOT = TEST_DIR + "/";
const URL_ROOT = CHROME_URL_ROOT.replace("chrome://mochitests/content/",
"http://example.com/");
--- a/devtools/client/shared/widgets/CubicBezierWidget.js
+++ b/devtools/client/shared/widgets/CubicBezierWidget.js
@@ -105,37 +105,37 @@ function BezierCanvas(canvas, bezier, pa
exports.BezierCanvas = BezierCanvas;
BezierCanvas.prototype = {
/**
* Get P1 and P2 current top/left offsets so they can be positioned
* @return {Array} Returns an array of 2 {top:String,left:String} objects
*/
get offsets() {
- let p = this.padding, w = this.canvas.width, h = this.canvas.height;
+ const p = this.padding, w = this.canvas.width, h = this.canvas.height;
return [{
left: w * (this.bezier.coordinates[0] * (1 - p[3] - p[1]) - p[3]) + "px",
top: h * (1 - this.bezier.coordinates[1] * (1 - p[0] - p[2]) - p[0])
+ "px"
}, {
left: w * (this.bezier.coordinates[2] * (1 - p[3] - p[1]) - p[3]) + "px",
top: h * (1 - this.bezier.coordinates[3] * (1 - p[0] - p[2]) - p[0])
+ "px"
}];
},
/**
* Convert an element's left/top offsets into coordinates
*/
offsetsToCoordinates: function(element) {
- let p = this.padding, w = this.canvas.width, h = this.canvas.height;
+ const w = this.canvas.width, h = this.canvas.height;
// Convert padding percentage to actual padding
- p = p.map((a, i) => a * (i % 2 ? w : h));
+ const p = this.padding.map((a, i) => a * (i % 2 ? w : h));
return [
(parseFloat(element.style.left) - p[3]) / (w + p[1] + p[3]),
(h - parseFloat(element.style.top) - p[2]) / (h - p[0] - p[2])
];
},
/**
--- a/devtools/client/shared/widgets/Spectrum.js
+++ b/devtools/client/shared/widgets/Spectrum.js
@@ -107,22 +107,24 @@ Spectrum.hsvToRgb = function(h, s, v, a)
return [r * 255, g * 255, b * 255, a];
};
Spectrum.rgbToHsv = function(r, g, b, a) {
r = r / 255;
g = g / 255;
b = b / 255;
- let max = Math.max(r, g, b), min = Math.min(r, g, b);
- let h, s, v = max;
+ const max = Math.max(r, g, b);
+ const min = Math.min(r, g, b);
+ const v = max;
const d = max - min;
- s = max == 0 ? 0 : d / max;
+ const s = max == 0 ? 0 : d / max;
+ let h;
if (max == min) {
// achromatic
h = 0;
} else {
switch (max) {
case r: h = (g - b) / d + (g < b ? 6 : 0); break;
case g: h = (b - r) / d + 2; break;
case b: h = (r - g) / d + 4; break;
--- a/devtools/client/shared/widgets/TableWidget.js
+++ b/devtools/client/shared/widgets/TableWidget.js
@@ -309,18 +309,16 @@ TableWidget.prototype = {
// have been edited and had to be recreated when the user has pressed tab or
// shift+tab. Both of these situations require us to recover our target,
// select the appropriate row and move the textbox on to the next cell.
if (editor.changePending) {
// We need to apply a change, which can mean that the position of cells
// within the table can change. Because of this we need to wait for
// EVENTS.ROW_EDIT and then move the textbox.
this.once(EVENTS.ROW_EDIT, uniqueId => {
- let cell;
- let cells;
let columnObj;
const cols = this.editableColumns;
let rowIndex = this.visibleSelectedIndex;
const colIndex = cols.indexOf(column);
let newIndex;
// If the row has been deleted we should bail out.
if (!uniqueId) {
@@ -361,18 +359,18 @@ TableWidget.prototype = {
this.emit(EVENTS.ROW_SELECTED, uniqueId);
}
// EVENTS.ROW_SELECTED may have changed the selected row so let's save
// the result in rowIndex.
rowIndex = this.visibleSelectedIndex;
// Edit the appropriate cell.
- cells = columnObj.visibleCellNodes;
- cell = cells[rowIndex];
+ const cells = columnObj.visibleCellNodes;
+ const cell = cells[rowIndex];
editor.edit(cell);
// Remove flash-out class... it won't have been auto-removed because the
// cell was hidden for editing.
cell.classList.remove("flash-out");
});
}
--- a/devtools/client/shared/widgets/VariablesView.jsm
+++ b/devtools/client/shared/widgets/VariablesView.jsm
@@ -3519,17 +3519,18 @@ VariablesView.stringifiers.byObjectKind
if (concise) {
return aGrip.class + "[" + preview.length + "]";
}
if (!preview.items) {
return null;
}
- let shown = 0, result = [], lastHole = null;
+ let shown = 0, lastHole = null;
+ const result = [];
for (const item of preview.items) {
if (item === null) {
if (lastHole !== null) {
result[lastHole] += ",";
} else {
result.push("");
}
lastHole = result.length - 1;
--- a/devtools/client/shared/widgets/tooltip/SwatchColorPickerTooltip.js
+++ b/devtools/client/shared/widgets/tooltip/SwatchColorPickerTooltip.js
@@ -50,23 +50,21 @@ class SwatchColorPickerTooltip extends S
*/
setColorPickerContent(color) {
const { doc } = this.tooltip;
const container = doc.createElementNS(XHTML_NS, "div");
container.id = "spectrum-tooltip";
- let widget;
-
const node = doc.createElementNS(XHTML_NS, "div");
node.id = "spectrum";
container.appendChild(node);
- widget = new Spectrum(node, color);
+ const widget = new Spectrum(node, color);
this.tooltip.setContent(container, { width: 218, height: 224 });
widget.inspector = this.inspector;
const eyedropper = doc.createElementNS(XHTML_NS, "button");
eyedropper.id = "eyedropper-button";
eyedropper.className = "devtools-button";
/* pointerEvents for eyedropper has to be set auto to display tooltip when
--- a/devtools/client/sourceeditor/wasm.js
+++ b/devtools/client/sourceeditor/wasm.js
@@ -17,17 +17,17 @@ function getWasmText(subject, data) {
const dis = new wasmdis.WasmDisassembler();
dis.addOffsets = true;
const done = dis.disassembleChunk(parser);
let result = dis.getResult();
if (result.lines.length === 0) {
result = { lines: ["No luck with wast conversion"], offsets: [0], done, };
}
- let offsets = result.offsets, lines = [];
+ const offsets = result.offsets, lines = [];
for (let i = 0; i < offsets.length; i++) {
lines[offsets[i]] = i;
}
wasmStates.set(subject, { offsets, lines, });
return { lines: result.lines, done: result.done };
}
--- a/devtools/client/storage/ui.js
+++ b/devtools/client/storage/ui.js
@@ -1340,17 +1340,18 @@ class StorageUI {
}
exports.StorageUI = StorageUI;
// Helper Functions
function createGUID() {
return "{cccccccc-cccc-4ccc-yccc-cccccccccccc}".replace(/[cy]/g, c => {
- let r = Math.random() * 16 | 0, v = c == "c" ? r : (r & 0x3 | 0x8);
+ const r = Math.random() * 16 | 0;
+ const v = c == "c" ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
function addEllipsis(name) {
if (name.length > ITEM_NAME_MAX_LENGTH) {
if (/^https?:/.test(name)) {
// For URLs, add ellipsis in the middle
--- a/devtools/client/webaudioeditor/test/browser_audionode-actor-add-automation-event.js
+++ b/devtools/client/webaudioeditor/test/browser_audionode-actor-add-automation-event.js
@@ -10,17 +10,17 @@ add_task(async function() {
const [_, [destNode, oscNode, gainNode]] = await Promise.all([
front.setup({ reload: true }),
get3(front, "create-node")
]);
let count = 0;
const counter = () => count++;
front.on("automation-event", counter);
- let t0 = 0, t1 = 0.1, t2 = 0.2, t3 = 0.3, t4 = 0.4, t5 = 0.6, t6 = 0.7, t7 = 1;
+ const t0 = 0, t1 = 0.1, t2 = 0.2, t3 = 0.3, t4 = 0.4, t5 = 0.6, t6 = 0.7, t7 = 1;
const curve = [-1, 0, 1];
await oscNode.addAutomationEvent("frequency", "setValueAtTime", [0.2, t0]);
await oscNode.addAutomationEvent("frequency", "setValueAtTime", [0.3, t1]);
await oscNode.addAutomationEvent("frequency", "setValueAtTime", [0.4, t2]);
await oscNode.addAutomationEvent("frequency", "linearRampToValueAtTime", [1, t3]);
await oscNode.addAutomationEvent("frequency", "linearRampToValueAtTime", [0.15, t4]);
await oscNode.addAutomationEvent("frequency", "exponentialRampToValueAtTime", [0.75, t5]);
await oscNode.addAutomationEvent("frequency", "exponentialRampToValueAtTime", [0.5, t6]);
--- a/devtools/client/webaudioeditor/test/browser_audionode-actor-get-automation-data-01.js
+++ b/devtools/client/webaudioeditor/test/browser_audionode-actor-get-automation-data-01.js
@@ -8,17 +8,17 @@
add_task(async function() {
const { target, front } = await initBackend(SIMPLE_CONTEXT_URL);
const [_, [destNode, oscNode, gainNode]] = await Promise.all([
front.setup({ reload: true }),
get3(front, "create-node")
]);
- let t0 = 0, t1 = 0.1, t2 = 0.2, t3 = 0.3, t4 = 0.4, t5 = 0.6, t6 = 0.7, t7 = 1;
+ const t0 = 0, t1 = 0.1, t2 = 0.2, t3 = 0.3, t4 = 0.4, t5 = 0.6, t6 = 0.7, t7 = 1;
const curve = [-1, 0, 1];
await oscNode.addAutomationEvent("frequency", "setValueAtTime", [0.2, t0]);
await oscNode.addAutomationEvent("frequency", "setValueAtTime", [0.3, t1]);
await oscNode.addAutomationEvent("frequency", "setValueAtTime", [0.4, t2]);
await oscNode.addAutomationEvent("frequency", "linearRampToValueAtTime", [1, t3]);
await oscNode.addAutomationEvent("frequency", "linearRampToValueAtTime", [0.15, t4]);
await oscNode.addAutomationEvent("frequency", "exponentialRampToValueAtTime", [0.75, t5]);
await oscNode.addAutomationEvent("frequency", "exponentialRampToValueAtTime", [0.05, t6]);
--- a/devtools/client/webconsole/test/fixtures/stub-generators/head.js
+++ b/devtools/client/webconsole/test/fixtures/stub-generators/head.js
@@ -246,17 +246,19 @@ function formatStub(key, packet) {
);
const stringifiedMessage = JSON.stringify(prepared, null, 2);
return (
`stubPreparedMessages.set(\`${key}\`, new ConsoleMessage(${stringifiedMessage}));`);
}
function formatNetworkEventStub(key, packet) {
const cleanedPacket = getCleanedPacket(key, packet);
- const networkInfo = cleanedPacket.networkInfo ? cleanedPacket.networkInfo : cleanedPacket;
+ const networkInfo = cleanedPacket.networkInfo
+ ? cleanedPacket.networkInfo
+ : cleanedPacket;
const prepared = prepareMessage(
networkInfo,
{getNextId: () => "1"}
);
const stringifiedMessage = JSON.stringify(prepared, null, 2);
return `stubPreparedMessages.set("${key}", ` +
`new NetworkEventMessage(${stringifiedMessage}));`;
--- a/devtools/client/webconsole/test/fixtures/stubs/consoleApi.js
+++ b/devtools/client/webconsole/test/fixtures/stubs/consoleApi.js
@@ -6,18 +6,18 @@
/*
* THIS FILE IS AUTOGENERATED. DO NOT MODIFY BY HAND. RUN TESTS IN FIXTURES/ TO UPDATE.
*/
const { ConsoleMessage } =
require("devtools/client/webconsole/types");
-const stubPreparedMessages = new Map();
-const stubPackets = new Map();
+let stubPreparedMessages = new Map();
+let stubPackets = new Map();
stubPreparedMessages.set(`console.log('foobar', 'test')`, new ConsoleMessage({
"id": "1",
"allowRepeating": true,
"source": "console-api",
"timeStamp": 1502884924471,
"type": "log",
"helperType": null,
"level": "log",
--- a/devtools/client/webconsole/test/fixtures/stubs/cssMessage.js
+++ b/devtools/client/webconsole/test/fixtures/stubs/cssMessage.js
@@ -6,18 +6,18 @@
/*
* THIS FILE IS AUTOGENERATED. DO NOT MODIFY BY HAND. RUN TESTS IN FIXTURES/ TO UPDATE.
*/
const { ConsoleMessage } =
require("devtools/client/webconsole/types");
-const stubPreparedMessages = new Map();
-const stubPackets = new Map();
+let stubPreparedMessages = new Map();
+let stubPackets = new Map();
stubPreparedMessages.set(`Unknown property ‘such-unknown-property’. Declaration dropped.`, new ConsoleMessage({
"id": "1",
"allowRepeating": true,
"source": "css",
"timeStamp": 1479159920406,
"type": "log",
"helperType": null,
"level": "warn",
--- a/devtools/client/webconsole/test/fixtures/stubs/evaluationResult.js
+++ b/devtools/client/webconsole/test/fixtures/stubs/evaluationResult.js
@@ -6,18 +6,18 @@
/*
* THIS FILE IS AUTOGENERATED. DO NOT MODIFY BY HAND. RUN TESTS IN FIXTURES/ TO UPDATE.
*/
const { ConsoleMessage } =
require("devtools/client/webconsole/types");
-const stubPreparedMessages = new Map();
-const stubPackets = new Map();
+let stubPreparedMessages = new Map();
+let stubPackets = new Map();
stubPreparedMessages.set(`new Date(0)`, new ConsoleMessage({
"id": "1",
"allowRepeating": true,
"source": "javascript",
"timeStamp": 1479159921364,
"type": "result",
"helperType": null,
"level": "log",
--- a/devtools/client/webconsole/test/fixtures/stubs/networkEvent.js
+++ b/devtools/client/webconsole/test/fixtures/stubs/networkEvent.js
@@ -6,18 +6,18 @@
/*
* THIS FILE IS AUTOGENERATED. DO NOT MODIFY BY HAND. RUN TESTS IN FIXTURES/ TO UPDATE.
*/
const { NetworkEventMessage } =
require("devtools/client/webconsole/types");
-const stubPreparedMessages = new Map();
-const stubPackets = new Map();
+let stubPreparedMessages = new Map();
+let stubPackets = new Map();
stubPreparedMessages.set("GET request", new NetworkEventMessage({
"id": "1",
"actor": "server1.conn0.child1/netEvent30",
"level": "log",
"isXHR": false,
"request": {
"url": "http://example.com/browser/devtools/client/webconsole/test/fixtures/stub-generators/inexistent.html",
"method": "GET"
--- a/devtools/client/webconsole/test/fixtures/stubs/pageError.js
+++ b/devtools/client/webconsole/test/fixtures/stubs/pageError.js
@@ -6,18 +6,18 @@
/*
* THIS FILE IS AUTOGENERATED. DO NOT MODIFY BY HAND. RUN TESTS IN FIXTURES/ TO UPDATE.
*/
const { ConsoleMessage } =
require("devtools/client/webconsole/types");
-const stubPreparedMessages = new Map();
-const stubPackets = new Map();
+let stubPreparedMessages = new Map();
+let stubPackets = new Map();
stubPreparedMessages.set(`ReferenceError: asdf is not defined`, new ConsoleMessage({
"id": "1",
"allowRepeating": true,
"source": "javascript",
"timeStamp": 1476573167137,
"type": "log",
"helperType": null,
"level": "error",
--- a/devtools/client/webconsole/test/mochitest/browser_console_open_or_focus.js
+++ b/devtools/client/webconsole/test/mochitest/browser_console_open_or_focus.js
@@ -7,19 +7,19 @@
// the console window instead of toggling it open/close.
"use strict";
const TEST_MESSAGE = "testmessage";
const { Tools } = require("devtools/client/definitions");
add_task(async function() {
- let currWindow, hud, mainWindow;
+ let currWindow, hud;
- mainWindow = Services.wm.getMostRecentWindow(null);
+ const mainWindow = Services.wm.getMostRecentWindow(null);
await HUDService.openBrowserConsoleOrFocus();
hud = HUDService.getBrowserConsole();
ok(hud.ui.document.hasFocus(), "Focus in the document");
console.log(TEST_MESSAGE);
--- a/devtools/client/webconsole/test/mochitest/browser_jsterm_selfxss.js
+++ b/devtools/client/webconsole/test/mochitest/browser_jsterm_selfxss.js
@@ -78,17 +78,18 @@ async function testSelfXss(jsterm) {
}
is(WebConsoleUtils.usageCount, 4, "Usage count incremented");
WebConsoleUtils.usageCount = 0;
updateEditUIVisibility();
const oldVal = jsterm.getInputValue();
goDoCommand("cmd_paste");
- const notificationbox = jsterm.hud.document.getElementById("webconsole-notificationbox");
+ const notificationbox =
+ jsterm.hud.document.getElementById("webconsole-notificationbox");
const notification = notificationbox.querySelector(".notification");
is(notification.getAttribute("data-key"), "selfxss-notification",
"Self-xss notification shown");
is(oldVal, jsterm.getInputValue(), "Paste blocked by self-xss prevention");
// Allow pasting
jsterm.setInputValue("allow pasting");
const evt = document.createEvent("KeyboardEvent");
--- a/devtools/client/webconsole/test/mochitest/browser_webconsole_time_methods.js
+++ b/devtools/client/webconsole/test/mochitest/browser_webconsole_time_methods.js
@@ -30,17 +30,18 @@ add_task(async function() {
+ "ends the 'a' timer");
// Calling console.time('bTimer') in the current tab, opening a new tab
// and calling console.timeEnd('bTimer') in the new tab should not result in
// the bTimer in the initial tab being ended, but rather a warning message
// output to the console: Timer "bTimer" doesn't exist
const hud2 = await openNewTabAndConsole(TEST_URI2);
- const error1 = await waitFor(() => findMessage(hud2, "bTimer", ".message.timeEnd.warn"));
+ const error1 =
+ await waitFor(() => findMessage(hud2, "bTimer", ".message.timeEnd.warn"));
ok(error1, "Timers with the same name but in separate tabs do not contain "
+ "the same value");
// The next tests make sure that timers with the same name but in separate
// pages do not contain the same value.
await BrowserTestUtils.loadURI(gBrowser.selectedBrowser, TEST_URI3);
// The new console front-end does not display a message when timers are started,
@@ -57,12 +58,13 @@ add_task(async function() {
hud2.jsterm.clearOutput();
// Calling console.time('bTimer') on a page, then navigating to another page
// and calling console.timeEnd('bTimer') on the new console front-end should
// result on a warning message: 'Timer "bTimer" does not exist',
// as the timers in different pages are not related
await BrowserTestUtils.loadURI(gBrowser.selectedBrowser, TEST_URI4);
- const error2 = await waitFor(() => findMessage(hud2, "bTimer", ".message.timeEnd.warn"));
+ const error2 =
+ await waitFor(() => findMessage(hud2, "bTimer", ".message.timeEnd.warn"));
ok(error2, "Timers with the same name but in separate pages do not contain "
+ "the same value");
});
--- a/devtools/client/webconsole/test/mochitest/browser_webconsole_view_source.js
+++ b/devtools/client/webconsole/test/mochitest/browser_webconsole_view_source.js
@@ -13,17 +13,18 @@
const TEST_URI = "https://example.com/browser/devtools/client/webconsole/" +
"test/mochitest/" +
"test-mixedcontent-securityerrors.html";
add_task(async function() {
const hud = await openNewTabAndConsole(TEST_URI);
info("console opened");
- const msg = await waitFor(() => findMessage(hud, "Blocked loading mixed active content"));
+ const msg =
+ await waitFor(() => findMessage(hud, "Blocked loading mixed active content"));
ok(msg, "error message");
const locationNode = msg.querySelector(".message-location .frame-link-filename");
ok(locationNode, "location node");
const onTabOpen = BrowserTestUtils.waitForNewTab(gBrowser, null, true);
locationNode.click();
await onTabOpen;
--- a/devtools/client/webconsole/test/mochitest/head.js
+++ b/devtools/client/webconsole/test/mochitest/head.js
@@ -570,17 +570,18 @@ async function openMessageInNetmonitor(t
const message = await waitFor(() => findMessage(hud, urlInConsole));
const onNetmonitorSelected = toolbox.once("netmonitor-selected", (event, panel) => {
return panel;
});
const menuPopup = await openContextMenu(hud, message);
- const openInNetMenuItem = menuPopup.querySelector("#console-menu-open-in-network-panel");
+ const openInNetMenuItem =
+ menuPopup.querySelector("#console-menu-open-in-network-panel");
ok(openInNetMenuItem, "open in network panel item is enabled");
openInNetMenuItem.click();
const {panelWin} = await onNetmonitorSelected;
ok(true, "The netmonitor panel is selected when clicking on the network message");
const { store, windowRequire } = panelWin;
const nmActions = windowRequire("devtools/client/netmonitor/src/actions/index");
--- a/devtools/client/webconsole/webconsole-l10n.js
+++ b/devtools/client/webconsole/webconsole-l10n.js
@@ -17,17 +17,18 @@ const l10n = {
* @param integer [milliseconds]
* Optional, allows you to specify the timestamp in milliseconds since
* the UNIX epoch.
* @return string
* The timestamp formatted for display.
*/
timestampString: function(milliseconds) {
const d = new Date(milliseconds ? milliseconds : null);
- let hours = d.getHours(), minutes = d.getMinutes();
+ const hours = d.getHours();
+ const minutes = d.getMinutes();
const seconds = d.getSeconds();
milliseconds = d.getMilliseconds();
const parameters = [hours, minutes, seconds, milliseconds];
return l10n.getFormatStr("timestampFormat", parameters);
},
/**
* Retrieve a localized string.
--- a/devtools/client/webide/modules/project-list.js
+++ b/devtools/client/webide/modules/project-list.js
@@ -262,23 +262,20 @@ ProjectList.prototype = {
}, true);
}
return Promise.resolve();
},
updateCommands: function() {
const doc = this._doc;
- let newAppCmd;
- let packagedAppCmd;
- let hostedAppCmd;
- newAppCmd = doc.querySelector("#new-app");
- packagedAppCmd = doc.querySelector("#packaged-app");
- hostedAppCmd = doc.querySelector("#hosted-app");
+ const newAppCmd = doc.querySelector("#new-app");
+ const packagedAppCmd = doc.querySelector("#packaged-app");
+ const hostedAppCmd = doc.querySelector("#hosted-app");
if (!newAppCmd || !packagedAppCmd || !hostedAppCmd) {
return;
}
if (this._parentWindow.document.querySelector("window").classList.contains("busy")) {
newAppCmd.setAttribute("disabled", "true");
packagedAppCmd.setAttribute("disabled", "true");
--- a/devtools/client/webide/test/head.js
+++ b/devtools/client/webide/test/head.js
@@ -179,22 +179,19 @@ function getRuntimeWindow(win) {
function getProjectWindow(win) {
return win.document.querySelector("#project-listing-panel-details").contentWindow;
}
function connectToLocalRuntime(win) {
info("Loading local runtime.");
- let panelNode;
- let runtimePanel;
+ const runtimePanel = getRuntimeDocument(win);
- runtimePanel = getRuntimeDocument(win);
-
- panelNode = runtimePanel.querySelector("#runtime-panel");
+ const panelNode = runtimePanel.querySelector("#runtime-panel");
const items = panelNode.querySelectorAll(".runtime-panel-item-other");
is(items.length, 2, "Found 2 custom runtime buttons");
const updated = waitForUpdate(win, "runtime-global-actors");
items[1].click();
return updated;
}
--- a/devtools/server/actors/array-buffer.js
+++ b/devtools/server/actors/array-buffer.js
@@ -32,17 +32,18 @@ ArrayBufferActor.prototype = {
"type": "arrayBuffer",
"length": this.bufferLength,
"actor": this.actorID
};
},
onSlice({start, count}) {
const slice = new Uint8Array(this.buffer, start, count);
- let parts = [], offset = 0;
+ const parts = [];
+ let offset = 0;
const PortionSize = 0x6000; // keep it divisible by 3 for btoa() and join()
while (offset + PortionSize < count) {
parts.push(btoa(
String.fromCharCode.apply(null, slice.subarray(offset, offset + PortionSize))));
offset += PortionSize;
}
parts.push(btoa(String.fromCharCode.apply(null, slice.subarray(offset, count))));
return {
--- a/devtools/server/actors/call-watcher.js
+++ b/devtools/server/actors/call-watcher.js
@@ -427,32 +427,34 @@ exports.CallWatcherActor = protocol.Acto
if (!originalGetter) {
return undefined;
}
const result = Cu.waiveXrays(originalGetter.apply(this, args));
if (self._recording) {
const type = CallWatcherFront.GETTER_FUNCTION;
const stack = getStack(name);
- const timestamp = self.tabActor.window.performance.now() - self._timestampEpoch;
+ const timestamp =
+ self.tabActor.window.performance.now() - self._timestampEpoch;
subcallback(unwrappedWindow, global, this, type, name, stack, timestamp,
args, result);
}
return result;
},
set: function(...args) {
if (!originalSetter) {
return;
}
originalSetter.apply(this, args);
if (self._recording) {
const type = CallWatcherFront.SETTER_FUNCTION;
const stack = getStack(name);
- const timestamp = self.tabActor.window.performance.now() - self._timestampEpoch;
+ const timestamp =
+ self.tabActor.window.performance.now() - self._timestampEpoch;
subcallback(unwrappedWindow, global, this, type, name, stack, timestamp,
args, undefined);
}
},
configurable: descriptor.configurable,
enumerable: descriptor.enumerable
});
}
--- a/devtools/server/actors/highlighters/accessible.js
+++ b/devtools/server/actors/highlighters/accessible.js
@@ -231,17 +231,18 @@ class AccessibleHighlighter extends Auto
const bounds = this._bounds;
if (!bounds) {
this._hideAccessibleBounds();
return false;
}
const boundsEl = this.getElement("bounds");
const { left, right, top, bottom } = bounds;
- const path = `M${left},${top} L${right},${top} L${right},${bottom} L${left},${bottom}`;
+ const path =
+ `M${left},${top} L${right},${top} L${right},${bottom} L${left},${bottom}`;
boundsEl.setAttribute("d", path);
// Un-zoom the root wrapper if the page was zoomed.
const rootId = this.ID_CLASS_PREFIX + "elements";
this.markup.scaleRootElement(this.currentNode, rootId);
return true;
}
--- a/devtools/server/actors/highlighters/shapes.js
+++ b/devtools/server/actors/highlighters/shapes.js
@@ -1128,24 +1128,25 @@ class ShapesHighlighter extends AutoRefr
if (point === "center") {
const { unitX, unitY, valueX, valueY, ratioX, ratioY, x, y} = this[_dragging];
const deltaX = (pageX - x) * ratioX;
const deltaY = (pageY - y) * ratioY;
const newCx = `${round(valueX + deltaX, unitX)}${unitX}`;
const newCy = `${round(valueY + deltaY, unitY)}${unitY}`;
// if not defined by the user, geometryBox will be an empty string; trim() cleans up
- const circleDef = `circle(${radius} at ${newCx} ${newCy}) ${this.geometryBox}`.trim();
+ const circleDef =
+ `circle(${radius} at ${newCx} ${newCy}) ${this.geometryBox}`.trim();
this.emit("highlighter-event", { type: "shape-change", value: circleDef });
} else if (point === "radius") {
const { value, unit, origRadius, ratio } = this[_dragging];
// convert center point to px, then get distance between center and mouse.
- const { x: pageCx, y: pageCy } = this.convertPercentToPageCoords(this.coordinates.cx,
- this.coordinates.cy);
+ const { x: pageCx, y: pageCy } =
+ this.convertPercentToPageCoords(this.coordinates.cx, this.coordinates.cy);
const newRadiusPx = getDistance(pageCx, pageCy, pageX, pageY);
const delta = (newRadiusPx - origRadius) * ratio;
const newRadius = `${round(value + delta, unit)}${unit}`;
const circleDef = `circle(${newRadius} at ${cx} ${cy}) ${this.geometryBox}`.trim();
this.emit("highlighter-event", { type: "shape-change", value: circleDef });
@@ -1526,17 +1527,18 @@ class ShapesHighlighter extends AutoRefr
/**
* Get which transformation should be applied based on the mouse position.
* @param {Number} pageX the x coordinate of the mouse.
* @param {Number} pageY the y coordinate of the mouse.
* @returns {String} a string describing the transformation that should be applied
* to the shape.
*/
getTransformPointAt(pageX, pageY) {
- const { nw, ne, sw, se, n, w, s, e, rotatePoint, center } = this.transformedBoundingBox;
+ const { nw, ne, sw, se, n, w, s, e, rotatePoint, center } =
+ this.transformedBoundingBox;
const { width, height } = this.currentDimensions;
const zoom = getCurrentZoom(this.win);
const clickRadiusX = BASE_MARKER_SIZE / zoom * 100 / width;
const clickRadiusY = BASE_MARKER_SIZE / zoom * 100 / height;
const points = [
{ pointName: "translate", x: center[0], y: center[1] },
{ pointName: "scale-se", x: se[0], y: se[1] },
@@ -1604,17 +1606,19 @@ class ShapesHighlighter extends AutoRefr
*/
getPolygonClickedLine(pageX, pageY) {
const { coordinates } = this;
const { width } = this.currentDimensions;
const clickWidth = LINE_CLICK_WIDTH * 100 / width;
for (let i = 0; i < coordinates.length; i++) {
const [x1, y1] = coordinates[i];
- const [x2, y2] = (i === coordinates.length - 1) ? coordinates[0] : coordinates[i + 1];
+ const [x2, y2] = (i === coordinates.length - 1)
+ ? coordinates[0]
+ : coordinates[i + 1];
// Get the distance between clicked point and line drawn between points 1 and 2
// to check if the click was on the line between those two points.
const distance = distanceToLine(x1, y1, x2, y2, pageX, pageY);
if (distance <= clickWidth &&
Math.min(x1, x2) - clickWidth <= pageX &&
pageX <= Math.max(x1, x2) + clickWidth &&
Math.min(y1, y2) - clickWidth <= pageY &&
pageY <= Math.max(y1, y2) + clickWidth) {
@@ -2286,17 +2290,18 @@ class ShapesHighlighter extends AutoRefr
/**
* Update the SVGs for transform mode to fit the new shape.
* @param {Number} width the width of the element quads
* @param {Number} height the height of the element quads
* @param {Number} zoom the zoom level of the window
*/
_updateTransformMode(width, height, zoom) {
- const { nw, ne, sw, se, n, w, s, e, rotatePoint, center } = this.transformedBoundingBox;
+ const { nw, ne, sw, se, n, w, s, e, rotatePoint, center } =
+ this.transformedBoundingBox;
const boundingBox = this.getElement("bounding-box");
const path = `M${nw.join(" ")} L${ne.join(" ")} L${se.join(" ")} L${sw.join(" ")} Z`;
boundingBox.setAttribute("d", path);
boundingBox.removeAttribute("hidden");
const markerPoints = [center, nw, ne, se, sw];
if (this.shapeType === "polygon" || this.shapeType === "ellipse") {
markerPoints.push(n, s, w, e);
--- a/devtools/server/actors/highlighters/utils/canvas.js
+++ b/devtools/server/actors/highlighters/utils/canvas.js
@@ -289,17 +289,18 @@ function getCurrentMatrix(element, windo
const paddingRight = parseFloat(computedStyle.paddingRight);
const paddingBottom = parseFloat(computedStyle.paddingBottom);
const paddingLeft = parseFloat(computedStyle.paddingLeft);
const borderTop = parseFloat(computedStyle.borderTopWidth);
const borderRight = parseFloat(computedStyle.borderRightWidth);
const borderBottom = parseFloat(computedStyle.borderBottomWidth);
const borderLeft = parseFloat(computedStyle.borderLeftWidth);
- const nodeMatrix = getNodeTransformationMatrix(element, window.document.documentElement);
+ const nodeMatrix =
+ getNodeTransformationMatrix(element, window.document.documentElement);
let currentMatrix = identity();
let hasNodeTransformations = false;
// Scale based on the device pixel ratio.
currentMatrix = multiply(currentMatrix, scale(window.devicePixelRatio));
// Apply the current node's transformation matrix, relative to the inspected window's
--- a/devtools/server/actors/inspector/walker.js
+++ b/devtools/server/actors/inspector/walker.js
@@ -422,18 +422,19 @@ var WalkerActor = protocol.ActorClassWit
return this._ref(elt);
},
parentNode: function(node) {
let parent;
try {
// If the node is the child of a shadow host, we can not use an anonymous walker to
// get the shadow host parent.
- const walker = node.isDirectShadowHostChild ? this.getNonAnonymousWalker(node.rawNode)
- : this.getDocumentWalker(node.rawNode);
+ const walker = node.isDirectShadowHostChild
+ ? this.getNonAnonymousWalker(node.rawNode)
+ : this.getDocumentWalker(node.rawNode);
parent = walker.parentNode();
} catch (e) {
// When getting the parent node for a child of a non-slotted shadow host child,
// walker.parentNode() will throw if the walker is anonymous, because non-slotted
// shadow host children are not accessible anywhere in the anonymous tree.
const walker = this.getNonAnonymousWalker(node.rawNode);
parent = walker.parentNode();
}
--- a/devtools/server/actors/stylesheets.js
+++ b/devtools/server/actors/stylesheets.js
@@ -769,17 +769,18 @@ var StyleSheetsActor = protocol.ActorCla
*/
_addStyleSheets: function(win) {
return (async function() {
const doc = win.document;
// We have to set this flag in order to get the
// StyleSheetApplicableStateChanged events. See Document.webidl.
doc.styleSheetChangeEventsEnabled = true;
- const isChrome = Services.scriptSecurityManager.isSystemPrincipal(doc.nodePrincipal);
+ const isChrome =
+ Services.scriptSecurityManager.isSystemPrincipal(doc.nodePrincipal);
const styleSheets =
isChrome ? InspectorUtils.getAllStyleSheets(doc) : doc.styleSheets;
let actors = [];
for (let i = 0; i < styleSheets.length; i++) {
const sheet = styleSheets[i];
if (!this._shouldListSheet(sheet)) {
continue;
}
--- a/devtools/server/main.js
+++ b/devtools/server/main.js
@@ -745,22 +745,23 @@ var DebuggerServer = {
}
}
if (onDestroy) {
onDestroy(mm);
}
}
- const onMessageManagerClose = DevToolsUtils.makeInfallible((subject, topic, data) => {
- if (subject == mm) {
- onClose();
- connection.send({ from: actor.actor, type: "tabDetached" });
- }
- });
+ const onMessageManagerClose =
+ DevToolsUtils.makeInfallible((subject, topic, data) => {
+ if (subject == mm) {
+ onClose();
+ connection.send({ from: actor.actor, type: "tabDetached" });
+ }
+ });
Services.obs.addObserver(onMessageManagerClose,
"message-manager-close");
EventEmitter.on(connection, "closed", onClose);
});
},
/**
--- a/devtools/server/performance/profiler.js
+++ b/devtools/server/performance/profiler.js
@@ -206,17 +206,17 @@ const ProfilerManager = (function() {
/**
* Returns an object with the values of the current status of the
* circular buffer in the profiler, returning `position`, `totalSize`,
* and the current `generation` of the buffer.
*
* @return {object}
*/
getBufferInfo: function() {
- let position = {}, totalSize = {}, generation = {};
+ const position = {}, totalSize = {}, generation = {};
Services.profiler.GetBufferInfo(position, totalSize, generation);
return {
position: position.value,
totalSize: totalSize.value,
generation: generation.value
};
},
--- a/devtools/server/performance/recorder.js
+++ b/devtools/server/performance/recorder.js
@@ -301,19 +301,19 @@ PerformanceRecorder.prototype = {
* @param boolean options.sampleFrequency
* @param boolean options.console
* @param string options.label
* @param boolean options.realtimeMarkers
* @return object
* A promise that is resolved once recording has started.
*/
async startRecording(options) {
- let profilerStart, timelineStart, memoryStart;
+ let timelineStart, memoryStart;
- profilerStart = (async function() {
+ const profilerStart = (async function() {
const data = await this._profiler.isActive();
if (data.isActive) {
return data;
}
const startData = await this._profiler.start(
mapRecordingOptions("profiler", options)
);
--- a/devtools/server/tests/browser/browser_actor_error.js
+++ b/devtools/server/tests/browser/browser_actor_error.js
@@ -4,28 +4,27 @@
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Test that clients can catch errors in old style actors.
*/
-const ACTORS_URL = "chrome://mochitests/content/browser/devtools/server/tests/browser/error-actor.js";
+const ACTORS_URL =
+ "chrome://mochitests/content/browser/devtools/server/tests/browser/error-actor.js";
async function test() {
- let gClient;
-
DebuggerServer.init();
DebuggerServer.registerAllActors();
DebuggerServer.addActors(ACTORS_URL);
const transport = DebuggerServer.connectPipe();
- gClient = new DebuggerClient(transport);
+ const gClient = new DebuggerClient(transport);
await gClient.connect();
const { errorActor } = await gClient.listTabs();
ok(errorActor, "Found the error actor.");
await Assert.rejects(gClient.request({ to: errorActor, type: "error" }),
err => err.error == "unknownError" &&
/error occurred while processing 'error/.test(err.message),
--- a/devtools/server/tests/browser/browser_layout_getGrids.js
+++ b/devtools/server/tests/browser/browser_layout_getGrids.js
@@ -103,17 +103,18 @@ const GRID_FRAGMENT_DATA = {
state: "static",
type: "explicit"
}
]
}
};
add_task(async function() {
- const { client, walker, layout } = await initLayoutFrontForUrl(MAIN_DOMAIN + "grid.html");
+ const { client, walker, layout } =
+ await initLayoutFrontForUrl(MAIN_DOMAIN + "grid.html");
const grids = await layout.getGrids(walker.rootNode);
const grid = grids[0];
const { gridFragments } = grid;
is(grids.length, 1, "One grid was returned.");
is(gridFragments.length, 1, "One grid fragment was returned.");
ok(Array.isArray(gridFragments), "An array of grid fragments was returned.");
Assert.deepEqual(gridFragments[0], GRID_FRAGMENT_DATA,
--- a/devtools/server/tests/mochitest/inspector_getImageData.html
+++ b/devtools/server/tests/mochitest/inspector_getImageData.html
@@ -5,17 +5,17 @@
<img class="big-horizontal" src="large-image.jpg" style="width:500px;">
<canvas class="big-vertical" style="width:500px;"></canvas>
<img class="small" src="small-image.gif">
<img class="data" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAJklEQVRIie3NMREAAAgAoe9fWls4eAzMVM0xoVAoFAqFQqFQ+C9chp4NHvu+4Q4AAAAASUVORK5CYII=">
<script>
"use strict";
window.onload = () => {
- let canvas = document.querySelector("canvas"), ctx = canvas.getContext("2d");
+ const canvas = document.querySelector("canvas"), ctx = canvas.getContext("2d");
canvas.width = 1000;
canvas.height = 2000;
ctx.fillStyle = "red";
ctx.fillRect(0, 0, 1000, 2000);
window.opener.postMessage("ready", "*");
};
</script>
--- a/devtools/server/tests/unit/test_nesting-02.js
+++ b/devtools/server/tests/unit/test_nesting-02.js
@@ -36,18 +36,16 @@ function test_nesting() {
// The following things should happen (in order):
// 1. In the new event loop (created by unsafeSynchronize)
// 2. Resolve the promise (shouldn't exit any event loops)
// 3. Exit the event loop (should also then exit unsafeSynchronize's event loop)
// 4. Be after the unsafeSynchronize call
let currentStep = 0;
executeSoon(function() {
- let eventLoop;
-
executeSoon(function() {
// Should be at step 2
Assert.equal(++currentStep, 2);
// Before resolving, should have the unsafeSynchronize event loop and the
// one just created.
Assert.equal(thread._nestedEventLoops.size, 2);
executeSoon(function() {
@@ -66,17 +64,17 @@ function test_nesting() {
// to unsafeSynchronize
Assert.equal(thread._nestedEventLoops.size, 2);
});
// Should be at step 1
Assert.equal(++currentStep, 1);
// Should have only the unsafeSynchronize event loop
Assert.equal(thread._nestedEventLoops.size, 1);
- eventLoop = thread._nestedEventLoops.push();
+ const eventLoop = thread._nestedEventLoops.push();
eventLoop.enter();
});
Assert.equal(thread.unsafeSynchronize(p), true);
// Should be on the fourth step
Assert.equal(++currentStep, 4);
// There shouldn't be any nested event loops anymore
--- a/devtools/server/tests/unit/test_objectgrips-17.js
+++ b/devtools/server/tests/unit/test_objectgrips-17.js
@@ -115,17 +115,18 @@ function test() {
const inheritsProxyClient = gThreadClient.pauseGrip(inheritsProxyGrip);
const inheritsProxyResponse = await inheritsProxyClient.getPrototypeAndProperties();
check_properties(inheritsProxyResponse.ownProperties, false, false);
check_prototype(inheritsProxyResponse.prototype, false, false);
// The prototype chain was not iterated if the object was inaccessible, so now check
// another object which inherits from the proxy, but was created in the debuggee.
const inheritsProxy2Client = gThreadClient.pauseGrip(inheritsProxy2Grip);
- const inheritsProxy2Response = await inheritsProxy2Client.getPrototypeAndProperties();
+ const inheritsProxy2Response =
+ await inheritsProxy2Client.getPrototypeAndProperties();
check_properties(inheritsProxy2Response.ownProperties, false, true);
check_prototype(inheritsProxy2Response.prototype, false, true);
// Check that none of the above ran proxy traps.
strictEqual(gGlobal.trapDidRun, false, "No proxy trap did run.");
// Resume the debugger and finish the current test.
await gThreadClient.resume();
--- a/devtools/shared/css/color.js
+++ b/devtools/shared/css/color.js
@@ -599,27 +599,26 @@ function _hslValue(m1, m2, h) {
return m1 + (m2 - m1) * (2.0 / 3.0 - h) * 6.0;
}
return m1;
}
// Translated from nsColor.cpp. All three values are expected to be
// in the range 0-1.
function hslToRGB([h, s, l]) {
- let r, g, b;
- let m1, m2;
+ let m2;
if (l <= 0.5) {
m2 = l * (s + 1);
} else {
m2 = l + s - l * s;
}
- m1 = l * 2 - m2;
- r = Math.round(255 * _hslValue(m1, m2, h + 1.0 / 3.0));
- g = Math.round(255 * _hslValue(m1, m2, h));
- b = Math.round(255 * _hslValue(m1, m2, h - 1.0 / 3.0));
+ const m1 = l * 2 - m2;
+ const r = Math.round(255 * _hslValue(m1, m2, h + 1.0 / 3.0));
+ const g = Math.round(255 * _hslValue(m1, m2, h));
+ const b = Math.round(255 * _hslValue(m1, m2, h - 1.0 / 3.0));
return [r, g, b];
}
/**
* A helper function to convert a hex string like "F0C" or "F0C8" to a color.
*
* @param {String} name the color string
* @return {Object} an object of the form {r, g, b, a}; or null if the
--- a/devtools/shared/css/lexer.js
+++ b/devtools/shared/css/lexer.js
@@ -1122,27 +1122,25 @@ Scanner.prototype = {
* and will also skip over rather than return whitespace and comment
* tokens, depending on the value of |aSkip|.
*
* Returns true if it successfully consumed a token, false if EOF has
* been reached. Will always advance the current read position by at
* least one character unless called when already at EOF.
*/
Next: function(aToken, aSkip) {
- let ch;
-
// do this here so we don't have to do it in dozens of other places
aToken.mIdent = [];
aToken.mType = eCSSToken_Symbol;
this.mTokenOffset = this.mOffset;
this.mTokenLineOffset = this.mLineOffset;
this.mTokenLineNumber = this.mLineNumber;
- ch = this.Peek();
+ const ch = this.Peek();
if (IsWhitespace(ch)) {
this.SkipWhitespace();
aToken.mType = eCSSToken_Whitespace;
return true;
}
if (ch == SOLIDUS && // !IsSVGMode() &&
this.Peek(1) == ASTERISK) {
this.SkipComment();
--- a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-04.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-04.js
@@ -10,32 +10,32 @@ function run_test() {
const countBreakdown = { by: "count", count: true, bytes: true };
const BREAKDOWN = {
by: "allocationStack",
then: countBreakdown,
noStack: countBreakdown,
};
- let stack1, stack2, stack3, stack4, stack5;
+ let stack1, stack2, stack3, stack4;
(function a() {
(function b() {
(function c() {
stack1 = saveStack(3);
}());
(function d() {
stack2 = saveStack(3);
stack3 = saveStack(3);
}());
stack4 = saveStack(2);
}());
}());
- stack5 = saveStack(1);
+ const stack5 = saveStack(1);
const REPORT = new Map([
[stack1, { bytes: 10, count: 1 }],
[stack2, { bytes: 20, count: 2 }],
[stack3, { bytes: 30, count: 3 }],
[stack4, { bytes: 40, count: 4 }],
[stack5, { bytes: 50, count: 5 }],
["noStack", { bytes: 60, count: 6 }],
--- a/devtools/shared/heapsnapshot/tests/unit/test_census_filtering_02.js
+++ b/devtools/shared/heapsnapshot/tests/unit/test_census_filtering_02.js
@@ -8,32 +8,32 @@ function run_test() {
const countBreakdown = { by: "count", count: true, bytes: true };
const BREAKDOWN = {
by: "allocationStack",
then: countBreakdown,
noStack: countBreakdown,
};
- let stack1, stack2, stack3, stack4, stack5;
+ let stack1, stack2, stack3, stack4;
(function foo() {
(function bar() {
(function baz() {
stack1 = saveStack(3);
}());
(function quux() {
stack2 = saveStack(3);
stack3 = saveStack(3);
}());
}());
stack4 = saveStack(2);
}());
- stack5 = saveStack(1);
+ const stack5 = saveStack(1);
const REPORT = new Map([
[stack1, { bytes: 10, count: 1 }],
[stack2, { bytes: 20, count: 2 }],
[stack3, { bytes: 30, count: 3 }],
[stack4, { bytes: 40, count: 4 }],
[stack5, { bytes: 50, count: 5 }],
["noStack", { bytes: 60, count: 6 }],
--- a/devtools/shared/security/prompt.js
+++ b/devtools/shared/security/prompt.js
@@ -115,19 +115,21 @@ Client.defaultSendOOB = ({ authResult, o
* the different |allowConnection| methods in ./auth.js.
* @return An AuthenticationResult value.
* A promise that will be resolved to the above is also allowed.
*/
Server.defaultAllowConnection = ({ client, server }) => {
const title = L10N.getStr("remoteIncomingPromptTitle");
const header = L10N.getStr("remoteIncomingPromptHeader");
const clientEndpoint = `${client.host}:${client.port}`;
- const clientMsg = L10N.getFormatStr("remoteIncomingPromptClientEndpoint", clientEndpoint);
+ const clientMsg =
+ L10N.getFormatStr("remoteIncomingPromptClientEndpoint", clientEndpoint);
const serverEndpoint = `${server.host}:${server.port}`;
- const serverMsg = L10N.getFormatStr("remoteIncomingPromptServerEndpoint", serverEndpoint);
+ const serverMsg =
+ L10N.getFormatStr("remoteIncomingPromptServerEndpoint", serverEndpoint);
const footer = L10N.getStr("remoteIncomingPromptFooter");
const msg = `${header}\n\n${clientMsg}\n${serverMsg}\n\n${footer}`;
const disableButton = L10N.getStr("remoteIncomingPromptDisable");
const prompt = Services.prompt;
const flags = prompt.BUTTON_POS_0 * prompt.BUTTON_TITLE_OK +
prompt.BUTTON_POS_1 * prompt.BUTTON_TITLE_CANCEL +
prompt.BUTTON_POS_2 * prompt.BUTTON_TITLE_IS_STRING +
prompt.BUTTON_POS_1_DEFAULT;
--- a/devtools/shared/system.js
+++ b/devtools/shared/system.js
@@ -49,25 +49,24 @@ async function getSystemInfo() {
const win = Services.wm.getMostRecentWindow(DebuggerServer.chromeWindowType);
const [processor, compiler] = appInfo.XPCOMABI.split("-");
let dpi,
useragent,
width,
height,
physicalWidth,
physicalHeight,
- os,
brandName;
const appid = appInfo.ID;
const apptype = APP_MAP[appid];
const geckoVersion = appInfo.platformVersion;
const hardware = "unknown";
let version = "unknown";
- os = appInfo.OS;
+ const os = appInfo.OS;
version = appInfo.version;
const bundle = Services.strings.createBundle("chrome://branding/locale/brand.properties");
if (bundle) {
brandName = bundle.GetStringFromName("brandFullName");
} else {
brandName = null;
}
--- a/devtools/shared/tests/browser/browser_l10n_localizeMarkup.js
+++ b/devtools/shared/tests/browser/browser_l10n_localizeMarkup.js
@@ -4,18 +4,20 @@
"use strict";
// Tests that the markup localization works properly.
const { localizeMarkup, LocalizationHelper } = require("devtools/shared/l10n");
add_task(async function() {
info("Check that the strings used for this test are still valid");
- const STARTUP_L10N = new LocalizationHelper("devtools/client/locales/startup.properties");
- const TOOLBOX_L10N = new LocalizationHelper("devtools/client/locales/toolbox.properties");
+ const STARTUP_L10N =
+ new LocalizationHelper("devtools/client/locales/startup.properties");
+ const TOOLBOX_L10N =
+ new LocalizationHelper("devtools/client/locales/toolbox.properties");
const str1 = STARTUP_L10N.getStr("inspector.label");
const str2 = STARTUP_L10N.getStr("inspector.accesskey");
const str3 = TOOLBOX_L10N.getStr("toolbox.defaultTitle");
ok(str1 && str2 && str3, "If this failed, strings should be updated in the test");
info("Create the test markup");
const div = document.createElement("div");
div.setAttribute("data-localization-bundle",
--- a/devtools/shared/tests/unit/test_eventemitter_static.js
+++ b/devtools/shared/tests/unit/test_eventemitter_static.js
@@ -56,17 +56,17 @@ const TESTS = {
on(target, "message", () => fail("no event is expected"));
on(target, "done", () => pass("event is emitted"));
emit(target, "foo");
emit(target, "done");
},
testAllArgumentsArePassed() {
- let foo = { name: "foo" }, bar = "bar";
+ const foo = { name: "foo" }, bar = "bar";
const target = { name: "target" };
on(target, "message", (a, b) => {
equal(a, foo, "first argument passed");
equal(b, bar, "second argument passed");
});
emit(target, "message", foo, bar);
@@ -158,18 +158,18 @@ const TESTS = {
emit(target, "message");
emit(target, "bar");
deepEqual([], actual, "all listeners events were removed");
},
testFalsyArgumentsAreFine() {
- let type, listener, actual = [];
- const target = { name: "target" };
+ let type, listener;
+ const target = { name: "target" }, actual = [];
on(target, "bar", () => actual.push(0));
off(target, "bar", listener);
emit(target, "bar");
deepEqual([ 0 ], actual, "3rd bad arg will keep listener");
off(target, type);
emit(target, "bar");
--- a/devtools/startup/aboutdevtools/test/browser_aboutdevtools_closes_page.js
+++ b/devtools/startup/aboutdevtools/test/browser_aboutdevtools_closes_page.js
@@ -10,15 +10,16 @@ add_task(async function() {
pushPref("devtools.enabled", false);
const {doc, win} = await openAboutDevTools();
info("Check that the close button is available on the page");
const closeButton = doc.getElementById("close");
ok(closeButton, "close button is displayed");
- const onWindowUnload = new Promise(r => win.addEventListener("unload", r, {once: true}));
+ const onWindowUnload =
+ new Promise(r => win.addEventListener("unload", r, {once: true}));
info("Click on the install button to enable DevTools.");
EventUtils.synthesizeMouseAtCenter(closeButton, {}, win);
info("Wait for the about:devtools tab to be closed");
await onWindowUnload;
});