Bug 1864896: Autofix unused function arguments (devtools). r=profiler-reviewers,devtools-reviewers,nchevobbe,julienw

Differential Revision: https://phabricator.services.mozilla.com/D202959
This commit is contained in:
Dave Townsend 2024-03-05 14:21:15 +00:00
parent 46ad075067
commit 9e30d1f3f9
568 changed files with 1527 additions and 1629 deletions

View File

@ -14,4 +14,13 @@ module.exports = {
// content privileged windows, where ownerGlobal doesn't exist.
"mozilla/use-ownerGlobal": "off",
},
overrides: [
{
// Tests verify the exact source code of these functions
files: ["inspector/markup/test/doc_markup_events_*.html"],
rules: {
"no-unused-vars": "off",
},
},
],
};

View File

@ -133,7 +133,7 @@ function installTemporaryExtension() {
const message = l10n.getString(
"about-debugging-tmp-extension-install-message"
);
return async ({ dispatch, getState }) => {
return async ({ dispatch }) => {
dispatch({ type: TEMPORARY_EXTENSION_INSTALL_START });
const file = await openTemporaryExtension(window, message);
try {
@ -146,7 +146,7 @@ function installTemporaryExtension() {
}
function pushServiceWorker(id, registrationFront) {
return async ({ dispatch, getState }) => {
return async () => {
try {
// The push button is only available if canDebugServiceWorkers is true.
// With this configuration, `push` should always be called on the

View File

@ -202,7 +202,7 @@ function connectRuntime(id) {
}
function createThisFirefoxRuntime() {
return ({ dispatch, getState }) => {
return ({ dispatch }) => {
const thisFirefoxRuntime = {
id: RUNTIMES.THIS_FIREFOX,
isConnecting: false,
@ -488,7 +488,7 @@ function updateRemoteRuntimes(runtimes, type) {
* before leaving about:debugging.
*/
function removeRuntimeListeners() {
return ({ dispatch, getState }) => {
return ({ getState }) => {
const allRuntimes = getAllRuntimes(getState().runtimes);
const remoteRuntimes = allRuntimes.filter(
r => r.type !== RUNTIMES.THIS_FIREFOX

View File

@ -13,7 +13,7 @@ const {
* be processed by the event recording middleware.
*/
function recordTelemetryEvent(method, details) {
return ({ dispatch, getState }) => {
return ({ dispatch }) => {
dispatch({ type: TELEMETRY_RECORD, method, details });
};
}

View File

@ -97,13 +97,13 @@ function updateDebugTargetCollapsibility(key, isCollapsed) {
}
function addNetworkLocation(location) {
return ({ dispatch, getState }) => {
return () => {
NetworkLocationsModule.addNetworkLocation(location);
};
}
function removeNetworkLocation(location) {
return ({ dispatch, getState }) => {
return () => {
NetworkLocationsModule.removeNetworkLocation(location);
};
}
@ -133,7 +133,7 @@ function updateAdbReady(isAdbReady) {
}
function updateNetworkLocations(locations) {
return async ({ dispatch, getState }) => {
return async ({ dispatch }) => {
dispatch({ type: NETWORK_LOCATIONS_UPDATE_START });
try {
await dispatch(Actions.updateNetworkRuntimes(locations));
@ -145,7 +145,7 @@ function updateNetworkLocations(locations) {
}
function installAdbAddon() {
return async ({ dispatch, getState }) => {
return async ({ dispatch }) => {
dispatch({ type: ADB_ADDON_INSTALL_START });
try {
@ -160,7 +160,7 @@ function installAdbAddon() {
}
function uninstallAdbAddon() {
return async ({ dispatch, getState }) => {
return async ({ dispatch }) => {
dispatch({ type: ADB_ADDON_UNINSTALL_START });
try {

View File

@ -106,7 +106,7 @@ class DebugTargetPane extends PureComponent {
"undecorated-link debug-target-pane__title " +
"qa-debug-target-pane-title",
title,
onClick: e => this.toggleCollapsibility(),
onClick: () => this.toggleCollapsibility(),
},
dom.h2(
{ className: "main-subheading debug-target-pane__heading" },

View File

@ -44,7 +44,7 @@ class InspectAction extends PureComponent {
},
dom.button(
{
onClick: e => this.inspect(),
onClick: () => this.inspect(),
className: "default-button qa-debug-target-inspect-button",
disabled,
title,

View File

@ -48,7 +48,7 @@ class _ActionButton extends PureComponent {
{
className,
disabled,
onClick: e => onClick(),
onClick: () => onClick(),
title: disabled && disabledTitle ? disabledTitle : undefined,
},
this.props.children
@ -102,7 +102,7 @@ class ServiceWorkerAdditionalActions extends PureComponent {
{
className,
disabled,
onClick: e => onClick(),
onClick: () => onClick(),
},
labelId
)

View File

@ -125,7 +125,7 @@ class TemporaryExtensionAdditionalActions extends PureComponent {
className:
"default-button default-button--micro " +
"qa-temporary-extension-terminate-bgscript-button",
onClick: e => this.terminateBackgroundScript(),
onClick: () => this.terminateBackgroundScript(),
},
"Terminate Background Script"
)
@ -142,7 +142,7 @@ class TemporaryExtensionAdditionalActions extends PureComponent {
className:
"default-button default-button--micro " +
"qa-temporary-extension-remove-button",
onClick: e => this.remove(),
onClick: () => this.remove(),
},
"Remove"
)
@ -166,7 +166,7 @@ class TemporaryExtensionAdditionalActions extends PureComponent {
className:
"default-button default-button--micro " +
"qa-temporary-extension-reload-button",
onClick: e => this.reload(),
onClick: () => this.reload(),
},
"Reload"
)

View File

@ -41,7 +41,7 @@ class TemporaryExtensionInstaller extends PureComponent {
dom.button(
{
className: `${className} default-button qa-temporary-extension-install-button`,
onClick: e => this.install(),
onClick: () => this.install(),
},
"Load Temporary Add-on…"
)

View File

@ -18,7 +18,7 @@ const {
* This middleware converts extensions object that get from DevToolsClient.listAddons()
* to data which is used in DebugTargetItem.
*/
const extensionComponentDataMiddleware = store => next => action => {
const extensionComponentDataMiddleware = () => next => action => {
switch (action.type) {
case REQUEST_EXTENSIONS_SUCCESS: {
action.installedExtensions = toComponentData(action.installedExtensions);

View File

@ -17,7 +17,7 @@ const {
* This middleware converts tabs object that get from DevToolsClient.listProcesses() to
* data which is used in DebugTargetItem.
*/
const processComponentDataMiddleware = store => next => action => {
const processComponentDataMiddleware = () => next => action => {
switch (action.type) {
case REQUEST_PROCESSES_SUCCESS: {
const mainProcessComponentData = toMainProcessComponentData(
@ -31,7 +31,7 @@ const processComponentDataMiddleware = store => next => action => {
return next(action);
};
function toMainProcessComponentData(process) {
function toMainProcessComponentData() {
const type = DEBUG_TARGETS.PROCESS;
const icon = "chrome://devtools/skin/images/aboutdebugging-process-icon.svg";

View File

@ -13,7 +13,7 @@ const {
* This middleware converts tabs object that get from DevToolsClient.listTabs() to data
* which is used in DebugTargetItem.
*/
const tabComponentDataMiddleware = store => next => action => {
const tabComponentDataMiddleware = () => next => action => {
switch (action.type) {
case REQUEST_TABS_SUCCESS: {
action.tabs = toComponentData(action.tabs);

View File

@ -15,7 +15,7 @@ const {
* This middleware converts workers object that get from DevToolsClient.listAllWorkers()
* to data which is used in DebugTargetItem.
*/
const workerComponentDataMiddleware = store => next => action => {
const workerComponentDataMiddleware = () => next => action => {
switch (action.type) {
case REQUEST_WORKERS_SUCCESS: {
action.otherWorkers = toComponentData(action.otherWorkers);

View File

@ -85,7 +85,7 @@ add_task(async function () {
info("Wait for next interupt in the worker thread");
await clickElement(dbg, "pause");
await waitForState(dbg, state => getIsWaitingOnBreak(getCurrentThread()));
await waitForState(dbg, () => getIsWaitingOnBreak(getCurrentThread()));
info("Trigger some code in the worker and wait for pause");
await SpecialPowers.spawn(swTab.linkedBrowser, [], async function () {

View File

@ -39,7 +39,7 @@ add_task(async function () {
usbRuntimeSidebarItem.querySelector(".qa-connect-button");
info("Simulate to happen connection error");
mocks.runtimeClientFactoryMock.createClientForRuntime = async runtime => {
mocks.runtimeClientFactoryMock.createClientForRuntime = async () => {
throw new Error("Dummy connection error");
};

View File

@ -54,7 +54,7 @@ add_task(async function testSuccessfulConnectionAttempt() {
add_task(async function testFailedConnectionAttempt() {
const { doc, mocks, runtimeId, sessionId, tab } =
await setupConnectionAttemptTest();
mocks.runtimeClientFactoryMock.createClientForRuntime = async runtime => {
mocks.runtimeClientFactoryMock.createClientForRuntime = async () => {
throw new Error("failed");
};
@ -168,8 +168,8 @@ add_task(async function testCancelledConnectionAttempt() {
await setupConnectionAttemptTest();
info("Simulate a connection timeout");
mocks.runtimeClientFactoryMock.createClientForRuntime = async runtime => {
await new Promise(r => {});
mocks.runtimeClientFactoryMock.createClientForRuntime = async () => {
await new Promise(() => {});
};
info("Click on the connect button and wait for the error message");

View File

@ -39,7 +39,7 @@ function disableAdbMock() {
*/
function createAdbMock() {
const adbMock = {};
adbMock.registerListener = function (listener) {
adbMock.registerListener = function () {
console.log("MOCKED METHOD registerListener");
};
@ -55,7 +55,7 @@ function createAdbMock() {
console.log("MOCKED METHOD updateRuntimes");
};
adbMock.unregisterListener = function (listener) {
adbMock.unregisterListener = function () {
console.log("MOCKED METHOD unregisterListener");
};

View File

@ -67,7 +67,7 @@ function disableRuntimeClientFactoryMock() {
*/
function createRuntimeClientFactoryMock() {
const RuntimeClientFactoryMock = {};
RuntimeClientFactoryMock.createClientForRuntime = function (runtime) {
RuntimeClientFactoryMock.createClientForRuntime = function () {
console.log("MOCKED METHOD createClientForRuntime");
};

View File

@ -1,6 +1,6 @@
"use strict";
// Bug 1328293
self.onfetch = function (event) {
self.onfetch = function () {
// do nothing.
};

View File

@ -194,7 +194,7 @@ add_task(async function test_without_traits_with_error() {
function createClientWrapper(preferencesFront) {
const clientWrapper = {
getFront: name => {
getFront: () => {
return preferencesFront;
},
};

View File

@ -518,7 +518,7 @@ class AccessibilityProxy {
}
}
async onTargetAvailable({ targetFront, isTargetSwitching }) {
async onTargetAvailable({ targetFront }) {
targetFront.watchFronts(
"accessibility",
this.onAccessibilityFrontAvailable,

View File

@ -285,7 +285,7 @@ class Accessible extends Component {
window.emit(EVENTS.NEW_ACCESSIBLE_FRONT_INSPECTED);
}
openLink(link, e) {
openLink(link) {
openContentLink(link);
}

View File

@ -105,7 +105,7 @@ class Checks extends Component {
}
}
const mapStateToProps = ({ details, ui }) => {
const mapStateToProps = ({ details }) => {
const { audit } = details;
if (!audit) {
return {};

View File

@ -286,7 +286,7 @@ AccessibilityPanel.prototype = {
this._toolbox.component.setToolboxButtons(this._toolbox.toolbarButtons);
},
togglePicker(focus) {
togglePicker() {
this.picker && this.picker.toggle();
},

View File

@ -55,7 +55,7 @@ const {
* called to start the UI for the panel.
*/
window.Application = {
async bootstrap({ toolbox, commands, panel }) {
async bootstrap({ toolbox, commands }) {
// bind event handlers to `this`
this.updateDomain = this.updateDomain.bind(this);

View File

@ -20,7 +20,7 @@ const {
} = require("resource://devtools/client/application/src/constants.js");
function fetchManifest() {
return async ({ dispatch, getState }) => {
return async ({ dispatch }) => {
dispatch({ type: FETCH_MANIFEST_START });
try {
const manifest = await services.fetchManifest();

View File

@ -118,7 +118,7 @@ class Worker extends PureComponent {
return this.props.worker.stateText;
}
getClassNameForStatus(baseClass) {
getClassNameForStatus() {
const { state } = this.props.worker;
switch (state) {

View File

@ -15,7 +15,7 @@ function eventTelemetryMiddleware(telemetry) {
telemetry.recordEvent(method, "application", null, details);
}
return store => next => action => {
return () => next => action => {
switch (action.type) {
// ui telemetry
case UPDATE_SELECTED_PAGE:

View File

@ -67,7 +67,7 @@ function _processRawManifestMembers(rawManifest) {
// filter out extra metadata members (those with moz_ prefix) and icons
const rawMembers = Object.entries(rawManifest).filter(
([key, value]) => !key.startsWith("moz_") && !(key === "icons")
([key]) => !key.startsWith("moz_") && !(key === "icons")
);
for (const [key, value] of rawMembers) {

View File

@ -104,7 +104,7 @@ function getErrors(suite, out, err, testPath) {
const JEST_ERROR_SUMMARY_REGEX = /\s●\s/;
function getJestErrors(out, err) {
function getJestErrors(out) {
// The string out has extra content before the JSON object starts.
const jestJsonOut = out.substring(out.indexOf("{"), out.lastIndexOf("}") + 1);
const results = JSON.parse(jestJsonOut);

View File

@ -41012,7 +41012,7 @@ Please specify the "importAttributesKeyword" generator option, whose value can b
function hasTopLevelAwait(ast) {
const hasAwait = hasNode(
ast,
(node, ancestors, b) => libExports$2.isAwaitExpression(node) && isTopLevel(ancestors)
(node, ancestors) => libExports$2.isAwaitExpression(node) && isTopLevel(ancestors)
);
return hasAwait;

View File

@ -27,11 +27,7 @@ function getOutOfScopeLines(outOfScopeLocations) {
return uniqueLines;
}
async function getInScopeLines(
location,
sourceTextContent,
{ dispatch, getState, parserWorker }
) {
async function getInScopeLines(location, sourceTextContent, { parserWorker }) {
let locations = null;
if (location.line && parserWorker.isLocationSupported(location)) {
locations = await parserWorker.findOutOfScopeLocations(location);

View File

@ -44,7 +44,7 @@ export function addHiddenBreakpoint(location) {
* @static
*/
export function disableBreakpointsInSource(source) {
return async ({ dispatch, getState, client }) => {
return async ({ dispatch, getState }) => {
const breakpoints = getBreakpointsForSource(getState(), source);
for (const breakpoint of breakpoints) {
if (!breakpoint.disabled) {
@ -61,7 +61,7 @@ export function disableBreakpointsInSource(source) {
* @static
*/
export function enableBreakpointsInSource(source) {
return async ({ dispatch, getState, client }) => {
return async ({ dispatch, getState }) => {
const breakpoints = getBreakpointsForSource(getState(), source);
for (const breakpoint of breakpoints) {
if (breakpoint.disabled) {
@ -78,7 +78,7 @@ export function enableBreakpointsInSource(source) {
* @static
*/
export function toggleAllBreakpoints(shouldDisableBreakpoints) {
return async ({ dispatch, getState, client }) => {
return async ({ dispatch, getState }) => {
const breakpoints = getBreakpointsList(getState());
for (const breakpoint of breakpoints) {
@ -149,7 +149,7 @@ export function removeBreakpoints(breakpoints) {
* @static
*/
export function removeBreakpointsInSource(source) {
return async ({ dispatch, getState, client }) => {
return async ({ dispatch, getState }) => {
const breakpoints = getBreakpointsForSource(getState(), source);
for (const breakpoint of breakpoints) {
dispatch(removeBreakpoint(breakpoint));
@ -271,7 +271,7 @@ export function enableBreakpointsAtLine(source, line) {
}
export function toggleDisabledBreakpoint(breakpoint) {
return ({ dispatch, getState }) => {
return ({ dispatch }) => {
if (!breakpoint.disabled) {
return dispatch(disableBreakpoint(breakpoint));
}
@ -356,7 +356,7 @@ export function togglePauseOnAny() {
}
export function setXHRBreakpoint(path, method) {
return ({ dispatch, getState, client }) => {
return ({ dispatch, client }) => {
const breakpoint = createXHRBreakpoint(path, method);
return dispatch({

View File

@ -14,7 +14,7 @@ import { originalToGeneratedId } from "devtools/client/shared/source-map-loader/
import { getSource } from "../../selectors/index";
import { addBreakpoint, removeBreakpointAtGeneratedLocation } from "./modify";
async function findBreakpointPosition({ getState, dispatch }, location) {
async function findBreakpointPosition({ dispatch }, location) {
const positions = await dispatch(setBreakpointPositions(location));
const position = findPosition(positions, location);

View File

@ -85,7 +85,7 @@ export function showEditorCreateBreakpointContextMenu(
location,
lineText
) {
return async ({ dispatch, getState }) => {
return async ({ dispatch }) => {
const items = createBreakpointItems(location, lineText, dispatch);
showMenu(event, items);

View File

@ -26,7 +26,7 @@ function formatMenuElement(labelString, click, disabled = false) {
};
}
function isValidRestartFrame(frame, callbacks) {
function isValidRestartFrame(frame) {
// Any frame state than 'on-stack' is either dismissed by the server
// or can potentially cause unexpected errors.
// Global frame has frame.callee equal to null and can't be restarted.
@ -34,7 +34,7 @@ function isValidRestartFrame(frame, callbacks) {
}
function copyStackTrace() {
return async ({ dispatch, getState }) => {
return async ({ getState }) => {
const frames = getCurrentThreadFrames(getState());
const shouldDisplayOriginalLocation = getShouldSelectOriginalLocation(
getState()

View File

@ -23,7 +23,7 @@ import { features } from "../utils/prefs";
* @param {string} input
*/
export function addExpression(input) {
return async ({ dispatch, getState, parserWorker }) => {
return async ({ dispatch, getState }) => {
if (!input) {
return null;
}
@ -64,7 +64,7 @@ export function clearAutocomplete() {
}
export function updateExpression(input, expression) {
return async ({ getState, dispatch, parserWorker }) => {
return async ({ dispatch }) => {
if (!input) {
return;
}

View File

@ -30,7 +30,7 @@ export function querySearchWorker(query, text, modifiers) {
}
export function searchContentsForHighlight(query, editor, line, ch) {
return async ({ getState, dispatch }) => {
return async ({ getState }) => {
const modifiers = getSearchOptions(getState(), "file-search");
const sourceTextContent = getSelectedSourceTextContent(getState());

View File

@ -18,13 +18,7 @@ import { evaluateExpressionsForCurrentContext } from "../actions/expressions";
* @static
*/
export function willNavigate(event) {
return async function ({
dispatch,
getState,
client,
sourceMapLoader,
parserWorker,
}) {
return async function ({ dispatch, getState, sourceMapLoader }) {
sourceQueue.clear();
sourceMapLoader.clearSourceMaps();
clearWasmStates();
@ -42,7 +36,7 @@ export function willNavigate(event) {
* @static
*/
export function navigated() {
return async function ({ getState, dispatch, panel }) {
return async function ({ dispatch, panel }) {
try {
// Update the watched expressions once the page is fully loaded
await dispatch(evaluateExpressionsForCurrentContext());

View File

@ -17,7 +17,7 @@ import { recordEvent } from "../../utils/telemetry";
import { validateFrame } from "../../utils/context";
export function selectThread(thread) {
return async ({ dispatch, getState, client }) => {
return async ({ dispatch, getState }) => {
if (getCurrentThread(getState()) === thread) {
return;
}

View File

@ -5,7 +5,7 @@
import { getScopeItemPath } from "../../utils/pause/scopes";
export function setExpandedScope(selectedFrame, item, expanded) {
return function ({ dispatch, getState }) {
return function ({ dispatch }) {
return dispatch({
type: "SET_EXPANDED_SCOPE",
selectedFrame,

View File

@ -5,7 +5,7 @@
import { PROMISE } from "../utils/middleware/promise";
export function pauseOnDebuggerStatement(shouldPauseOnDebuggerStatement) {
return ({ dispatch, getState, client }) => {
return ({ dispatch, client }) => {
return dispatch({
type: "PAUSE_ON_DEBUGGER_STATEMENT",
shouldPauseOnDebuggerStatement,

View File

@ -14,7 +14,7 @@ export function pauseOnExceptions(
shouldPauseOnExceptions,
shouldPauseOnCaughtExceptions
) {
return ({ dispatch, getState, client }) => {
return ({ dispatch, client }) => {
recordEvent("pause_on_exceptions", {
exceptions: shouldPauseOnExceptions,
// There's no "n" in the key below (#1463117)

View File

@ -14,7 +14,7 @@ import { inDebuggerEval } from "../../utils/pause/index";
* Debugger has just resumed.
*/
export function resumed(thread) {
return async ({ dispatch, client, getState }) => {
return async ({ dispatch, getState }) => {
const why = getPauseReason(getState(), thread);
const wasPausedInEval = inDebuggerEval(why);
const wasStepping = isStepping(getState(), thread);

View File

@ -25,7 +25,7 @@ const mockCommandClient = {
getFrames: async () => [],
setBreakpoint: () => new Promise(_resolve => {}),
sourceContents: ({ source }) => {
return new Promise((resolve, reject) => {
return new Promise(resolve => {
switch (source) {
case "foo1":
return resolve({
@ -184,7 +184,7 @@ describe("pause", () => {
it("maps frame to original frames", async () => {
const sourceMapLoaderMock = {
getOriginalStackFrames: loc => Promise.resolve(originStackFrames),
getOriginalStackFrames: () => Promise.resolve(originStackFrames),
getOriginalLocation: () =>
Promise.resolve(debuggerToSourceMapLocation(originalLocation)),
getOriginalLocations: async items =>

View File

@ -128,7 +128,7 @@ export function getPreview(target, tokenPos, codeMirror) {
}
export function getExceptionPreview(target, tokenPos, codeMirror) {
return async ({ dispatch, getState, parserWorker }) => {
return async ({ getState, parserWorker }) => {
const match = await findExpressionMatch(
getState(),
parserWorker,

View File

@ -43,7 +43,7 @@ async function loadGeneratedSource(sourceActor, { client }) {
async function loadOriginalSource(
source,
{ getState, client, sourceMapLoader, prettyPrintWorker }
{ getState, sourceMapLoader, prettyPrintWorker }
) {
if (isPretty(source)) {
const generatedSource = getGeneratedSource(getState(), source);

View File

@ -294,7 +294,7 @@ export function newGeneratedSource(sourceInfo) {
}
export function newGeneratedSources(sourceResources) {
return async ({ dispatch, getState, client }) => {
return async ({ dispatch, getState }) => {
if (!sourceResources.length) {
return [];
}
@ -370,7 +370,7 @@ export function newGeneratedSources(sourceResources) {
}
function checkNewSources(sources) {
return async ({ dispatch, getState }) => {
return async ({ dispatch }) => {
for (const source of sources) {
dispatch(checkSelectedSource(source.id));
}

View File

@ -224,7 +224,7 @@ async function prettyPrintHtmlFile({
}
function createPrettySource(source, sourceActor) {
return async ({ dispatch, sourceMapLoader, getState }) => {
return async ({ dispatch }) => {
const url = getPrettyOriginalSourceURL(source);
const id = generatedToOriginalId(source.id, url);
const prettySource = createPrettyPrintOriginalSource(id, url);
@ -336,7 +336,7 @@ const memoizedPrettyPrintSource = memoizeableAction("setSymbols", {
});
export function prettyPrintAndSelectSource(source) {
return async ({ dispatch, sourceMapLoader, getState }) => {
return async ({ dispatch }) => {
const prettySource = await dispatch(memoizedPrettyPrintSource(source));
// Select the pretty/original source based on the location we may

View File

@ -10,7 +10,7 @@ import { loadSourceText } from "./loadSourceText";
import { memoizeableAction } from "../../utils/memoizableAction";
import { fulfilled } from "../../utils/async-value";
async function doSetSymbols(location, { dispatch, getState, parserWorker }) {
async function doSetSymbols(location, { dispatch, parserWorker }) {
await dispatch(loadSourceText(location.source, location.sourceActor));
await dispatch({

View File

@ -22,7 +22,7 @@ import { createLocation } from "../../../utils/location";
import { mockCommandClient } from "../../tests/helpers/mockCommandClient";
process.on("unhandledRejection", (reason, p) => {});
process.on("unhandledRejection", () => {});
function initialLocation(sourceId) {
return createLocation({ source: createSourceObject(sourceId), line: 1 });

View File

@ -6,7 +6,7 @@ import { actions, selectors, createStore } from "../../utils/test-head";
const mockThreadFront = {
evaluate: (script, { frameId }) =>
new Promise((resolve, reject) => {
new Promise(resolve => {
if (!frameId) {
resolve("bla");
} else {
@ -16,8 +16,8 @@ const mockThreadFront = {
evaluateExpressions: (inputs, { frameId }) =>
Promise.all(
inputs.map(
input =>
new Promise((resolve, reject) => {
() =>
new Promise(resolve => {
if (!frameId) {
resolve("bla");
} else {

View File

@ -30,7 +30,7 @@ export function openElementInInspectorCommand(grip) {
};
}
export function openInspector(grip) {
export function openInspector() {
return async ({ panel }) => {
return panel.openInspector();
};

View File

@ -66,7 +66,7 @@ export function setActiveSearch(activeSearch) {
}
export function toggleFrameworkGrouping(toggleValue) {
return ({ dispatch, getState }) => {
return ({ dispatch }) => {
dispatch({
type: "TOGGLE_FRAMEWORK_GROUPING",
value: toggleValue,
@ -75,7 +75,7 @@ export function toggleFrameworkGrouping(toggleValue) {
}
export function toggleInlinePreview(toggleValue) {
return ({ dispatch, getState }) => {
return ({ dispatch }) => {
dispatch({
type: "TOGGLE_INLINE_PREVIEW",
value: toggleValue,
@ -84,7 +84,7 @@ export function toggleInlinePreview(toggleValue) {
}
export function toggleEditorWrapping(toggleValue) {
return ({ dispatch, getState }) => {
return ({ dispatch }) => {
updateEditorLineWrapping(toggleValue);
dispatch({
@ -95,7 +95,7 @@ export function toggleEditorWrapping(toggleValue) {
}
export function toggleSourceMapsEnabled(toggleValue) {
return ({ dispatch, getState }) => {
return ({ dispatch }) => {
dispatch({
type: "TOGGLE_SOURCE_MAPS_ENABLED",
value: toggleValue,
@ -217,7 +217,7 @@ export function setSearchOptions(searchKey, searchOptions) {
}
export function copyToClipboard(location) {
return ({ dispatch, getState }) => {
return ({ getState }) => {
const content = getSourceTextContent(getState(), location);
if (content && isFulfilled(content) && content.value.type === "text") {
copyToTheClipboard(content.value.value);
@ -257,7 +257,7 @@ export function toggleJavascriptTracingOnNextLoad() {
}
export function setHideOrShowIgnoredSources(shouldHide) {
return ({ dispatch, getState }) => {
return ({ dispatch }) => {
dispatch({ type: "HIDE_IGNORED_SOURCES", shouldHide });
};
}

View File

@ -27,7 +27,7 @@ function validateActionContext(getState, action) {
// Middleware which looks for actions that have a cx property and ignores
// them if the context is no longer valid.
function context({ dispatch, getState }) {
function context({ getState }) {
return next => action => {
if ("cx" in action) {
validateActionContext(getState, action);

View File

@ -92,7 +92,7 @@ function serializeAction(action) {
* A middleware that logs all actions coming through the system
* to the console.
*/
export function log({ dispatch, getState }) {
export function log() {
return next => action => {
const asyncMsg = !action.status ? "" : `[${action.status}]`;

View File

@ -21,7 +21,7 @@ function seqIdGen() {
return seqIdVal++;
}
function promiseMiddleware({ dispatch, getState }) {
function promiseMiddleware({ dispatch }) {
return next => action => {
if (!(PROMISE in action)) {
return next(action);

View File

@ -9,13 +9,13 @@
const mark = window.performance?.mark
? window.performance.mark.bind(window.performance)
: a => {};
: () => {};
const measure = window.performance?.measure
? window.performance.measure.bind(window.performance)
: (a, b, c) => {};
: () => {};
export function timing(store) {
export function timing() {
return next => action => {
mark(`${action.type}_start`);
const result = next(action);

View File

@ -110,7 +110,7 @@ export function onDisconnect() {
sourceQueue.clear();
}
async function onTargetAvailable({ targetFront, isTargetSwitching }) {
async function onTargetAvailable({ targetFront }) {
const isBrowserToolbox = commands.descriptorFront.isBrowserProcessDescriptor;
const isNonTopLevelFrameTarget =
!targetFront.isTopLevel &&

View File

@ -115,7 +115,7 @@ async function toggleTracing() {
return commands.tracerCommand.toggle();
}
function resume(thread, frameId) {
function resume(thread) {
return lookupThreadFront(thread).resume();
}

View File

@ -121,7 +121,7 @@ export class ConditionalPanel extends PureComponent {
return this.clearConditionalPanel();
}
componentDidUpdate(prevProps) {
componentDidUpdate() {
this.keepFocusOnInput();
}

View File

@ -27,7 +27,7 @@ class InlinePreview extends PureComponent {
};
}
showInScopes(variable) {
showInScopes() {
// TODO: focus on variable value in the scopes sidepanel
// we will need more info from parent comp
}

View File

@ -44,7 +44,7 @@ class Preview extends PureComponent {
codeMirrorWrapper.removeEventListener("mousedown", this.onMouseDown);
}
updateListeners(prevProps) {
updateListeners() {
const { codeMirror } = this.props.editor;
const codeMirrorWrapper = codeMirror.getWrapperElement();
codeMirror.on("tokenenter", this.onTokenEnter);

View File

@ -97,7 +97,7 @@ class SearchInFileBar extends Component {
shortcuts.on("Escape", this.onEscape);
}
componentDidUpdate(prevProps, prevState) {
componentDidUpdate() {
if (this.refs.resultList && this.refs.resultList.refs) {
scrollList(this.refs.resultList.refs, this.state.selectedResultIndex);
}
@ -111,7 +111,7 @@ class SearchInFileBar extends Component {
const { editor: ed } = this.props;
if (ed) {
const ctx = { ed, cm: ed.codeMirror };
removeOverlay(ctx, this.state.query);
removeOverlay(ctx);
}
};
@ -165,7 +165,7 @@ class SearchInFileBar extends Component {
const ctx = { ed: editor, cm: editor.codeMirror };
if (!query) {
clearSearch(ctx.cm, query);
clearSearch(ctx.cm);
return;
}
@ -249,11 +249,11 @@ class SearchInFileBar extends Component {
return this.doSearch(e.target.value);
};
onFocus = e => {
onFocus = () => {
this.setState({ inputFocused: true });
};
onBlur = e => {
onBlur = () => {
this.setState({ inputFocused: false });
};
@ -349,7 +349,7 @@ SearchInFileBar.contextTypes = {
shortcuts: PropTypes.object,
};
const mapStateToProps = (state, p) => {
const mapStateToProps = state => {
const selectedSource = getSelectedSource(state);
return {

View File

@ -217,7 +217,7 @@ class Editor extends PureComponent {
codeMirrorWrapper.addEventListener("click", e => this.onClick(e));
codeMirrorWrapper.addEventListener("mouseover", onMouseOver(codeMirror));
const toggleFoldMarkerVisibility = e => {
const toggleFoldMarkerVisibility = () => {
if (node instanceof HTMLElement) {
node
.querySelectorAll(".CodeMirror-guttermarker-subtle")
@ -565,7 +565,7 @@ class Editor extends PureComponent {
}
}
shouldScrollToLocation(nextProps, editor) {
shouldScrollToLocation(nextProps) {
if (
!nextProps.selectedLocation?.line ||
!nextProps.selectedSourceTextContent

View File

@ -15,7 +15,7 @@ function createMockDocument(clear) {
addLineClass: jest.fn(),
removeLineClass: jest.fn(),
markText: jest.fn(() => ({ clear })),
getLine: line => "",
getLine: () => "",
};
return doc;

View File

@ -138,8 +138,8 @@ export class Outline extends Component {
}
// Find items that enclose the selected location
const enclosedItems = [...classes, ...functions].filter(
({ name, location }) => containsPosition(location, cursorPosition)
const enclosedItems = [...classes, ...functions].filter(({ location }) =>
containsPosition(location, cursorPosition)
);
if (!enclosedItems.length) {

View File

@ -352,7 +352,7 @@ export class ProjectSearch extends Component {
autoExpandAll: true,
autoExpandDepth: 1,
autoExpandNodeChildrenLimit: 100,
getParent: item => null,
getParent: () => null,
getPath: getFilePath,
renderItem: this.renderItem,
focused: this.state.focusedItem,

View File

@ -47,7 +47,7 @@ class SourceTreeItem extends Component {
}
}
onClick = e => {
onClick = () => {
const { item, focusItem, selectSourceItem } = this.props;
focusItem(item);

View File

@ -377,7 +377,7 @@ export class QuickOpenModal extends Component {
isSourceSearch = () => this.isSourcesQuery() || this.isGotoSourceQuery();
/* eslint-disable react/no-danger */
renderHighlight(candidateString, query, name) {
renderHighlight(candidateString, query) {
const options = {
wrap: {
tagOpen: '<mark class="highlight">',

View File

@ -231,7 +231,7 @@ class CommandBar extends Component {
formatKey("trace"),
this.props.logMethod
),
onClick: event => {
onClick: () => {
this.props.toggleTracing();
},
onContextMenu: event => {

View File

@ -116,11 +116,11 @@ class EventListeners extends Component {
}
};
onFocus = event => {
onFocus = () => {
this.setState({ focused: true });
};
onBlur = event => {
onBlur = () => {
this.setState({ focused: false });
};

View File

@ -124,7 +124,7 @@ export default class FrameComponent extends Component {
this.props.showFrameContextMenu(event, frame);
}
onMouseDown(e, frame, selectedFrame) {
onMouseDown(e, frame) {
if (e.button !== 0) {
return;
}
@ -132,7 +132,7 @@ export default class FrameComponent extends Component {
this.props.selectFrame(frame);
}
onKeyUp(event, frame, selectedFrame) {
onKeyUp(event, frame) {
if (event.key != "Enter") {
return;
}

View File

@ -164,7 +164,7 @@ class XHRBreakpoints extends Component {
this.setState({ focused: true, editing: true });
};
onMouseDown = e => {
onMouseDown = () => {
this.setState({ editing: false, clickedOnFormElement: true });
};
@ -262,7 +262,7 @@ class XHRBreakpoints extends Component {
className: "xhr-container",
key: `${path}-${method}`,
title: path,
onDoubleClick: (items, options) => this.editExpression(index),
onDoubleClick: () => this.editExpression(index),
},
label(
null,
@ -290,7 +290,7 @@ class XHRBreakpoints extends Component {
className: "xhr-container__close-btn",
},
React.createElement(CloseButton, {
handleClick: e => removeXHRBreakpoint(index),
handleClick: () => removeXHRBreakpoint(index),
})
)
)

View File

@ -214,7 +214,7 @@ class SecondaryPanes extends Component {
input({
type: "checkbox",
checked: mapScopesEnabled ? "checked" : "",
onChange: e => this.props.toggleMapScopes(),
onChange: () => this.props.toggleMapScopes(),
}),
L10N.getStr("scopes.showOriginalScopes")
),
@ -249,7 +249,7 @@ class SecondaryPanes extends Component {
input({
type: "checkbox",
checked: logEventBreakpoints ? "checked" : "",
onChange: e => this.props.toggleEventLogging(),
onChange: () => this.props.toggleEventLogging(),
}),
L10N.getStr("eventlisteners.log")
)

View File

@ -225,7 +225,7 @@ describe("XHR Breakpoints", function () {
}
// check each expected XHR Method to see if they match the actual methods
expectedXHRMethods.forEach((expectedMethod, i) => {
expectedXHRMethods.forEach(expectedMethod => {
function compareMethods(actualMethod) {
return expectedMethod === actualMethod;
}

View File

@ -21,7 +21,7 @@ export class Dropdown extends Component {
};
}
toggleDropdown = e => {
toggleDropdown = () => {
this.setState(prevState => ({
dropdownShown: !prevState.dropdownShown,
}));

View File

@ -255,7 +255,6 @@ class Popover extends Component {
React.createElement(SmartGap, {
token: this.props.target,
preview: this.$tooltip || this.$popover,
type: this.props.type,
gapHeight: this.gapHeight,
coords: this.state.coords,
offset: this.$gap.getBoundingClientRect().left,

View File

@ -109,7 +109,6 @@ function getSmartGapDimensions(
export default function SmartGap({
token,
preview,
type,
gapHeight,
coords,
offset,

View File

@ -105,7 +105,6 @@ exports[`Popover mount popover 1`] = `
"getBoundingClientRect": [Function],
}
}
type="popover"
>
<svg
style={
@ -234,7 +233,6 @@ exports[`Popover mount tooltip 1`] = `
"getBoundingClientRect": [Function],
}
}
type="tooltip"
>
<svg
style={
@ -359,7 +357,6 @@ exports[`Popover render (tooltip) 1`] = `
"getBoundingClientRect": [Function],
}
}
type="tooltip"
>
<svg
style={
@ -504,7 +501,6 @@ exports[`Popover render 1`] = `
"getBoundingClientRect": [Function],
}
}
type="popover"
>
<svg
style={

View File

@ -66,7 +66,7 @@ function setPauseOnExceptions() {
);
}
async function loadInitialState(commands, toolbox) {
async function loadInitialState() {
const pendingBreakpoints = sanitizeBreakpoints(
await asyncStore.pendingBreakpoints
);
@ -103,7 +103,7 @@ export async function bootstrap({
// record events.
setToolboxTelemetry(panel.toolbox.telemetry);
const initialState = await loadInitialState(commands, panel.toolbox);
const initialState = await loadInitialState();
const workers = bootstrapWorkers(panelWorkers);
const { store, actions, selectors } = bootstrapStore(

View File

@ -42,7 +42,7 @@ export function bootstrapStore(client, workers, panel, initialState) {
const createStore = configureStore({
log: prefs.logging || flags.testing,
timing: debugJsModules,
makeThunkArgs: (args, state) => {
makeThunkArgs: args => {
return { ...args, client, ...workers, panel };
},
});

View File

@ -27,7 +27,7 @@ function SearchState() {
* @memberof utils/source-search
* @static
*/
function getSearchState(cm, query) {
function getSearchState(cm) {
const state = cm.state.search || (cm.state.search = new SearchState());
return state;
}
@ -55,7 +55,7 @@ function searchOverlay(query, modifiers) {
});
return {
token(stream, state) {
token(stream) {
// set the last index to be the current stream position
// this acts as an offset
regexQuery.lastIndex = stream.pos;
@ -141,11 +141,11 @@ function doSearch(
return cm.operation(function () {
if (!query || isWhitespace(query)) {
clearSearch(cm, query);
clearSearch(cm);
return null;
}
const state = getSearchState(cm, query);
const state = getSearchState(cm);
const isNewQuery = state.query !== query;
state.query = query;
@ -179,7 +179,7 @@ export function searchSourceForHighlight(
}
cm.operation(function () {
const state = getSearchState(cm, query);
const state = getSearchState(cm);
const isNewQuery = state.query !== query;
state.query = query;
@ -207,7 +207,7 @@ function searchNext(ctx, rev, query, newQuery, modifiers) {
const { cm } = ctx;
let nextMatch;
cm.operation(function () {
const state = getSearchState(cm, query);
const state = getSearchState(cm);
const pos = getCursorPos(newQuery, rev, state);
if (!state.query) {
@ -261,8 +261,8 @@ function findNextOnLine(ctx, rev, query, newQuery, modifiers, line, ch) {
* @memberof utils/source-search
* @static
*/
export function removeOverlay(ctx, query) {
const state = getSearchState(ctx.cm, query);
export function removeOverlay(ctx) {
const state = getSearchState(ctx.cm);
ctx.cm.removeOverlay(state.overlay);
const { line, ch } = ctx.cm.getCursor();
ctx.cm.doc.setSelection({ line, ch }, { line, ch }, { scroll: false });
@ -274,8 +274,8 @@ export function removeOverlay(ctx, query) {
* @memberof utils/source-search
* @static
*/
export function clearSearch(cm, query) {
const state = getSearchState(cm, query);
export function clearSearch(cm) {
const state = getSearchState(cm);
state.results = [];
@ -293,7 +293,7 @@ export function clearSearch(cm, query) {
* @static
*/
export function find(ctx, query, keepSelection, modifiers, focusFirstResult) {
clearSearch(ctx.cm, query);
clearSearch(ctx.cm);
return doSearch(
ctx,
false,

View File

@ -101,7 +101,7 @@ function makeFrame({ id, sourceId, thread }, opts = {}) {
};
}
function createSourceObject(filename, props = {}) {
function createSourceObject(filename) {
return {
id: filename,
url: makeSourceURL(filename),

View File

@ -11,7 +11,7 @@ import { isTopLevel } from "./utils/helpers";
function hasTopLevelAwait(ast) {
const hasAwait = hasNode(
ast,
(node, ancestors, b) => t.isAwaitExpression(node) && isTopLevel(ancestors)
(node, ancestors) => t.isAwaitExpression(node) && isTopLevel(ancestors)
);
return hasAwait;

View File

@ -8,7 +8,7 @@ import cases from "jest-in-case";
cases(
"Parser.getFramework",
({ name, file, value }) => {
() => {
const source = populateOriginalSource("frameworks/plainJavascript");
const symbols = getSymbols(source.id);
expect(symbols.framework).toBeNull();

View File

@ -9,7 +9,7 @@ import cases from "jest-in-case";
cases(
"Parser.getSymbols",
({ name, file, original, type }) => {
({ file, original, type }) => {
const source = original
? populateOriginalSource(file, type)
: populateSource(file, type);

View File

@ -12,7 +12,7 @@ function format(code) {
return prettier.format(code, { semi: false, parser: "babel" });
}
function excludedTest({ name, expression, bindings = [] }) {
function excludedTest({ expression, bindings = [] }) {
const safeExpression = mapExpressionBindings(
expression,
parseConsoleScript(expression),
@ -21,7 +21,7 @@ function excludedTest({ name, expression, bindings = [] }) {
expect(format(safeExpression)).toEqual(format(expression));
}
function includedTest({ name, expression, newExpression, bindings }) {
function includedTest({ expression, newExpression, bindings }) {
const safeExpression = mapExpressionBindings(
expression,
parseConsoleScript(expression),

View File

@ -200,7 +200,7 @@ add_task(async function testHideAndShowBlackBoxedFiles() {
function waitForBlackboxCount(dbg, count) {
return waitForState(
dbg,
state => Object.keys(dbg.selectors.getBlackBoxRanges()).length === count
() => Object.keys(dbg.selectors.getBlackBoxRanges()).length === count
);
}

View File

@ -15,9 +15,9 @@ add_task(async function () {
info("Adding a breakpoint should remove the skipped pausing state");
await skipPausing(dbg);
await waitForState(dbg, state => dbg.selectors.getSkipPausing());
await waitForState(dbg, () => dbg.selectors.getSkipPausing());
await addBreakpoint(dbg, "simple3.js", 2);
await waitForState(dbg, state => !dbg.selectors.getSkipPausing());
await waitForState(dbg, () => !dbg.selectors.getSkipPausing());
invokeInTab("simple");
await waitForPaused(dbg);
ok(true, "The breakpoint has been hit after a breakpoint was created");
@ -28,13 +28,13 @@ add_task(async function () {
// during a disable
await skipPausing(dbg);
await disableBreakpoint(dbg, 0);
await waitForState(dbg, state => !dbg.selectors.getSkipPausing());
await waitForState(dbg, () => !dbg.selectors.getSkipPausing());
// Then re-enable the breakpoint to ensure skip pausing gets turned off
// during an enable
await skipPausing(dbg);
await waitForState(dbg, state => dbg.selectors.getSkipPausing());
await waitForState(dbg, () => dbg.selectors.getSkipPausing());
toggleBreakpoint(dbg, 0);
await waitForState(dbg, state => !dbg.selectors.getSkipPausing());
await waitForState(dbg, () => !dbg.selectors.getSkipPausing());
await waitForDispatch(dbg.store, "SET_BREAKPOINT");
invokeInTab("simple");
await waitForPaused(dbg);
@ -45,7 +45,7 @@ add_task(async function () {
await addBreakpoint(dbg, "simple3.js", 3);
await skipPausing(dbg);
await disableBreakpoint(dbg, 0);
await waitForState(dbg, state => !dbg.selectors.getSkipPausing());
await waitForState(dbg, () => !dbg.selectors.getSkipPausing());
invokeInTab("simple");
await waitForPaused(dbg);
ok(true, "The breakpoint has been hit after skip pausing was disabled again");
@ -57,7 +57,7 @@ add_task(async function () {
const source = findSource(dbg, "simple3.js");
removeBreakpoint(dbg, source.id, 3);
const wait = waitForDispatch(dbg.store, "TOGGLE_SKIP_PAUSING");
await waitForState(dbg, state => !dbg.selectors.getSkipPausing());
await waitForState(dbg, () => !dbg.selectors.getSkipPausing());
await wait;
invokeInTab("simple");
await waitForPaused(dbg);
@ -70,7 +70,7 @@ add_task(async function () {
function skipPausing(dbg) {
clickElementWithSelector(dbg, ".command-bar-skip-pausing");
return waitForState(dbg, state => dbg.selectors.getSkipPausing());
return waitForState(dbg, () => dbg.selectors.getSkipPausing());
}
function toggleBreakpoint(dbg, index) {

View File

@ -16,7 +16,7 @@ add_task(async function () {
// select "Remove breakpoint"
selectContextMenuItem(dbg, selectors.breakpointContextMenu.remove);
await waitForState(dbg, state => dbg.selectors.getBreakpointCount() === 0);
await waitForState(dbg, () => dbg.selectors.getBreakpointCount() === 0);
ok(true, "successfully removed the breakpoint");
});
@ -34,7 +34,7 @@ add_task(async function () {
// select "Disable Others"
let dispatched = waitForDispatch(dbg.store, "SET_BREAKPOINT", 2);
selectContextMenuItem(dbg, selectors.breakpointContextMenu.disableOthers);
await waitForState(dbg, state =>
await waitForState(dbg, () =>
dbg.selectors
.getBreakpointsList()
.every(bp => (bp.location.line !== 4) === bp.disabled)
@ -46,7 +46,7 @@ add_task(async function () {
// select "Disable All"
dispatched = waitForDispatch(dbg.store, "SET_BREAKPOINT");
selectContextMenuItem(dbg, selectors.breakpointContextMenu.disableAll);
await waitForState(dbg, state =>
await waitForState(dbg, () =>
dbg.selectors.getBreakpointsList().every(bp => bp.disabled)
);
await dispatched;
@ -56,7 +56,7 @@ add_task(async function () {
// select "Enable Others"
dispatched = waitForDispatch(dbg.store, "SET_BREAKPOINT", 2);
selectContextMenuItem(dbg, selectors.breakpointContextMenu.enableOthers);
await waitForState(dbg, state =>
await waitForState(dbg, () =>
dbg.selectors
.getBreakpointsList()
.every(bp => (bp.location.line === 4) === bp.disabled)
@ -70,7 +70,7 @@ add_task(async function () {
selectContextMenuItem(dbg, selectors.breakpointContextMenu.removeOthers);
await waitForState(
dbg,
state =>
() =>
dbg.selectors.getBreakpointsList().length === 1 &&
dbg.selectors.getBreakpointsList()[0].location.line === 4
);

View File

@ -36,7 +36,10 @@ add_task(async function () {
await setConditionalBreakpoint(dbg, 1, "foo2");
info("10. Test removing the breakpoints by clicking in the gutter");
await removeAllBreakpoints(dbg, 32, 0);
await clickGutter(dbg, 32);
await waitForBreakpointCount(dbg, 0);
ok(!findAllElements(dbg, "columnBreakpoints").length);
});
async function enableFirstBreakpoint(dbg) {
@ -106,7 +109,7 @@ async function disableBreakpoint(dbg, index) {
await waitForContextMenu(dbg);
selectContextMenuItem(dbg, selectors.disableItem);
await waitForState(dbg, state => {
await waitForState(dbg, () => {
const bp = dbg.selectors.getBreakpointsList()[index];
return bp.disabled;
});
@ -122,10 +125,3 @@ async function removeFirstBreakpoint(dbg) {
bpMarkers = await waitForAllElements(dbg, "columnBreakpoints");
assertClass(bpMarkers[0], "active", false);
}
async function removeAllBreakpoints(dbg, line, count) {
await clickGutter(dbg, 32);
await waitForBreakpointCount(dbg, 0);
ok(!findAllElements(dbg, "columnBreakpoints").length);
}

View File

@ -20,7 +20,7 @@ add_task(async function () {
await reload(dbg, "doc-duplicate-functions.html");
await waitForState(dbg, state => dbg.selectors.getBreakpointCount() == 1);
await waitForState(dbg, () => dbg.selectors.getBreakpointCount() == 1);
const firstBreakpoint = dbg.selectors.getBreakpointsList()[0];
is(firstBreakpoint.location.line, 21, "Breakpoint is on line 21");

View File

@ -23,7 +23,7 @@ const POPUP_DEBUGGER_STATEMENT_URL = `https://example.com/document-builder.sjs?h
`)}`;
function isPopupPaused(popupBrowsingContext) {
return SpecialPowers.spawn(popupBrowsingContext, [], function (url) {
return SpecialPowers.spawn(popupBrowsingContext, [], function () {
return content.wrappedJSObject.paused;
});
}

View File

@ -38,7 +38,7 @@ add_task(async function () {
await assertPausedAtSourceAndLine(dbg, source.id, 61);
info("The breakpoint for long.js does not exist yet");
await waitForState(dbg, state => dbg.selectors.getBreakpointCount() == 2);
await waitForState(dbg, () => dbg.selectors.getBreakpointCount() == 2);
// The breakpoints are available once their corresponding source
// has been processed. Let's assert that all the breakpoints for
@ -54,7 +54,7 @@ add_task(async function () {
await assertPausedAtSourceAndLine(dbg, source2.id, 1);
info("All 3 breakpoints from simple1.js and long.js still exist");
await waitForState(dbg, state => dbg.selectors.getBreakpointCount() == 3);
await waitForState(dbg, () => dbg.selectors.getBreakpointCount() == 3);
await assertBreakpoint(dbg, 1);
@ -89,7 +89,7 @@ add_task(async function () {
await assertPausedAtSourceAndLine(dbg, source.id, 22);
info("Only the breakpoint for the first inline script should exist");
await waitForState(dbg, state => dbg.selectors.getBreakpointCount() == 1);
await waitForState(dbg, () => dbg.selectors.getBreakpointCount() == 1);
await assertBreakpoint(dbg, 22);
@ -102,7 +102,7 @@ add_task(async function () {
await waitForPaused(dbg);
info("All 2 breakpoints from both inline scripts still exist");
await waitForState(dbg, state => dbg.selectors.getBreakpointCount() == 2);
await waitForState(dbg, () => dbg.selectors.getBreakpointCount() == 2);
await assertPausedAtSourceAndLine(dbg, source.id, 27);
await assertBreakpoint(dbg, 27);

View File

@ -29,7 +29,7 @@ add_task(async function testTracingFunctionReturn() {
const topLevelThreadActorID =
dbg.toolbox.commands.targetCommand.targetFront.threadFront.actorID;
info("Wait for tracing to be enabled");
await waitForState(dbg, state => {
await waitForState(dbg, () => {
return dbg.selectors.getIsThreadCurrentlyTracing(topLevelThreadActorID);
});
@ -42,7 +42,7 @@ add_task(async function testTracingFunctionReturn() {
await clickElement(dbg, "trace");
info("Wait for tracing to be disabled");
await waitForState(dbg, state => {
await waitForState(dbg, () => {
return !dbg.selectors.getIsThreadCurrentlyTracing(topLevelThreadActorID);
});
@ -55,7 +55,7 @@ add_task(async function testTracingFunctionReturn() {
await clickElement(dbg, "trace");
info("Wait for tracing to be re-enabled with logging of returned values");
await waitForState(dbg, state => {
await waitForState(dbg, () => {
return dbg.selectors.getIsThreadCurrentlyTracing(topLevelThreadActorID);
});
@ -81,7 +81,7 @@ add_task(async function testTracingFunctionReturn() {
info("Stop tracing");
await clickElement(dbg, "trace");
await waitForState(dbg, state => {
await waitForState(dbg, () => {
return !dbg.selectors.getIsThreadCurrentlyTracing(topLevelThreadActorID);
});

View File

@ -64,7 +64,7 @@ add_task(async function testTracingOnNextInteraction() {
let topLevelThreadActorID =
dbg.toolbox.commands.targetCommand.targetFront.threadFront.actorID;
info("Wait for tracing to be enabled");
await waitForState(dbg, state => {
await waitForState(dbg, () => {
return dbg.selectors.getIsThreadCurrentlyTracing(topLevelThreadActorID);
});
@ -96,7 +96,7 @@ add_task(async function testTracingOnNextInteraction() {
topLevelThreadActorID =
dbg.toolbox.commands.targetCommand.targetFront.threadFront.actorID;
info("Wait for tracing to be disabled");
await waitForState(dbg, state => {
await waitForState(dbg, () => {
return !dbg.selectors.getIsThreadCurrentlyTracing(topLevelThreadActorID);
});
@ -127,7 +127,7 @@ add_task(async function testInteractionBetweenDebuggerAndConsole() {
const topLevelThreadActorID =
dbg.toolbox.commands.targetCommand.targetFront.threadFront.actorID;
info("Wait for tracing to be enabled");
await waitForState(dbg, state => {
await waitForState(dbg, () => {
return dbg.selectors.getIsThreadCurrentlyTracing(topLevelThreadActorID);
});
@ -159,7 +159,7 @@ add_task(async function testInteractionBetweenDebuggerAndConsole() {
is(msg.textContent.trim(), "Started tracing to Web Console");
info("Wait for tracing to be also enabled in the debugger");
await waitForState(dbg, state => {
await waitForState(dbg, () => {
return dbg.selectors.getIsThreadCurrentlyTracing(topLevelThreadActorID);
});
ok(true, "Debugger also reports the tracing in progress");
@ -172,7 +172,7 @@ add_task(async function testInteractionBetweenDebuggerAndConsole() {
await clickElement(dbg, "trace");
info("Wait for tracing to be disabled per debugger button");
await waitForState(dbg, state => {
await waitForState(dbg, () => {
return dbg.selectors.getIsThreadCurrentlyTracing(topLevelThreadActorID);
});

View File

@ -80,7 +80,7 @@ add_task(async function testTracingOnNextLoad() {
let topLevelThreadActorID =
dbg.toolbox.commands.targetCommand.targetFront.threadFront.actorID;
info("Wait for tracing to be enabled after page reload");
await waitForState(dbg, state => {
await waitForState(dbg, () => {
return dbg.selectors.getIsThreadCurrentlyTracing(topLevelThreadActorID);
});
ok(
@ -105,7 +105,7 @@ add_task(async function testTracingOnNextLoad() {
topLevelThreadActorID =
dbg.toolbox.commands.targetCommand.targetFront.threadFront.actorID;
info("Wait for tracing to be disabled");
await waitForState(dbg, state => {
await waitForState(dbg, () => {
return dbg.selectors.getIsThreadCurrentlyTracing(topLevelThreadActorID);
});
await waitFor(() => {

View File

@ -28,7 +28,7 @@ add_task(async function testTracingValues() {
const topLevelThreadActorID =
dbg.toolbox.commands.targetCommand.targetFront.threadFront.actorID;
info("Wait for tracing to be enabled");
await waitForState(dbg, state => {
await waitForState(dbg, () => {
return dbg.selectors.getIsThreadCurrentlyTracing(topLevelThreadActorID);
});

Some files were not shown because too many files have changed in this diff Show More