Bug 1454696 - Fix leftover issues for prefer-const;r=yulia

MozReview-Commit-ID: JwOXoqw2mks

--HG--
extra : rebase_source : a3f07665a42c2779a85b7901a07206266a9d1616
extra : source : ae946f375e0d0f4f0f0fc859c54040fef42cbc2c
This commit is contained in:
Julian Descottes 2018-06-01 12:19:35 +02:00
Родитель 640fe52298
Коммит 7fdc2c153f
96 изменённых файлов: 238 добавлений и 174 удалений

Просмотреть файл

@ -133,7 +133,8 @@ class WorkersPanel extends Component {
const isServiceWorkerDisabled = !Services.prefs
.getBoolPref("dom.serviceWorkers.enabled");
const isDisabled = isWindowPrivate || isPrivateBrowsingMode || isServiceWorkerDisabled;
const isDisabled =
isWindowPrivate || isPrivateBrowsingMode || isServiceWorkerDisabled;
if (!isDisabled) {
return "";
}

Просмотреть файл

@ -72,7 +72,8 @@ add_task(async function testTemporaryWebExtension() {
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;

Просмотреть файл

@ -66,7 +66,8 @@ window.Application = {
*/
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.

Просмотреть файл

@ -32,7 +32,8 @@ async function testEditing(inspector, boxmodel, testActor) {
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);

Просмотреть файл

@ -17,7 +17,8 @@ add_task(async function() {
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");

Просмотреть файл

@ -178,7 +178,8 @@ class FontInspector {
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 [];
}

Просмотреть файл

@ -1065,7 +1065,8 @@ Inspector.prototype = {
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");
}

Просмотреть файл

@ -648,7 +648,7 @@ MarkupView.prototype = {
}
const done = this.inspector.updating("markup-view");
let onShowBoxModel, onShow;
let onShowBoxModel;
// Highlight the element briefly if needed.
if (this._shouldNewSelectionBeHighlighted()) {
@ -656,7 +656,7 @@ MarkupView.prototype = {
}
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");

Просмотреть файл

@ -84,8 +84,8 @@ const TEST_DATA = [
];
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);

Просмотреть файл

@ -115,7 +115,9 @@ async function testCompletion([key, completion, open, selected],
// 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);

Просмотреть файл

@ -95,7 +95,9 @@ async function testCompletion([key, modifiers, completion, open, selected, chang
// 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);

Просмотреть файл

@ -81,7 +81,9 @@ async function testCompletion([key, completion, open, isSelected], editor, view)
// 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);

Просмотреть файл

@ -102,7 +102,9 @@ async function testCompletion([key, modifiers, completion, open, selected, chang
// 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);

Просмотреть файл

@ -25,7 +25,8 @@ add_task(async function() {
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);

Просмотреть файл

@ -140,7 +140,9 @@ async function testCompletion([key, modifiers, completion, open, selected, chang
// 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));

Просмотреть файл

@ -30,7 +30,8 @@ add_task(async function() {
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,

Просмотреть файл

@ -73,9 +73,10 @@ ClassListPreviewerModel.prototype = {
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);
}

Просмотреть файл

@ -27,7 +27,8 @@ 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.

Просмотреть файл

@ -9,8 +9,9 @@ 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);

Просмотреть файл

@ -47,7 +47,7 @@ async function isUpdatedAfterScroll(highlighterFront, inspector, testActor) {
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);

Просмотреть файл

@ -50,6 +50,7 @@ add_task(async function() {
});
async function getElementsNodeStyle(testActor) {
const value = await testActor.getHighlighterNodeAttribute("box-model-elements", "style");
const value =
await testActor.getHighlighterNodeAttribute("box-model-elements", "style");
return value;
}

Просмотреть файл

@ -12,16 +12,16 @@ 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 */
@ -31,7 +31,7 @@ add_task(async function() {
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");

Просмотреть файл

@ -27,7 +27,9 @@ const { getDisplayedRequests } = require("../selectors/index");
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,

Просмотреть файл

@ -40,7 +40,9 @@ class RequestListColumnSetCookies extends Component {
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",

Просмотреть файл

@ -64,10 +64,10 @@ function Header(id, headers) {
}
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);

Просмотреть файл

@ -481,7 +481,8 @@ class FirefoxDataProvider {
// 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);

Просмотреть файл

@ -107,7 +107,8 @@ class WaterfallBackground {
return;
}
const delta = Math.floor((timestamp - state.firstRequestStartedMillis) * state.scale);
const delta =
Math.floor((timestamp - state.firstRequestStartedMillis) * state.scale);
drawPixelAt(delta, color);
}

Просмотреть файл

@ -44,7 +44,8 @@ add_task(async function() {
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.");
}
});

Просмотреть файл

@ -67,10 +67,11 @@ add_task(async function() {
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));

Просмотреть файл

@ -69,7 +69,8 @@ add_task(async function() {
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");
});
}

Просмотреть файл

@ -256,7 +256,8 @@ var PerformanceController = {
if (!hasActor) {
return true;
}
const actorCanCheck = await gTarget.actorHasMethod("performance", "canCurrentlyRecord");
const actorCanCheck =
await gTarget.actorHasMethod("performance", "canCurrentlyRecord");
if (!actorCanCheck) {
return true;
}

Просмотреть файл

@ -225,7 +225,8 @@ var PerformanceView = {
// 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})`;

Просмотреть файл

@ -27,7 +27,8 @@ exports.once = function(target, eventName, options = {}) {
* 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 {

Просмотреть файл

@ -45,7 +45,8 @@ exports.removeTab = function(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;

Просмотреть файл

@ -63,7 +63,8 @@ var JsCallTreeView = extend(DetailsSubview, {
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,
@ -137,8 +138,8 @@ var JsCallTreeView = extend(DetailsSubview, {
_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

Просмотреть файл

@ -63,7 +63,8 @@ addRDMTask(TEST_URL, async function({ ui }) {
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");
});
@ -103,7 +104,8 @@ addRDMTask(TEST_URL, async function({ ui }) {
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");
@ -167,7 +169,8 @@ 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");

Просмотреть файл

@ -100,11 +100,13 @@ addRDMTask(TEST_URL, async function({ ui }) {
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);

Просмотреть файл

@ -34,7 +34,7 @@ addRDMTask(TEST_URL, async function({ ui, manager }) {
});
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;

Просмотреть файл

@ -394,7 +394,8 @@ function addDeviceInModal(ui, device) {
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");

Просмотреть файл

@ -1083,8 +1083,9 @@ var Scratchpad = {
* @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;

Просмотреть файл

@ -14,7 +14,7 @@ function test() {
}
function testThrowOutput() {
let scratchpad = gScratchpadWindow.Scratchpad, tests = [];
const scratchpad = gScratchpadWindow.Scratchpad, tests = [];
const falsyValues = ["false", "0", "-0", "null", "undefined", "Infinity",
"-Infinity", "NaN"];

Просмотреть файл

@ -33,7 +33,7 @@
<script type="text/javascript">
"use strict";
let canvas = [], gl = [];
const canvas = [], gl = [];
const program = [];
const squareVerticesPositionBuffer = [];
const vertexPositionAttribute = [];

Просмотреть файл

@ -264,7 +264,9 @@ function hasAttribute(attributes, attributeName) {
* @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});

Просмотреть файл

@ -336,8 +336,8 @@ OutputParser.prototype = {
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);

Просмотреть файл

@ -93,7 +93,7 @@ add_task(async function() {
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;

Просмотреть файл

@ -35,7 +35,7 @@ add_task(async function() {
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.");

Просмотреть файл

@ -30,7 +30,7 @@ add_task(async function() {
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});

Просмотреть файл

@ -19,7 +19,7 @@ add_task(async function() {
// 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});

Просмотреть файл

@ -25,7 +25,10 @@ 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");

Просмотреть файл

@ -110,7 +110,7 @@ BezierCanvas.prototype = {
* @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",
@ -127,10 +127,10 @@ BezierCanvas.prototype = {
* 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]),

Просмотреть файл

@ -112,12 +112,14 @@ Spectrum.rgbToHsv = function(r, g, b, a) {
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;

Просмотреть файл

@ -314,8 +314,6 @@ TableWidget.prototype = {
// 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;
@ -366,8 +364,8 @@ TableWidget.prototype = {
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

Просмотреть файл

@ -3524,7 +3524,8 @@ VariablesView.stringifiers.byObjectKind = {
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) {

Просмотреть файл

@ -55,13 +55,11 @@ class SwatchColorPickerTooltip extends SwatchBasedEditorTooltip {
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;

Просмотреть файл

@ -22,7 +22,7 @@ function getWasmText(subject, data) {
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;
}

Просмотреть файл

@ -1345,7 +1345,8 @@ exports.StorageUI = StorageUI;
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);
});
}

Просмотреть файл

@ -15,7 +15,7 @@ add_task(async function() {
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]);

Просмотреть файл

@ -13,7 +13,7 @@ add_task(async function() {
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]);

Просмотреть файл

@ -251,7 +251,9 @@ function formatStub(key, packet) {
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,

Просмотреть файл

@ -11,8 +11,8 @@
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,

Просмотреть файл

@ -11,8 +11,8 @@
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,

Просмотреть файл

@ -11,8 +11,8 @@
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,

Просмотреть файл

@ -11,8 +11,8 @@
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",

Просмотреть файл

@ -11,8 +11,8 @@
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,

Просмотреть файл

@ -12,9 +12,9 @@ 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();

Просмотреть файл

@ -83,7 +83,8 @@ async function testSelfXss(jsterm) {
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");

Просмотреть файл

@ -35,7 +35,8 @@ add_task(async function() {
// 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");
@ -62,7 +63,8 @@ add_task(async function() {
// 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");
});

Просмотреть файл

@ -18,7 +18,8 @@ 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");

Просмотреть файл

@ -575,7 +575,8 @@ async function openMessageInNetmonitor(toolbox, hud, url, urlInConsole) {
});
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();

Просмотреть файл

@ -22,7 +22,8 @@ const l10n = {
*/
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];

Просмотреть файл

@ -267,13 +267,10 @@ ProjectList.prototype = {
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;

Просмотреть файл

@ -184,12 +184,9 @@ function getProjectWindow(win) {
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");

Просмотреть файл

@ -37,7 +37,8 @@ ArrayBufferActor.prototype = {
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(

Просмотреть файл

@ -432,7 +432,8 @@ exports.CallWatcherActor = protocol.ActorClassWithSpec(callWatcherSpec, {
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);
}
@ -447,7 +448,8 @@ exports.CallWatcherActor = protocol.ActorClassWithSpec(callWatcherSpec, {
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);
}

Просмотреть файл

@ -236,7 +236,8 @@ class AccessibleHighlighter extends AutoRefreshHighlighter {
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.

Просмотреть файл

@ -1133,14 +1133,15 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
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;
@ -1531,7 +1532,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
* 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;
@ -1609,7 +1611,9 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
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);
@ -2291,7 +2295,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
* @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);

Просмотреть файл

@ -294,7 +294,8 @@ function getCurrentMatrix(element, window) {
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;

Просмотреть файл

@ -427,8 +427,9 @@ var WalkerActor = protocol.ActorClassWithSpec(walkerSpec, {
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,

Просмотреть файл

@ -774,7 +774,8 @@ var StyleSheetsActor = protocol.ActorClassWithSpec(styleSheetsSpec, {
// 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 = [];

Просмотреть файл

@ -750,12 +750,13 @@ var DebuggerServer = {
}
}
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");

Просмотреть файл

@ -211,7 +211,7 @@ const ProfilerManager = (function() {
* @return {object}
*/
getBufferInfo: function() {
let position = {}, totalSize = {}, generation = {};
const position = {}, totalSize = {}, generation = {};
Services.profiler.GetBufferInfo(position, totalSize, generation);
return {
position: position.value,

Просмотреть файл

@ -306,9 +306,9 @@ PerformanceRecorder.prototype = {
* 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;

Просмотреть файл

@ -9,18 +9,17 @@
* 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();

Просмотреть файл

@ -108,7 +108,8 @@ const GRID_FRAGMENT_DATA = {
};
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;

Просмотреть файл

@ -10,7 +10,7 @@
"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";

Просмотреть файл

@ -41,8 +41,6 @@ function test_nesting() {
let currentStep = 0;
executeSoon(function() {
let eventLoop;
executeSoon(function() {
// Should be at step 2
Assert.equal(++currentStep, 2);
@ -71,7 +69,7 @@ function test_nesting() {
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();
});

Просмотреть файл

@ -120,7 +120,8 @@ function test() {
// 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);

Просмотреть файл

@ -604,17 +604,16 @@ function _hslValue(m1, m2, h) {
// 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];
}

Просмотреть файл

@ -1127,8 +1127,6 @@ Scanner.prototype = {
* 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;
@ -1137,7 +1135,7 @@ Scanner.prototype = {
this.mTokenLineOffset = this.mLineOffset;
this.mTokenLineNumber = this.mLineNumber;
ch = this.Peek();
const ch = this.Peek();
if (IsWhitespace(ch)) {
this.SkipWhitespace();
aToken.mType = eCSSToken_Whitespace;

Просмотреть файл

@ -15,7 +15,7 @@ function run_test() {
noStack: countBreakdown,
};
let stack1, stack2, stack3, stack4, stack5;
let stack1, stack2, stack3, stack4;
(function a() {
(function b() {
@ -30,7 +30,7 @@ function run_test() {
}());
}());
stack5 = saveStack(1);
const stack5 = saveStack(1);
const REPORT = new Map([
[stack1, { bytes: 10, count: 1 }],

Просмотреть файл

@ -13,7 +13,7 @@ function run_test() {
noStack: countBreakdown,
};
let stack1, stack2, stack3, stack4, stack5;
let stack1, stack2, stack3, stack4;
(function foo() {
(function bar() {
@ -28,7 +28,7 @@ function run_test() {
stack4 = saveStack(2);
}());
stack5 = saveStack(1);
const stack5 = saveStack(1);
const REPORT = new Map([
[stack1, { bytes: 10, count: 1 }],

Просмотреть файл

@ -120,9 +120,11 @@ 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");

Просмотреть файл

@ -54,7 +54,6 @@ async function getSystemInfo() {
height,
physicalWidth,
physicalHeight,
os,
brandName;
const appid = appInfo.ID;
const apptype = APP_MAP[appid];
@ -62,7 +61,7 @@ async function getSystemInfo() {
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");

Просмотреть файл

@ -9,8 +9,10 @@ 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");

Просмотреть файл

@ -61,7 +61,7 @@ const TESTS = {
},
testAllArgumentsArePassed() {
let foo = { name: "foo" }, bar = "bar";
const foo = { name: "foo" }, bar = "bar";
const target = { name: "target" };
on(target, "message", (a, b) => {
@ -163,8 +163,8 @@ const TESTS = {
},
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);

Просмотреть файл

@ -15,7 +15,8 @@ add_task(async function() {
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);