From 9e30d1f3f9c799443018e114fcab31cc1ad68623 Mon Sep 17 00:00:00 2001 From: Dave Townsend Date: Tue, 5 Mar 2024 14:21:15 +0000 Subject: [PATCH] Bug 1864896: Autofix unused function arguments (devtools). r=profiler-reviewers,devtools-reviewers,nchevobbe,julienw Differential Revision: https://phabricator.services.mozilla.com/D202959 --- devtools/client/.eslintrc.js | 9 + .../src/actions/debug-targets.js | 4 +- .../aboutdebugging/src/actions/runtimes.js | 4 +- .../aboutdebugging/src/actions/telemetry.js | 2 +- .../client/aboutdebugging/src/actions/ui.js | 10 +- .../components/debugtarget/DebugTargetPane.js | 2 +- .../components/debugtarget/InspectAction.js | 2 +- .../ServiceWorkerAdditionalActions.js | 4 +- .../TemporaryExtensionAdditionalActions.js | 6 +- .../TemporaryExtensionInstaller.js | 2 +- .../middleware/extension-component-data.js | 2 +- .../src/middleware/process-component-data.js | 4 +- .../src/middleware/tab-component-data.js | 2 +- .../src/middleware/worker-component-data.js | 2 +- ...er_aboutdebugging_serviceworker_console.js | 2 +- ...aboutdebugging_sidebar_connection_state.js | 2 +- ...tdebugging_telemetry_connection_attempt.js | 6 +- .../test/browser/mocks/helper-adb-mock.js | 4 +- .../helper-runtime-client-factory-mock.js | 2 +- .../resources/service-workers/fetch-sw.js | 2 +- .../test_runtime_default_preferences.js | 2 +- .../accessibility/accessibility-proxy.js | 2 +- .../accessibility/components/Accessible.js | 2 +- .../client/accessibility/components/Checks.js | 2 +- devtools/client/accessibility/panel.js | 2 +- devtools/client/application/initializer.js | 2 +- .../application/src/actions/manifest.js | 2 +- .../src/components/service-workers/Worker.js | 2 +- .../src/middleware/event-telemetry.js | 2 +- .../src/reducers/manifest-state.js | 2 +- .../client/bin/devtools-node-test-runner.js | 2 +- .../client/debugger/dist/parser-worker.js | 2 +- .../src/actions/ast/setInScopeLines.js | 6 +- .../debugger/src/actions/breakpoints/index.js | 12 +- .../src/actions/breakpoints/syncBreakpoint.js | 2 +- .../context-menus/editor-breakpoint.js | 2 +- .../src/actions/context-menus/frame.js | 4 +- .../debugger/src/actions/expressions.js | 4 +- .../debugger/src/actions/file-search.js | 2 +- .../client/debugger/src/actions/navigation.js | 10 +- .../debugger/src/actions/pause/commands.js | 2 +- .../src/actions/pause/expandScopes.js | 2 +- .../actions/pause/pauseOnDebuggerStatement.js | 2 +- .../src/actions/pause/pauseOnExceptions.js | 2 +- .../debugger/src/actions/pause/resumed.js | 2 +- .../src/actions/pause/tests/pause.spec.js | 4 +- .../client/debugger/src/actions/preview.js | 2 +- .../src/actions/sources/loadSourceText.js | 2 +- .../src/actions/sources/newSources.js | 4 +- .../src/actions/sources/prettyPrint.js | 4 +- .../debugger/src/actions/sources/symbols.js | 2 +- .../src/actions/sources/tests/select.spec.js | 2 +- .../src/actions/tests/expressions.spec.js | 6 +- .../client/debugger/src/actions/toolbox.js | 2 +- devtools/client/debugger/src/actions/ui.js | 12 +- .../src/actions/utils/middleware/context.js | 2 +- .../src/actions/utils/middleware/log.js | 2 +- .../src/actions/utils/middleware/promise.js | 2 +- .../src/actions/utils/middleware/timing.js | 6 +- .../client/debugger/src/client/firefox.js | 2 +- .../debugger/src/client/firefox/commands.js | 2 +- .../src/components/Editor/ConditionalPanel.js | 2 +- .../src/components/Editor/InlinePreview.js | 2 +- .../src/components/Editor/Preview/index.js | 2 +- .../src/components/Editor/SearchInFileBar.js | 12 +- .../debugger/src/components/Editor/index.js | 4 +- .../components/Editor/tests/DebugLine.spec.js | 2 +- .../src/components/PrimaryPanes/Outline.js | 4 +- .../components/PrimaryPanes/ProjectSearch.js | 2 +- .../PrimaryPanes/SourcesTreeItem.js | 2 +- .../debugger/src/components/QuickOpenModal.js | 2 +- .../components/SecondaryPanes/CommandBar.js | 2 +- .../SecondaryPanes/EventListeners.js | 4 +- .../components/SecondaryPanes/Frames/Frame.js | 4 +- .../SecondaryPanes/XHRBreakpoints.js | 6 +- .../src/components/SecondaryPanes/index.js | 4 +- .../tests/XHRBreakpoints.spec.js | 2 +- .../src/components/shared/Dropdown.js | 2 +- .../debugger/src/components/shared/Popover.js | 1 - .../src/components/shared/SmartGap.js | 1 - .../tests/__snapshots__/Popover.spec.js.snap | 4 - devtools/client/debugger/src/main.js | 4 +- .../client/debugger/src/utils/bootstrap.js | 2 +- .../src/utils/editor/source-search.js | 22 +- .../client/debugger/src/utils/test-head.js | 2 +- .../src/workers/parser/mapAwaitExpression.js | 2 +- .../workers/parser/tests/framework.spec.js | 2 +- .../workers/parser/tests/getSymbols.spec.js | 2 +- .../workers/parser/tests/mapBindings.spec.js | 4 +- .../mochitest/browser_dbg-blackbox-all.js | 2 +- .../browser_dbg-breakpoint-skipping.js | 16 +- .../browser_dbg-breakpoints-actions.js | 10 +- .../browser_dbg-breakpoints-columns.js | 14 +- ...ser_dbg-breakpoints-duplicate-functions.js | 2 +- .../browser_dbg-breakpoints-popup.js | 2 +- .../browser_dbg-breakpoints-reloading.js | 8 +- ..._dbg-javascript-tracer-function-returns.js | 8 +- ...r_dbg-javascript-tracer-next-interation.js | 10 +- ...browser_dbg-javascript-tracer-next-load.js | 4 +- .../browser_dbg-javascript-tracer-values.js | 2 +- .../browser_dbg-javascript-tracer-worker.js | 2 +- .../browser_dbg-javascript-tracer.js | 10 +- .../mochitest/browser_dbg-layout-changes.js | 5 +- .../mochitest/browser_dbg-pause-on-next.js | 2 +- .../mochitest/browser_dbg-pause-points.js | 2 +- .../browser_dbg-pretty-print-paused.js | 2 +- .../mochitest/browser_dbg-preview-frame.js | 2 +- .../test/mochitest/browser_dbg-react-app.js | 2 +- .../test/mochitest/browser_dbg-search-file.js | 2 +- .../test/mochitest/browser_dbg-slow-script.js | 2 +- .../browser_dbg-sourcemaps-reloading.js | 5 +- .../test/mochitest/browser_dbg-sourcemaps.js | 2 +- .../test/mochitest/browser_dbg-ua-widgets.js | 2 +- .../browser_dbg-windowless-service-workers.js | 2 +- .../debugger/test/mochitest/shared-head.js | 37 +- devtools/client/dom/content/dom-decorator.js | 2 +- devtools/client/dom/content/reducers/grips.js | 2 +- devtools/client/dom/panel.js | 2 +- .../actions/dom-mutation-breakpoints.js | 6 +- ...er_browser_toolbox_unavailable_children.js | 184 +++-- .../framework/browser-toolbox/window.js | 2 +- .../framework/components/ToolboxTabs.js | 4 +- .../framework/components/ToolboxToolbar.js | 2 +- devtools/client/framework/menu.js | 6 +- .../framework/source-map-url-service.js | 2 +- .../test/browser_devtools_api_destroy.js | 4 +- .../framework/test/browser_target_parents.js | 2 +- .../test/browser_target_server_compartment.js | 6 +- .../test/browser_toolbox_highlight.js | 2 +- ...options_enable_serviceworkers_testing.html | 8 +- ...x_options_enable_serviceworkers_testing.js | 2 +- .../browser_toolbox_options_multiple_tabs.js | 2 +- .../test/browser_toolbox_select_event.js | 2 +- .../browser_toolbox_toolbar_minimum_width.js | 2 +- .../browser_toolbox_window_reload_target.js | 2 +- devtools/client/framework/toolbox-hosts.js | 2 +- devtools/client/framework/toolbox-options.js | 2 +- devtools/client/framework/toolbox.js | 4 +- devtools/client/fronts/css-properties.js | 2 +- devtools/client/fronts/node.js | 2 +- devtools/client/fronts/storage.js | 2 +- .../inspector/animation/components/App.js | 2 +- .../animation/components/NoAnimationPanel.js | 2 +- .../components/PlaybackRateSelector.js | 2 +- ...rowser_animation_keyframes-progress-bar.js | 2 +- .../boxmodel/components/BoxModelInfo.js | 2 +- devtools/client/inspector/breadcrumbs.js | 3 +- .../inspector/changes/reducers/changes.js | 2 +- .../inspector/changes/selectors/changes.js | 31 +- .../compatibility/CompatibilityView.js | 4 +- .../compatibility/actions/compatibility.js | 2 +- .../compatibility/reducers/compatibility.js | 2 +- .../client/inspector/computed/computed.js | 2 +- .../test/browser_computed_keybindings_01.js | 2 +- .../components/FlexItemSizingProperties.js | 6 +- .../inspector/flexbox/reducers/flexbox.js | 2 +- .../inspector/fonts/reducers/font-editor.js | 2 +- .../inspector/grids/components/GridOutline.js | 2 +- devtools/client/inspector/markup/markup.js | 8 +- .../markup/test/browser_markup_tag_edit_07.js | 18 +- devtools/client/inspector/node-picker.js | 6 +- ...rowser_rules_colorpicker-contrast-ratio.js | 4 - ...owser_rules_edit-size-property-dragging.js | 5 +- .../browser_rules_original-source-link.js | 2 +- .../browser_rules_original-source-link2.js | 2 +- .../inspector/rules/views/rule-editor.js | 6 +- .../rules/views/text-property-editor.js | 10 +- .../inspector/shared/highlighters-overlay.js | 9 +- ...nspector_highlighter-autohide-config_03.js | 2 +- ...inspector_highlighter-eyedropper-events.js | 6 +- ..._inspector_highlighter-eyedropper-label.js | 4 +- ...owser_inspector_highlighter-geometry_01.js | 1 - ...rowser_inspector_highlighter-measure_03.js | 6 +- ...rowser_inspector_highlighter-measure_04.js | 6 +- devtools/client/inspector/toolsidebar.js | 4 +- devtools/client/jsonview/Sniffer.sys.mjs | 2 +- .../client/jsonview/components/Headers.js | 2 +- .../jsonview/components/HeadersPanel.js | 2 +- .../jsonview/components/HeadersToolbar.js | 4 +- .../client/jsonview/components/JsonPanel.js | 4 +- .../client/jsonview/components/JsonToolbar.js | 10 +- .../client/jsonview/components/LiveText.js | 2 +- .../jsonview/components/MainTabbedArea.js | 2 +- .../client/jsonview/components/SearchBox.js | 2 +- .../client/jsonview/components/TextPanel.js | 2 +- .../client/jsonview/components/TextToolbar.js | 8 +- .../jsonview/components/reps/Toolbar.js | 2 +- devtools/client/jsonview/converter-child.js | 8 +- devtools/client/jsonview/json-viewer.js | 8 +- .../test/browser_jsonview_expand_collapse.js | 2 +- .../test/browser_jsonview_serviceworker.js | 2 +- .../client/memory/actions/census-display.js | 2 +- devtools/client/memory/actions/filter.js | 2 +- devtools/client/memory/actions/io.js | 6 +- .../client/memory/actions/label-display.js | 2 +- devtools/client/memory/actions/snapshot.js | 4 +- .../client/memory/actions/tree-map-display.js | 2 +- devtools/client/memory/actions/view.js | 4 +- .../memory/components/CensusTreeItem.js | 2 +- .../client/memory/components/DominatorTree.js | 6 +- .../memory/components/DominatorTreeItem.js | 2 +- .../client/memory/components/Individuals.js | 6 +- devtools/client/memory/components/TreeMap.js | 2 +- .../memory/components/tree-map/drag-zoom.js | 3 +- devtools/client/memory/models.js | 2 +- .../client/memory/reducers/allocations.js | 10 +- .../client/memory/reducers/individuals.js | 2 +- ...rowser_memory_allocationStackDisplay_01.js | 2 +- ...rowser_memory_allocationStackDisplay_02.js | 2 +- .../browser/browser_memory_clear_snapshots.js | 2 +- .../test/browser/browser_memory_diff_01.js | 2 +- .../browser/browser_memory_displays_01.js | 2 +- .../browser_memory_dominator_trees_01.js | 2 +- .../test/browser/browser_memory_filter_01.js | 2 +- .../browser/browser_memory_individuals_01.js | 2 +- .../test/browser/browser_memory_keyboard.js | 2 +- .../browser_memory_no_allocation_stacks.js | 2 +- .../browser/browser_memory_no_auto_expand.js | 2 +- .../browser/browser_memory_percents_01.js | 2 +- .../browser_memory_refresh_does_not_leak.js | 2 +- .../test/browser/browser_memory_simple_01.js | 2 +- ...ser_memory_transferHeapSnapshot_e10s_01.js | 2 +- .../browser/browser_memory_tree_map-01.js | 2 +- .../browser/browser_memory_tree_map-02.js | 2 +- devtools/client/menus.js | 2 +- .../src/actions/http-custom-request.js | 2 +- .../src/actions/request-blocking.js | 4 +- .../client/netmonitor/src/actions/search.js | 10 +- devtools/client/netmonitor/src/app.js | 2 +- .../src/components/CustomRequestPanel.js | 2 +- .../src/components/StatisticsPanel.js | 2 +- .../netmonitor/src/components/Toolbar.js | 2 +- .../new-request/HTTPCustomRequestPanel.js | 6 +- .../request-details/HeadersPanel.js | 2 +- .../request-details/ResponsePanel.js | 4 +- .../request-details/TimingsPanel.js | 2 +- .../src/connector/firefox-data-provider.js | 2 +- .../netmonitor/src/har/har-automation.js | 6 +- .../client/netmonitor/src/har/har-builder.js | 2 +- .../netmonitor/src/har/har-collector.js | 2 +- .../client/netmonitor/src/har/har-exporter.js | 2 +- .../test/browser_net_har_copy_all_as_har.js | 3 +- .../test/html_har_post-data-test-page.html | 2 +- .../netmonitor/src/middleware/batching.js | 2 +- .../client/netmonitor/src/middleware/prefs.js | 4 +- .../netmonitor/src/middleware/throttling.js | 2 +- .../netmonitor/src/reducers/messages.js | 2 +- .../src/reducers/request-blocking.js | 6 +- .../netmonitor/src/reducers/timing-markers.js | 2 +- .../src/utils/context-menu-utils.js | 2 +- .../test/browser_net_cached-status.js | 2 +- .../netmonitor/test/browser_net_curl-utils.js | 2 +- .../test/browser_net_header-docs.js | 4 +- .../test/browser_net_prefs-reload.js | 4 +- .../test/browser_net_simple-request-data.js | 740 +++++++++--------- devtools/client/netmonitor/test/head.js | 12 +- .../netmonitor/test/html_custom-get-page.html | 2 +- .../netmonitor/test/html_pause-test-page.html | 2 +- .../test/html_post-json-test-page.html | 2 +- .../netmonitor/test/html_sse-test-page.html | 2 +- .../test/html_ws-sse-test-page.html | 6 +- .../netmonitor/test/html_ws-test-page.html | 4 +- .../test/service-workers/status-codes.html | 2 +- .../client/performance-new/panel/panel.js | 4 +- .../performance-new/popup/menu-button.sys.mjs | 8 +- .../performance-new/shared/background.sys.mjs | 2 +- .../client/performance-new/store/actions.js | 4 +- ...er_webchannel-enable-menu-button-preset.js | 2 +- .../browser_webchannel-enable-menu-button.js | 2 +- .../client/responsive/reducers/devices.js | 6 +- .../client/responsive/reducers/screenshot.js | 4 +- .../browser_device_pixel_ratio_change.js | 2 +- .../browser/browser_device_state_restore.js | 4 +- .../test/browser/browser_ext_messaging.js | 2 +- .../test/browser/browser_many_toggles.js | 2 +- .../browser/browser_network_throttling.js | 2 +- .../test/browser/browser_page_style.js | 2 +- .../test/browser/browser_picker_link.js | 2 +- .../browser/browser_touch_event_iframes.js | 2 +- .../test/browser/browser_typeahead_find.js | 2 +- .../browser/browser_viewport_changed_meta.js | 2 +- .../browser/browser_viewport_zoom_toggle.js | 2 +- .../responsive/test/browser/geolocation.html | 2 +- .../client/responsive/test/browser/touch.html | 8 +- devtools/client/responsive/ui.js | 4 +- devtools/client/shared/async-store-helper.js | 2 +- devtools/client/shared/autocomplete-popup.js | 2 +- devtools/client/shared/components/Tree.js | 6 +- .../shared/components/VirtualizedTree.js | 8 +- .../client/shared/components/menu/MenuList.js | 2 +- .../components/reps/reps/element-node.js | 2 +- .../shared/components/reps/reps/error.js | 2 +- .../shared/components/reps/reps/function.js | 2 +- .../shared/components/reps/reps/grip-map.js | 2 +- .../shared/components/reps/reps/grip.js | 2 +- .../shared/components/reps/reps/text-node.js | 4 +- .../client/shared/components/tabs/TabBar.js | 4 +- .../client/shared/components/tabs/Tabs.js | 2 +- .../test/chrome/test_notification_box_04.html | 2 +- .../test/chrome/test_notification_box_05.html | 2 +- .../test/node/__mocks__/object-front.js | 4 +- .../test/node/components/tree.test.js | 8 +- .../shared/components/tree/ObjectProvider.js | 2 +- .../client/shared/fluent-l10n/fluent-l10n.js | 4 +- devtools/client/shared/output-parser.js | 2 +- .../shared/redux/middleware/debounce.js | 2 +- .../client/shared/redux/middleware/log.js | 2 +- .../client/shared/redux/middleware/promise.js | 2 +- .../xpcshell/test_middleware-task-02.js | 2 +- .../xpcshell/test_middleware-task-03.js | 2 +- .../remote-debugging/adb/adb-process.js | 2 +- .../adb/adb-running-checker.js | 6 +- .../remote-debugging/adb/commands/shell.js | 6 +- .../source-map-loader/wasm-dwarf/wasmAsset.js | 2 +- .../test/browser_editor_autocomplete_basic.js | 6 +- devtools/client/shared/stylesheet-utils.js | 2 +- .../test-helpers/jest-fixtures/Services.js | 4 +- .../test-helpers/shared-node-helpers.js | 2 +- .../shared/test/browser_cubic-bezier-02.js | 2 +- .../shared/test/browser_cubic-bezier-06.js | 2 +- .../shared/test/browser_dbg_listworkers.js | 4 +- .../shared/test/browser_inplace-editor-01.js | 6 +- .../shared/test/browser_key_shortcuts.js | 2 +- .../client/shared/test/browser_spectrum.js | 7 +- .../browser_telemetry_button_eyedropper.js | 2 +- .../shared/test/browser_treeWidget_basic.js | 6 +- .../shared/test/doc_event-listeners-01.html | 8 +- .../shared/test/doc_event-listeners-03.html | 4 +- ...oc_layoutHelpers_getBoxQuads2-c-and-e.html | 2 +- .../shared/test/doc_native-event-handler.html | 2 +- .../shared/test/highlighter-test-actor.js | 2 +- devtools/client/shared/undo.js | 2 +- devtools/client/shared/widgets/TableWidget.js | 2 +- devtools/client/shared/workers-listener.js | 2 +- devtools/client/storage/VariablesView.sys.mjs | 12 +- .../test/browser_storage_cookies_sort.js | 2 +- .../test/storage-empty-objectstores.html | 4 +- .../test/storage-idb-delete-blocked.html | 4 +- .../test/storage-indexeddb-iframe.html | 2 +- .../test/storage-indexeddb-simple-alt.html | 2 +- .../test/storage-indexeddb-simple.html | 2 +- devtools/client/storage/ui.js | 4 +- .../client/styleeditor/StyleEditorUI.sys.mjs | 2 +- .../styleeditor/StyleSheetEditor.sys.mjs | 2 +- .../test/iframe_with_service_worker.html | 2 +- devtools/client/webconsole/actions/input.js | 2 +- .../components/FilterBar/FilterBar.js | 2 +- .../components/Input/EagerEvaluation.js | 2 +- .../webconsole/components/Input/JSTerm.js | 3 +- .../components/Output/ConsoleOutput.js | 6 +- .../components/Output/ConsoleTable.js | 2 +- .../components/Output/GripMessageBody.js | 2 +- .../components/Output/LazyMessageList.js | 4 +- .../Output/message-types/DefaultRenderer.js | 2 +- .../client/webconsole/components/SideBar.js | 2 +- .../client/webconsole/reducers/history.js | 2 +- .../browser/browser_webconsole_cors_errors.js | 2 +- .../browser_webconsole_message_categories.js | 2 +- .../browser_webconsole_network_attach.js | 2 +- ...console_network_message_close_on_escape.js | 2 +- ...network_messages_after_target_switching.js | 2 +- ...wser_webconsole_network_messages_expand.js | 2 +- ...r_webconsole_network_messages_openinnet.js | 2 +- ...console_network_messages_resend_request.js | 2 +- ...es_stacktrace_console_initiated_request.js | 2 +- ...webconsole_network_messages_status_code.js | 4 +- ...bconsole_object_inspector_array_getters.js | 4 +- ...r_webconsole_shows_reqs_from_netmonitor.js | 2 +- ...ser_webconsole_shows_reqs_in_netmonitor.js | 2 +- ...er_webconsole_trackingprotection_errors.js | 2 +- ...bconsole_warning_group_content_blocking.js | 2 +- ...rowser_webconsole_warning_group_cookies.js | 2 +- ...console_warning_group_storage_isolation.js | 2 +- ...ser_webconsole_warning_groups_filtering.js | 2 +- ...rowser_webconsole_warning_groups_toggle.js | 2 +- ...test-console-custom-formatters-errors.html | 4 +- .../test-console-custom-formatters.html | 8 +- ...ole-evaluation-context-selector-child.html | 2 +- .../test/browser/test-error-worker2.js | 2 +- .../test/browser/test-eval-error.html | 2 +- .../test/browser/test-evaluate-worker.js | 2 + .../components/webconsole-wrapper.test.js | 2 +- .../client/webconsole/test/node/helpers.js | 2 +- devtools/client/webconsole/webconsole-ui.js | 8 +- .../addon/webextension-inspected-window.js | 4 +- devtools/server/actors/animation.js | 2 +- devtools/server/actors/breakpoint.js | 2 +- .../server/actors/descriptors/webextension.js | 2 +- devtools/server/actors/heap-snapshot-file.js | 2 +- devtools/server/actors/highlighters/shapes.js | 19 +- .../actors/inspector/event-collector.js | 2 +- devtools/server/actors/inspector/inspector.js | 2 +- devtools/server/actors/inspector/walker.js | 4 +- .../network-monitor/network-event-actor.js | 7 +- devtools/server/actors/objects-manager.js | 2 +- devtools/server/actors/preference.js | 2 +- devtools/server/actors/reflow.js | 4 +- .../extensions-backgroundscript-status.js | 2 +- .../resources/network-events-content.js | 2 +- .../resources/network-events-stacktraces.js | 7 +- .../parent-process-document-event.js | 2 +- .../actors/resources/server-sent-events.js | 2 +- .../resources/storage/extension-storage.js | 2 +- .../actors/resources/storage/indexed-db.js | 2 +- .../server/actors/resources/thread-states.js | 2 +- .../utils/nsi-console-listener-watcher.js | 10 +- .../server/actors/resources/websockets.js | 4 +- .../server/actors/targets/content-process.js | 2 +- .../session-data-processors/blackboxing.js | 2 +- .../session-data-processors/breakpoints.js | 2 +- .../event-breakpoints.js | 2 +- .../session-data-processors/resources.js | 2 +- .../target-configuration.js | 9 +- .../thread-configuration.js | 9 +- .../xhr-breakpoints.js | 2 +- .../targets/target-actor-registry.sys.mjs | 2 +- .../server/actors/targets/window-global.js | 15 +- devtools/server/actors/thread.js | 10 +- devtools/server/actors/tracer.js | 8 +- .../actors/utils/inactive-property-helper.js | 5 +- devtools/server/actors/webbrowser.js | 12 +- devtools/server/actors/webconsole.js | 2 +- .../actors/webconsole/commands/manager.js | 4 +- .../actors/webconsole/eval-with-debugger.js | 2 +- .../listeners/console-file-activity.js | 2 +- .../webconsole/listeners/document-events.js | 10 +- .../service-worker-registration-list.js | 4 +- .../worker/service-worker-registration.js | 2 +- .../connectors/content-process-connector.js | 10 +- devtools/server/connectors/frame-connector.js | 2 +- .../DevToolsWorkerParent.sys.mjs | 6 +- .../DevToolsServiceWorkerParent.sys.mjs | 6 +- devtools/server/socket/websocket-server.js | 4 +- .../server/startup/content-process-script.js | 2 +- .../tests/browser/browser_connectToFrame.js | 2 +- .../tests/browser/browser_debugger_server.js | 2 +- .../tests/browser/browser_storage_updates.js | 2 +- .../server/tests/chrome/memory-helpers.js | 2 +- .../tests/chrome/suspendTimeouts_content.js | 2 +- .../tests/chrome/test_inspector-hide.html | 2 +- .../test_inspector-pseudoclass-lock.html | 2 +- .../chrome/test_memory_allocations_04.html | 2 +- .../tests/chrome/test_suspendTimeouts.js | 2 +- .../tests/xpcshell/registertestactors-lazy.js | 4 +- .../tests/xpcshell/test_blackboxing-01.js | 2 +- .../tests/xpcshell/test_blackboxing-02.js | 2 +- .../tests/xpcshell/test_blackboxing-05.js | 2 +- .../tests/xpcshell/test_breakpoint-03.js | 2 +- .../tests/xpcshell/test_breakpoint-05.js | 2 +- .../tests/xpcshell/test_breakpoint-06.js | 2 +- .../tests/xpcshell/test_breakpoint-07.js | 2 +- .../tests/xpcshell/test_breakpoint-08.js | 2 +- .../tests/xpcshell/test_breakpoint-09.js | 2 +- .../tests/xpcshell/test_breakpoint-11.js | 2 +- .../tests/xpcshell/test_breakpoint-12.js | 4 +- .../tests/xpcshell/test_breakpoint-14.js | 2 +- .../tests/xpcshell/test_breakpoint-16.js | 2 +- .../tests/xpcshell/test_client_request.js | 2 +- .../test_conditional_breakpoint-04.js | 2 +- .../server/tests/xpcshell/test_dbgglobal.js | 4 +- .../tests/xpcshell/test_forwardingprefix.js | 6 +- .../tests/xpcshell/test_framearguments-01.js | 2 + .../tests/xpcshell/test_framebindings-07.js | 2 +- .../tests/xpcshell/test_functiongrips-01.js | 2 + .../server/tests/xpcshell/test_interrupt.js | 2 +- .../server/tests/xpcshell/test_logpoint-03.js | 2 +- .../tests/xpcshell/test_longstringgrips-01.js | 2 + .../tests/xpcshell/test_objectgrips-02.js | 2 + .../tests/xpcshell/test_objectgrips-03.js | 2 + .../tests/xpcshell/test_objectgrips-04.js | 2 + .../tests/xpcshell/test_objectgrips-05.js | 2 + .../tests/xpcshell/test_objectgrips-06.js | 2 + .../tests/xpcshell/test_objectgrips-07.js | 2 + .../tests/xpcshell/test_objectgrips-08.js | 2 + .../tests/xpcshell/test_objectgrips-16.js | 2 + .../tests/xpcshell/test_objectgrips-17.js | 2 + .../tests/xpcshell/test_objectgrips-18.js | 2 + .../tests/xpcshell/test_objectgrips-19.js | 4 +- .../tests/xpcshell/test_objectgrips-20.js | 2 + .../tests/xpcshell/test_objectgrips-21.js | 2 + .../tests/xpcshell/test_objectgrips-22.js | 2 + .../tests/xpcshell/test_objectgrips-25.js | 2 + .../xpcshell/test_objectgrips-fn-apply-01.js | 2 + .../xpcshell/test_objectgrips-fn-apply-02.js | 2 + .../xpcshell/test_objectgrips-fn-apply-03.js | 2 + .../test_objectgrips-nested-promise.js | 2 + .../xpcshell/test_objectgrips-nested-proxy.js | 2 + .../test_objectgrips-property-value-01.js | 2 + .../test_objectgrips-property-value-02.js | 2 + .../xpcshell/test_objectgrips-sparse-array.js | 2 + .../xpcshell/test_pause_exceptions-04.js | 2 +- .../tests/xpcshell/test_pauselifetime-02.js | 2 + .../tests/xpcshell/test_pauselifetime-03.js | 2 + .../tests/xpcshell/test_pauselifetime-04.js | 2 + .../test_promises_run_to_completion.js | 4 +- .../tests/xpcshell/test_restartFrame-01.js | 2 +- .../server/tests/xpcshell/test_source-01.js | 2 + .../server/tests/xpcshell/test_source-02.js | 2 + .../server/tests/xpcshell/test_source-03.js | 4 +- .../server/tests/xpcshell/test_source-04.js | 4 +- .../server/tests/xpcshell/test_stepping-01.js | 2 +- .../server/tests/xpcshell/test_stepping-18.js | 2 +- .../server/tests/xpcshell/test_stepping-19.js | 2 +- .../tests/xpcshell/test_threadlifetime-01.js | 2 + .../tests/xpcshell/test_threadlifetime-02.js | 2 + .../tests/xpcshell/test_threadlifetime-04.js | 2 + .../tests/xpcshell/test_wasm_source-01.js | 4 +- devtools/server/tests/xpcshell/testactors.js | 6 +- .../tests/browser/browser_worker_tracer.js | 2 +- devtools/shared/async-utils.js | 2 +- .../legacy-listeners/thread-states.js | 2 +- .../commands/resource/resource-command.js | 10 +- .../tests/browser_resources_css_changes.js | 2 +- ...ser_resources_css_registered_properties.js | 2 +- .../tests/browser_resources_network_events.js | 2 +- ...browser_resources_target_resources_race.js | 2 +- .../commands/resource/tests/sse_frontend.html | 2 +- .../resource/tests/sse_frontend_iframe.html | 2 +- .../resource/tests/test_service_worker.js | 2 +- .../shared/commands/target/actions/targets.js | 2 +- .../tests/browser_target_command_bfcache.js | 2 +- .../tests/browser_target_command_frames.js | 2 +- .../target/tests/test_service_worker.js | 2 +- .../thread-configuration-command.js | 2 +- devtools/shared/content-observer.js | 4 +- devtools/shared/css/lexer.js | 4 +- .../tests/xpcshell/test_discovery.js | 2 +- devtools/shared/heapsnapshot/CensusUtils.js | 16 +- .../shared/heapsnapshot/DominatorTreeNode.js | 6 +- .../shared/heapsnapshot/census-tree-node.js | 4 +- .../tests/xpcshell/dominator-tree-worker.js | 2 +- .../tests/xpcshell/heap-snapshot-worker.js | 2 +- .../network-observer/NetworkObserver.sys.mjs | 4 +- .../NetworkResponseListener.sys.mjs | 2 +- .../browser_networkobserver_auth_listener.js | 6 +- ...twork-observer-missing-service-worker.html | 4 +- .../test/browser/doc_network-observer.html | 2 +- .../network-observer/test/browser/head.js | 2 +- devtools/shared/platform/CacheEntry.sys.mjs | 4 +- devtools/shared/protocol/Actor.js | 4 +- devtools/shared/protocol/Front.js | 2 +- .../tests/xpcshell/test_protocol_async.js | 4 +- .../tests/xpcshell/test_protocol_children.js | 10 +- .../xpcshell/test_protocol_longstring.js | 2 +- devtools/shared/protocol/types.js | 4 +- .../shared/test-helpers/allocation-tracker.js | 4 +- devtools/shared/test-helpers/test-stepper.js | 2 +- .../xpcshell/test_eventemitter_static.js | 2 +- devtools/shared/transport/packets.js | 2 +- .../tests/xpcshell/test_bulk_error.js | 2 +- .../tests/xpcshell/test_dbgsocket.js | 4 +- .../test_dbgsocket_connection_drop.js | 4 +- .../transport/tests/xpcshell/test_queue.js | 2 +- .../tests/xpcshell/test_transport_bulk.js | 2 +- .../shared/webconsole/js-property-provider.js | 2 +- .../shared/webconsole/test/chrome/common.js | 2 +- .../test/chrome/helper_serviceworker.js | 4 +- .../chrome/test_console_serviceworker.html | 4 +- .../test/chrome/test_console_styling.html | 4 +- .../test/chrome/test_consoleapi.html | 4 +- .../test/chrome/test_consoleapi_innerID.html | 2 +- .../chrome/test_network_security-hsts.html | 2 +- .../worker/tests/browser/browser_worker-03.js | 4 +- devtools/shared/worker/worker.js | 286 ++++--- .../AboutDebuggingRegistration.sys.mjs | 2 +- .../AboutDevToolsToolboxRegistration.sys.mjs | 2 +- devtools/startup/DevToolsStartup.sys.mjs | 4 +- .../browser/browser_shim_disable_devtools.js | 2 +- 568 files changed, 1527 insertions(+), 1629 deletions(-) diff --git a/devtools/client/.eslintrc.js b/devtools/client/.eslintrc.js index 81eb6568ee5b..e5e1918b86ff 100644 --- a/devtools/client/.eslintrc.js +++ b/devtools/client/.eslintrc.js @@ -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", + }, + }, + ], }; diff --git a/devtools/client/aboutdebugging/src/actions/debug-targets.js b/devtools/client/aboutdebugging/src/actions/debug-targets.js index 7a61641e213e..fa768c3d22e5 100644 --- a/devtools/client/aboutdebugging/src/actions/debug-targets.js +++ b/devtools/client/aboutdebugging/src/actions/debug-targets.js @@ -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 diff --git a/devtools/client/aboutdebugging/src/actions/runtimes.js b/devtools/client/aboutdebugging/src/actions/runtimes.js index fba620951ecb..52148f80b280 100644 --- a/devtools/client/aboutdebugging/src/actions/runtimes.js +++ b/devtools/client/aboutdebugging/src/actions/runtimes.js @@ -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 diff --git a/devtools/client/aboutdebugging/src/actions/telemetry.js b/devtools/client/aboutdebugging/src/actions/telemetry.js index b418c77a50f8..d90b5f49e14b 100644 --- a/devtools/client/aboutdebugging/src/actions/telemetry.js +++ b/devtools/client/aboutdebugging/src/actions/telemetry.js @@ -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 }); }; } diff --git a/devtools/client/aboutdebugging/src/actions/ui.js b/devtools/client/aboutdebugging/src/actions/ui.js index fb676cefd63f..f8afac8bbd3f 100644 --- a/devtools/client/aboutdebugging/src/actions/ui.js +++ b/devtools/client/aboutdebugging/src/actions/ui.js @@ -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 { diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetPane.js b/devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetPane.js index abfa1042b8ef..dec9cd792dec 100644 --- a/devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetPane.js +++ b/devtools/client/aboutdebugging/src/components/debugtarget/DebugTargetPane.js @@ -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" }, diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/InspectAction.js b/devtools/client/aboutdebugging/src/components/debugtarget/InspectAction.js index f7aff438a4f8..13370ecdf390 100644 --- a/devtools/client/aboutdebugging/src/components/debugtarget/InspectAction.js +++ b/devtools/client/aboutdebugging/src/components/debugtarget/InspectAction.js @@ -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, diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/ServiceWorkerAdditionalActions.js b/devtools/client/aboutdebugging/src/components/debugtarget/ServiceWorkerAdditionalActions.js index 38262ad5116f..aed0719d1fda 100644 --- a/devtools/client/aboutdebugging/src/components/debugtarget/ServiceWorkerAdditionalActions.js +++ b/devtools/client/aboutdebugging/src/components/debugtarget/ServiceWorkerAdditionalActions.js @@ -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 ) diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionAdditionalActions.js b/devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionAdditionalActions.js index 44b7d3e167c4..806ddb6ac9c0 100644 --- a/devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionAdditionalActions.js +++ b/devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionAdditionalActions.js @@ -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" ) diff --git a/devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionInstaller.js b/devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionInstaller.js index e515c647ec9c..fe229d2da689 100644 --- a/devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionInstaller.js +++ b/devtools/client/aboutdebugging/src/components/debugtarget/TemporaryExtensionInstaller.js @@ -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…" ) diff --git a/devtools/client/aboutdebugging/src/middleware/extension-component-data.js b/devtools/client/aboutdebugging/src/middleware/extension-component-data.js index 5987f36398f8..53e6fd22f10b 100644 --- a/devtools/client/aboutdebugging/src/middleware/extension-component-data.js +++ b/devtools/client/aboutdebugging/src/middleware/extension-component-data.js @@ -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); diff --git a/devtools/client/aboutdebugging/src/middleware/process-component-data.js b/devtools/client/aboutdebugging/src/middleware/process-component-data.js index d5cdc6365bcc..c4947453a0cd 100644 --- a/devtools/client/aboutdebugging/src/middleware/process-component-data.js +++ b/devtools/client/aboutdebugging/src/middleware/process-component-data.js @@ -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"; diff --git a/devtools/client/aboutdebugging/src/middleware/tab-component-data.js b/devtools/client/aboutdebugging/src/middleware/tab-component-data.js index f468926f81a2..2de8dca86f21 100644 --- a/devtools/client/aboutdebugging/src/middleware/tab-component-data.js +++ b/devtools/client/aboutdebugging/src/middleware/tab-component-data.js @@ -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); diff --git a/devtools/client/aboutdebugging/src/middleware/worker-component-data.js b/devtools/client/aboutdebugging/src/middleware/worker-component-data.js index 178c99e32288..cf13eccd5deb 100644 --- a/devtools/client/aboutdebugging/src/middleware/worker-component-data.js +++ b/devtools/client/aboutdebugging/src/middleware/worker-component-data.js @@ -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); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_console.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_console.js index 742791668dc1..4fd0b727d694 100644 --- a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_console.js +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_console.js @@ -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 () { diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_connection_state.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_connection_state.js index d4d31a75226f..757f59689188 100644 --- a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_connection_state.js +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_connection_state.js @@ -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"); }; diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_connection_attempt.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_connection_attempt.js index a5836ad50a02..925ab624798b 100644 --- a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_connection_attempt.js +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_connection_attempt.js @@ -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"); diff --git a/devtools/client/aboutdebugging/test/browser/mocks/helper-adb-mock.js b/devtools/client/aboutdebugging/test/browser/mocks/helper-adb-mock.js index f02ca02ee33a..fce594684c7e 100644 --- a/devtools/client/aboutdebugging/test/browser/mocks/helper-adb-mock.js +++ b/devtools/client/aboutdebugging/test/browser/mocks/helper-adb-mock.js @@ -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"); }; diff --git a/devtools/client/aboutdebugging/test/browser/mocks/helper-runtime-client-factory-mock.js b/devtools/client/aboutdebugging/test/browser/mocks/helper-runtime-client-factory-mock.js index b74c229fcf57..29d7b0ad4df2 100644 --- a/devtools/client/aboutdebugging/test/browser/mocks/helper-runtime-client-factory-mock.js +++ b/devtools/client/aboutdebugging/test/browser/mocks/helper-runtime-client-factory-mock.js @@ -67,7 +67,7 @@ function disableRuntimeClientFactoryMock() { */ function createRuntimeClientFactoryMock() { const RuntimeClientFactoryMock = {}; - RuntimeClientFactoryMock.createClientForRuntime = function (runtime) { + RuntimeClientFactoryMock.createClientForRuntime = function () { console.log("MOCKED METHOD createClientForRuntime"); }; diff --git a/devtools/client/aboutdebugging/test/browser/resources/service-workers/fetch-sw.js b/devtools/client/aboutdebugging/test/browser/resources/service-workers/fetch-sw.js index de6ee1fb3295..8e71e3b10881 100644 --- a/devtools/client/aboutdebugging/test/browser/resources/service-workers/fetch-sw.js +++ b/devtools/client/aboutdebugging/test/browser/resources/service-workers/fetch-sw.js @@ -1,6 +1,6 @@ "use strict"; // Bug 1328293 -self.onfetch = function (event) { +self.onfetch = function () { // do nothing. }; diff --git a/devtools/client/aboutdebugging/test/xpcshell/test_runtime_default_preferences.js b/devtools/client/aboutdebugging/test/xpcshell/test_runtime_default_preferences.js index 637e42e078e1..465e11a43bb5 100644 --- a/devtools/client/aboutdebugging/test/xpcshell/test_runtime_default_preferences.js +++ b/devtools/client/aboutdebugging/test/xpcshell/test_runtime_default_preferences.js @@ -194,7 +194,7 @@ add_task(async function test_without_traits_with_error() { function createClientWrapper(preferencesFront) { const clientWrapper = { - getFront: name => { + getFront: () => { return preferencesFront; }, }; diff --git a/devtools/client/accessibility/accessibility-proxy.js b/devtools/client/accessibility/accessibility-proxy.js index 287ea44b71db..e96d9125938c 100644 --- a/devtools/client/accessibility/accessibility-proxy.js +++ b/devtools/client/accessibility/accessibility-proxy.js @@ -518,7 +518,7 @@ class AccessibilityProxy { } } - async onTargetAvailable({ targetFront, isTargetSwitching }) { + async onTargetAvailable({ targetFront }) { targetFront.watchFronts( "accessibility", this.onAccessibilityFrontAvailable, diff --git a/devtools/client/accessibility/components/Accessible.js b/devtools/client/accessibility/components/Accessible.js index 02467ccaab45..c679951d1d9f 100644 --- a/devtools/client/accessibility/components/Accessible.js +++ b/devtools/client/accessibility/components/Accessible.js @@ -285,7 +285,7 @@ class Accessible extends Component { window.emit(EVENTS.NEW_ACCESSIBLE_FRONT_INSPECTED); } - openLink(link, e) { + openLink(link) { openContentLink(link); } diff --git a/devtools/client/accessibility/components/Checks.js b/devtools/client/accessibility/components/Checks.js index f2b4e4835acb..7f7bdf16244d 100644 --- a/devtools/client/accessibility/components/Checks.js +++ b/devtools/client/accessibility/components/Checks.js @@ -105,7 +105,7 @@ class Checks extends Component { } } -const mapStateToProps = ({ details, ui }) => { +const mapStateToProps = ({ details }) => { const { audit } = details; if (!audit) { return {}; diff --git a/devtools/client/accessibility/panel.js b/devtools/client/accessibility/panel.js index 02c6c8f415dd..3ebd11afe11b 100644 --- a/devtools/client/accessibility/panel.js +++ b/devtools/client/accessibility/panel.js @@ -286,7 +286,7 @@ AccessibilityPanel.prototype = { this._toolbox.component.setToolboxButtons(this._toolbox.toolbarButtons); }, - togglePicker(focus) { + togglePicker() { this.picker && this.picker.toggle(); }, diff --git a/devtools/client/application/initializer.js b/devtools/client/application/initializer.js index fbfcbc1edcf5..c431945bf099 100644 --- a/devtools/client/application/initializer.js +++ b/devtools/client/application/initializer.js @@ -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); diff --git a/devtools/client/application/src/actions/manifest.js b/devtools/client/application/src/actions/manifest.js index 050fab2b8991..ccb62ff13cab 100644 --- a/devtools/client/application/src/actions/manifest.js +++ b/devtools/client/application/src/actions/manifest.js @@ -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(); diff --git a/devtools/client/application/src/components/service-workers/Worker.js b/devtools/client/application/src/components/service-workers/Worker.js index bc95e084a9a0..51cb45c1a63c 100644 --- a/devtools/client/application/src/components/service-workers/Worker.js +++ b/devtools/client/application/src/components/service-workers/Worker.js @@ -118,7 +118,7 @@ class Worker extends PureComponent { return this.props.worker.stateText; } - getClassNameForStatus(baseClass) { + getClassNameForStatus() { const { state } = this.props.worker; switch (state) { diff --git a/devtools/client/application/src/middleware/event-telemetry.js b/devtools/client/application/src/middleware/event-telemetry.js index 60129d2bde00..aa4aa7b62bde 100644 --- a/devtools/client/application/src/middleware/event-telemetry.js +++ b/devtools/client/application/src/middleware/event-telemetry.js @@ -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: diff --git a/devtools/client/application/src/reducers/manifest-state.js b/devtools/client/application/src/reducers/manifest-state.js index 61a2fa67599b..1f7fbf0bb61c 100644 --- a/devtools/client/application/src/reducers/manifest-state.js +++ b/devtools/client/application/src/reducers/manifest-state.js @@ -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) { diff --git a/devtools/client/bin/devtools-node-test-runner.js b/devtools/client/bin/devtools-node-test-runner.js index e347ee585555..087664b95746 100644 --- a/devtools/client/bin/devtools-node-test-runner.js +++ b/devtools/client/bin/devtools-node-test-runner.js @@ -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); diff --git a/devtools/client/debugger/dist/parser-worker.js b/devtools/client/debugger/dist/parser-worker.js index ea014d752997..f120a4753b0c 100644 --- a/devtools/client/debugger/dist/parser-worker.js +++ b/devtools/client/debugger/dist/parser-worker.js @@ -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; diff --git a/devtools/client/debugger/src/actions/ast/setInScopeLines.js b/devtools/client/debugger/src/actions/ast/setInScopeLines.js index 72bd33b59f3e..5a76ab7f65e1 100644 --- a/devtools/client/debugger/src/actions/ast/setInScopeLines.js +++ b/devtools/client/debugger/src/actions/ast/setInScopeLines.js @@ -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); diff --git a/devtools/client/debugger/src/actions/breakpoints/index.js b/devtools/client/debugger/src/actions/breakpoints/index.js index 2125ec9ec749..94e9028a1b29 100644 --- a/devtools/client/debugger/src/actions/breakpoints/index.js +++ b/devtools/client/debugger/src/actions/breakpoints/index.js @@ -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({ diff --git a/devtools/client/debugger/src/actions/breakpoints/syncBreakpoint.js b/devtools/client/debugger/src/actions/breakpoints/syncBreakpoint.js index b24912de58d7..aec56664d086 100644 --- a/devtools/client/debugger/src/actions/breakpoints/syncBreakpoint.js +++ b/devtools/client/debugger/src/actions/breakpoints/syncBreakpoint.js @@ -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); diff --git a/devtools/client/debugger/src/actions/context-menus/editor-breakpoint.js b/devtools/client/debugger/src/actions/context-menus/editor-breakpoint.js index 39ec2f15896a..999912966b3b 100644 --- a/devtools/client/debugger/src/actions/context-menus/editor-breakpoint.js +++ b/devtools/client/debugger/src/actions/context-menus/editor-breakpoint.js @@ -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); diff --git a/devtools/client/debugger/src/actions/context-menus/frame.js b/devtools/client/debugger/src/actions/context-menus/frame.js index 1d287b10287f..a517b55e0726 100644 --- a/devtools/client/debugger/src/actions/context-menus/frame.js +++ b/devtools/client/debugger/src/actions/context-menus/frame.js @@ -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() diff --git a/devtools/client/debugger/src/actions/expressions.js b/devtools/client/debugger/src/actions/expressions.js index 8ccb6013ba65..383f191506e6 100644 --- a/devtools/client/debugger/src/actions/expressions.js +++ b/devtools/client/debugger/src/actions/expressions.js @@ -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; } diff --git a/devtools/client/debugger/src/actions/file-search.js b/devtools/client/debugger/src/actions/file-search.js index cc5794d7ab39..fb8cfe84751e 100644 --- a/devtools/client/debugger/src/actions/file-search.js +++ b/devtools/client/debugger/src/actions/file-search.js @@ -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()); diff --git a/devtools/client/debugger/src/actions/navigation.js b/devtools/client/debugger/src/actions/navigation.js index 1b437837c218..839d67a31a33 100644 --- a/devtools/client/debugger/src/actions/navigation.js +++ b/devtools/client/debugger/src/actions/navigation.js @@ -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()); diff --git a/devtools/client/debugger/src/actions/pause/commands.js b/devtools/client/debugger/src/actions/pause/commands.js index 0bb371bf6e71..1623add27467 100644 --- a/devtools/client/debugger/src/actions/pause/commands.js +++ b/devtools/client/debugger/src/actions/pause/commands.js @@ -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; } diff --git a/devtools/client/debugger/src/actions/pause/expandScopes.js b/devtools/client/debugger/src/actions/pause/expandScopes.js index af95f16fea67..1f7b7caac130 100644 --- a/devtools/client/debugger/src/actions/pause/expandScopes.js +++ b/devtools/client/debugger/src/actions/pause/expandScopes.js @@ -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, diff --git a/devtools/client/debugger/src/actions/pause/pauseOnDebuggerStatement.js b/devtools/client/debugger/src/actions/pause/pauseOnDebuggerStatement.js index 7b2b1d70cb0c..7d82fd44a8e0 100644 --- a/devtools/client/debugger/src/actions/pause/pauseOnDebuggerStatement.js +++ b/devtools/client/debugger/src/actions/pause/pauseOnDebuggerStatement.js @@ -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, diff --git a/devtools/client/debugger/src/actions/pause/pauseOnExceptions.js b/devtools/client/debugger/src/actions/pause/pauseOnExceptions.js index e7c04ded61e1..fe2f3e882a7a 100644 --- a/devtools/client/debugger/src/actions/pause/pauseOnExceptions.js +++ b/devtools/client/debugger/src/actions/pause/pauseOnExceptions.js @@ -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) diff --git a/devtools/client/debugger/src/actions/pause/resumed.js b/devtools/client/debugger/src/actions/pause/resumed.js index 47d55f84cafd..2095bacc3bed 100644 --- a/devtools/client/debugger/src/actions/pause/resumed.js +++ b/devtools/client/debugger/src/actions/pause/resumed.js @@ -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); diff --git a/devtools/client/debugger/src/actions/pause/tests/pause.spec.js b/devtools/client/debugger/src/actions/pause/tests/pause.spec.js index f8bd87375a30..6c69ac466154 100644 --- a/devtools/client/debugger/src/actions/pause/tests/pause.spec.js +++ b/devtools/client/debugger/src/actions/pause/tests/pause.spec.js @@ -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 => diff --git a/devtools/client/debugger/src/actions/preview.js b/devtools/client/debugger/src/actions/preview.js index c3bc8dbffd27..3b3637e2c0c6 100644 --- a/devtools/client/debugger/src/actions/preview.js +++ b/devtools/client/debugger/src/actions/preview.js @@ -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, diff --git a/devtools/client/debugger/src/actions/sources/loadSourceText.js b/devtools/client/debugger/src/actions/sources/loadSourceText.js index d3bbd53871b4..b523b1984ad2 100644 --- a/devtools/client/debugger/src/actions/sources/loadSourceText.js +++ b/devtools/client/debugger/src/actions/sources/loadSourceText.js @@ -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); diff --git a/devtools/client/debugger/src/actions/sources/newSources.js b/devtools/client/debugger/src/actions/sources/newSources.js index 309676ed5ee0..44e8595c42b0 100644 --- a/devtools/client/debugger/src/actions/sources/newSources.js +++ b/devtools/client/debugger/src/actions/sources/newSources.js @@ -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)); } diff --git a/devtools/client/debugger/src/actions/sources/prettyPrint.js b/devtools/client/debugger/src/actions/sources/prettyPrint.js index 6a12a3424063..d1e46ac9499d 100644 --- a/devtools/client/debugger/src/actions/sources/prettyPrint.js +++ b/devtools/client/debugger/src/actions/sources/prettyPrint.js @@ -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 diff --git a/devtools/client/debugger/src/actions/sources/symbols.js b/devtools/client/debugger/src/actions/sources/symbols.js index c7b9132c324f..e33c3e10368a 100644 --- a/devtools/client/debugger/src/actions/sources/symbols.js +++ b/devtools/client/debugger/src/actions/sources/symbols.js @@ -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({ diff --git a/devtools/client/debugger/src/actions/sources/tests/select.spec.js b/devtools/client/debugger/src/actions/sources/tests/select.spec.js index b53c4b50138f..4cf0c58c9494 100644 --- a/devtools/client/debugger/src/actions/sources/tests/select.spec.js +++ b/devtools/client/debugger/src/actions/sources/tests/select.spec.js @@ -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 }); diff --git a/devtools/client/debugger/src/actions/tests/expressions.spec.js b/devtools/client/debugger/src/actions/tests/expressions.spec.js index c69276fa402a..093f99e2286f 100644 --- a/devtools/client/debugger/src/actions/tests/expressions.spec.js +++ b/devtools/client/debugger/src/actions/tests/expressions.spec.js @@ -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 { diff --git a/devtools/client/debugger/src/actions/toolbox.js b/devtools/client/debugger/src/actions/toolbox.js index 97aee6dfb364..4c88ec6d245a 100644 --- a/devtools/client/debugger/src/actions/toolbox.js +++ b/devtools/client/debugger/src/actions/toolbox.js @@ -30,7 +30,7 @@ export function openElementInInspectorCommand(grip) { }; } -export function openInspector(grip) { +export function openInspector() { return async ({ panel }) => { return panel.openInspector(); }; diff --git a/devtools/client/debugger/src/actions/ui.js b/devtools/client/debugger/src/actions/ui.js index c50ae1958f74..8d4d62307a01 100644 --- a/devtools/client/debugger/src/actions/ui.js +++ b/devtools/client/debugger/src/actions/ui.js @@ -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 }); }; } diff --git a/devtools/client/debugger/src/actions/utils/middleware/context.js b/devtools/client/debugger/src/actions/utils/middleware/context.js index 00711a8c3f7e..350a90d66ed0 100644 --- a/devtools/client/debugger/src/actions/utils/middleware/context.js +++ b/devtools/client/debugger/src/actions/utils/middleware/context.js @@ -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); diff --git a/devtools/client/debugger/src/actions/utils/middleware/log.js b/devtools/client/debugger/src/actions/utils/middleware/log.js index b9592ce22cc9..d228669dd45b 100644 --- a/devtools/client/debugger/src/actions/utils/middleware/log.js +++ b/devtools/client/debugger/src/actions/utils/middleware/log.js @@ -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}]`; diff --git a/devtools/client/debugger/src/actions/utils/middleware/promise.js b/devtools/client/debugger/src/actions/utils/middleware/promise.js index 73a99c7e2d6f..2b88bb8ca943 100644 --- a/devtools/client/debugger/src/actions/utils/middleware/promise.js +++ b/devtools/client/debugger/src/actions/utils/middleware/promise.js @@ -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); diff --git a/devtools/client/debugger/src/actions/utils/middleware/timing.js b/devtools/client/debugger/src/actions/utils/middleware/timing.js index d0bfa05977c9..8b6b7baf5e91 100644 --- a/devtools/client/debugger/src/actions/utils/middleware/timing.js +++ b/devtools/client/debugger/src/actions/utils/middleware/timing.js @@ -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); diff --git a/devtools/client/debugger/src/client/firefox.js b/devtools/client/debugger/src/client/firefox.js index 6b76d6d175a4..8705bf349043 100644 --- a/devtools/client/debugger/src/client/firefox.js +++ b/devtools/client/debugger/src/client/firefox.js @@ -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 && diff --git a/devtools/client/debugger/src/client/firefox/commands.js b/devtools/client/debugger/src/client/firefox/commands.js index 5ef3ba27d02b..3f8f62c8fb3d 100644 --- a/devtools/client/debugger/src/client/firefox/commands.js +++ b/devtools/client/debugger/src/client/firefox/commands.js @@ -115,7 +115,7 @@ async function toggleTracing() { return commands.tracerCommand.toggle(); } -function resume(thread, frameId) { +function resume(thread) { return lookupThreadFront(thread).resume(); } diff --git a/devtools/client/debugger/src/components/Editor/ConditionalPanel.js b/devtools/client/debugger/src/components/Editor/ConditionalPanel.js index 8ff84c287a5b..97876f2f00a6 100644 --- a/devtools/client/debugger/src/components/Editor/ConditionalPanel.js +++ b/devtools/client/debugger/src/components/Editor/ConditionalPanel.js @@ -121,7 +121,7 @@ export class ConditionalPanel extends PureComponent { return this.clearConditionalPanel(); } - componentDidUpdate(prevProps) { + componentDidUpdate() { this.keepFocusOnInput(); } diff --git a/devtools/client/debugger/src/components/Editor/InlinePreview.js b/devtools/client/debugger/src/components/Editor/InlinePreview.js index 552143dcf2bb..60303e38b5de 100644 --- a/devtools/client/debugger/src/components/Editor/InlinePreview.js +++ b/devtools/client/debugger/src/components/Editor/InlinePreview.js @@ -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 } diff --git a/devtools/client/debugger/src/components/Editor/Preview/index.js b/devtools/client/debugger/src/components/Editor/Preview/index.js index 0ad4abc5fedf..10c600670ee4 100644 --- a/devtools/client/debugger/src/components/Editor/Preview/index.js +++ b/devtools/client/debugger/src/components/Editor/Preview/index.js @@ -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); diff --git a/devtools/client/debugger/src/components/Editor/SearchInFileBar.js b/devtools/client/debugger/src/components/Editor/SearchInFileBar.js index 1aca451ce0bd..26f95ce75dd0 100644 --- a/devtools/client/debugger/src/components/Editor/SearchInFileBar.js +++ b/devtools/client/debugger/src/components/Editor/SearchInFileBar.js @@ -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 { diff --git a/devtools/client/debugger/src/components/Editor/index.js b/devtools/client/debugger/src/components/Editor/index.js index 97ff281e03b0..ae9bde7657f1 100644 --- a/devtools/client/debugger/src/components/Editor/index.js +++ b/devtools/client/debugger/src/components/Editor/index.js @@ -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 diff --git a/devtools/client/debugger/src/components/Editor/tests/DebugLine.spec.js b/devtools/client/debugger/src/components/Editor/tests/DebugLine.spec.js index 767dde9e6d6f..38bb3186118f 100644 --- a/devtools/client/debugger/src/components/Editor/tests/DebugLine.spec.js +++ b/devtools/client/debugger/src/components/Editor/tests/DebugLine.spec.js @@ -15,7 +15,7 @@ function createMockDocument(clear) { addLineClass: jest.fn(), removeLineClass: jest.fn(), markText: jest.fn(() => ({ clear })), - getLine: line => "", + getLine: () => "", }; return doc; diff --git a/devtools/client/debugger/src/components/PrimaryPanes/Outline.js b/devtools/client/debugger/src/components/PrimaryPanes/Outline.js index 74cd83604441..d52ed8ff4051 100644 --- a/devtools/client/debugger/src/components/PrimaryPanes/Outline.js +++ b/devtools/client/debugger/src/components/PrimaryPanes/Outline.js @@ -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) { diff --git a/devtools/client/debugger/src/components/PrimaryPanes/ProjectSearch.js b/devtools/client/debugger/src/components/PrimaryPanes/ProjectSearch.js index 9449df2e8284..b5a99316f850 100644 --- a/devtools/client/debugger/src/components/PrimaryPanes/ProjectSearch.js +++ b/devtools/client/debugger/src/components/PrimaryPanes/ProjectSearch.js @@ -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, diff --git a/devtools/client/debugger/src/components/PrimaryPanes/SourcesTreeItem.js b/devtools/client/debugger/src/components/PrimaryPanes/SourcesTreeItem.js index 5785c354104e..575d714ba557 100644 --- a/devtools/client/debugger/src/components/PrimaryPanes/SourcesTreeItem.js +++ b/devtools/client/debugger/src/components/PrimaryPanes/SourcesTreeItem.js @@ -47,7 +47,7 @@ class SourceTreeItem extends Component { } } - onClick = e => { + onClick = () => { const { item, focusItem, selectSourceItem } = this.props; focusItem(item); diff --git a/devtools/client/debugger/src/components/QuickOpenModal.js b/devtools/client/debugger/src/components/QuickOpenModal.js index d65cba436feb..438592296d66 100644 --- a/devtools/client/debugger/src/components/QuickOpenModal.js +++ b/devtools/client/debugger/src/components/QuickOpenModal.js @@ -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: '', diff --git a/devtools/client/debugger/src/components/SecondaryPanes/CommandBar.js b/devtools/client/debugger/src/components/SecondaryPanes/CommandBar.js index ae9de418e74f..3dca62d48a1c 100644 --- a/devtools/client/debugger/src/components/SecondaryPanes/CommandBar.js +++ b/devtools/client/debugger/src/components/SecondaryPanes/CommandBar.js @@ -231,7 +231,7 @@ class CommandBar extends Component { formatKey("trace"), this.props.logMethod ), - onClick: event => { + onClick: () => { this.props.toggleTracing(); }, onContextMenu: event => { diff --git a/devtools/client/debugger/src/components/SecondaryPanes/EventListeners.js b/devtools/client/debugger/src/components/SecondaryPanes/EventListeners.js index bf69b0b3d814..00c885ec1667 100644 --- a/devtools/client/debugger/src/components/SecondaryPanes/EventListeners.js +++ b/devtools/client/debugger/src/components/SecondaryPanes/EventListeners.js @@ -116,11 +116,11 @@ class EventListeners extends Component { } }; - onFocus = event => { + onFocus = () => { this.setState({ focused: true }); }; - onBlur = event => { + onBlur = () => { this.setState({ focused: false }); }; diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Frames/Frame.js b/devtools/client/debugger/src/components/SecondaryPanes/Frames/Frame.js index 6b6f5aed3e10..2c5cc679bf3b 100644 --- a/devtools/client/debugger/src/components/SecondaryPanes/Frames/Frame.js +++ b/devtools/client/debugger/src/components/SecondaryPanes/Frames/Frame.js @@ -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; } diff --git a/devtools/client/debugger/src/components/SecondaryPanes/XHRBreakpoints.js b/devtools/client/debugger/src/components/SecondaryPanes/XHRBreakpoints.js index c07e5149e878..f0b86a5f5c2e 100644 --- a/devtools/client/debugger/src/components/SecondaryPanes/XHRBreakpoints.js +++ b/devtools/client/debugger/src/components/SecondaryPanes/XHRBreakpoints.js @@ -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), }) ) ) diff --git a/devtools/client/debugger/src/components/SecondaryPanes/index.js b/devtools/client/debugger/src/components/SecondaryPanes/index.js index b9cb88775975..52d0d3298e54 100644 --- a/devtools/client/debugger/src/components/SecondaryPanes/index.js +++ b/devtools/client/debugger/src/components/SecondaryPanes/index.js @@ -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") ) diff --git a/devtools/client/debugger/src/components/SecondaryPanes/tests/XHRBreakpoints.spec.js b/devtools/client/debugger/src/components/SecondaryPanes/tests/XHRBreakpoints.spec.js index 532c95e4ade0..de7ab02ebe16 100644 --- a/devtools/client/debugger/src/components/SecondaryPanes/tests/XHRBreakpoints.spec.js +++ b/devtools/client/debugger/src/components/SecondaryPanes/tests/XHRBreakpoints.spec.js @@ -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; } diff --git a/devtools/client/debugger/src/components/shared/Dropdown.js b/devtools/client/debugger/src/components/shared/Dropdown.js index a47eef9534ab..69727b032ade 100644 --- a/devtools/client/debugger/src/components/shared/Dropdown.js +++ b/devtools/client/debugger/src/components/shared/Dropdown.js @@ -21,7 +21,7 @@ export class Dropdown extends Component { }; } - toggleDropdown = e => { + toggleDropdown = () => { this.setState(prevState => ({ dropdownShown: !prevState.dropdownShown, })); diff --git a/devtools/client/debugger/src/components/shared/Popover.js b/devtools/client/debugger/src/components/shared/Popover.js index 8748e364186a..b81fd7e89e55 100644 --- a/devtools/client/debugger/src/components/shared/Popover.js +++ b/devtools/client/debugger/src/components/shared/Popover.js @@ -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, diff --git a/devtools/client/debugger/src/components/shared/SmartGap.js b/devtools/client/debugger/src/components/shared/SmartGap.js index d76d018987dc..5810aea6ea1c 100644 --- a/devtools/client/debugger/src/components/shared/SmartGap.js +++ b/devtools/client/debugger/src/components/shared/SmartGap.js @@ -109,7 +109,6 @@ function getSmartGapDimensions( export default function SmartGap({ token, preview, - type, gapHeight, coords, offset, diff --git a/devtools/client/debugger/src/components/shared/tests/__snapshots__/Popover.spec.js.snap b/devtools/client/debugger/src/components/shared/tests/__snapshots__/Popover.spec.js.snap index 1c3589a6f86a..6379668d6e49 100644 --- a/devtools/client/debugger/src/components/shared/tests/__snapshots__/Popover.spec.js.snap +++ b/devtools/client/debugger/src/components/shared/tests/__snapshots__/Popover.spec.js.snap @@ -105,7 +105,6 @@ exports[`Popover mount popover 1`] = ` "getBoundingClientRect": [Function], } } - type="popover" > { + makeThunkArgs: args => { return { ...args, client, ...workers, panel }; }, }); diff --git a/devtools/client/debugger/src/utils/editor/source-search.js b/devtools/client/debugger/src/utils/editor/source-search.js index cb8f878b4790..2316cd2ccbcf 100644 --- a/devtools/client/debugger/src/utils/editor/source-search.js +++ b/devtools/client/debugger/src/utils/editor/source-search.js @@ -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, diff --git a/devtools/client/debugger/src/utils/test-head.js b/devtools/client/debugger/src/utils/test-head.js index 5afbb91666fa..1021849d023b 100644 --- a/devtools/client/debugger/src/utils/test-head.js +++ b/devtools/client/debugger/src/utils/test-head.js @@ -101,7 +101,7 @@ function makeFrame({ id, sourceId, thread }, opts = {}) { }; } -function createSourceObject(filename, props = {}) { +function createSourceObject(filename) { return { id: filename, url: makeSourceURL(filename), diff --git a/devtools/client/debugger/src/workers/parser/mapAwaitExpression.js b/devtools/client/debugger/src/workers/parser/mapAwaitExpression.js index ec29d6cf2177..97018a129bfc 100644 --- a/devtools/client/debugger/src/workers/parser/mapAwaitExpression.js +++ b/devtools/client/debugger/src/workers/parser/mapAwaitExpression.js @@ -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; diff --git a/devtools/client/debugger/src/workers/parser/tests/framework.spec.js b/devtools/client/debugger/src/workers/parser/tests/framework.spec.js index d41f45b71c1a..fe25fbe283fc 100644 --- a/devtools/client/debugger/src/workers/parser/tests/framework.spec.js +++ b/devtools/client/debugger/src/workers/parser/tests/framework.spec.js @@ -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(); diff --git a/devtools/client/debugger/src/workers/parser/tests/getSymbols.spec.js b/devtools/client/debugger/src/workers/parser/tests/getSymbols.spec.js index 723eef1fd99e..0c5306d423d2 100644 --- a/devtools/client/debugger/src/workers/parser/tests/getSymbols.spec.js +++ b/devtools/client/debugger/src/workers/parser/tests/getSymbols.spec.js @@ -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); diff --git a/devtools/client/debugger/src/workers/parser/tests/mapBindings.spec.js b/devtools/client/debugger/src/workers/parser/tests/mapBindings.spec.js index 8c23ab587324..3731ac1dd5c4 100644 --- a/devtools/client/debugger/src/workers/parser/tests/mapBindings.spec.js +++ b/devtools/client/debugger/src/workers/parser/tests/mapBindings.spec.js @@ -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), diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-blackbox-all.js b/devtools/client/debugger/test/mochitest/browser_dbg-blackbox-all.js index 8080d3c145fd..42eec2716c0d 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-blackbox-all.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-blackbox-all.js @@ -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 ); } diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-breakpoint-skipping.js b/devtools/client/debugger/test/mochitest/browser_dbg-breakpoint-skipping.js index c766a0e54968..f995df2b6b75 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-breakpoint-skipping.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-breakpoint-skipping.js @@ -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) { diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-actions.js b/devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-actions.js index 900c55e7faf3..4150f552a1db 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-actions.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-actions.js @@ -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 ); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-columns.js b/devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-columns.js index 6234e22dcba8..b48c2d162af1 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-columns.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-columns.js @@ -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); -} diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-duplicate-functions.js b/devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-duplicate-functions.js index bb1fa3d64be2..ef12144cdba7 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-duplicate-functions.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-duplicate-functions.js @@ -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"); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-popup.js b/devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-popup.js index a3b7753738ff..eba02919d35c 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-popup.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-popup.js @@ -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; }); } diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-reloading.js b/devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-reloading.js index ca953445ba23..6e1f4582fdd0 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-reloading.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-reloading.js @@ -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); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer-function-returns.js b/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer-function-returns.js index 4b75be5cd7fd..12102e602d4c 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer-function-returns.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer-function-returns.js @@ -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); }); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer-next-interation.js b/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer-next-interation.js index 37e275f273c9..8d3b2ae6f249 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer-next-interation.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer-next-interation.js @@ -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); }); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer-next-load.js b/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer-next-load.js index 6ee442cbd065..b4259d5eb622 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer-next-load.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer-next-load.js @@ -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(() => { diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer-values.js b/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer-values.js index 92ff3c30a4be..99ce73ac9dce 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer-values.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer-values.js @@ -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); }); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer-worker.js b/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer-worker.js index 8fbf85e356b1..df91b71e0fec 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer-worker.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer-worker.js @@ -41,7 +41,7 @@ add_task(async function testTracingWorker() { info("Enable tracing on all threads"); await clickElement(dbg, "trace"); info("Wait for tracing to be enabled for the worker"); - await waitForState(dbg, state => { + await waitForState(dbg, () => { return dbg.selectors.getIsThreadCurrentlyTracing( workerTarget.threadFront.actorID ); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer.js b/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer.js index 2e151dc1ca97..bfa2447474c6 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer.js @@ -18,7 +18,7 @@ add_task(async function () { 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); }); @@ -90,7 +90,7 @@ add_task(async function () { info("Disable the tracing"); await clickElement(dbg, "trace"); info("Wait for tracing to be disabled"); - await waitForState(dbg, state => { + await waitForState(dbg, () => { return !dbg.selectors.getIsThreadCurrentlyTracing(topLevelThreadActorID); }); await hasConsoleMessage(dbg, "Stopped tracing"); @@ -116,7 +116,7 @@ add_task(async function () { const newTopLevelThread = dbg.toolbox.commands.targetCommand.targetFront.threadFront.actorID; info("Wait for tracing to be re-enabled"); - await waitForState(dbg, state => { + await waitForState(dbg, () => { return dbg.selectors.getIsThreadCurrentlyTracing(newTopLevelThread); }); @@ -216,7 +216,7 @@ add_task(async function testPageKeyShortcut() { }); info("Wait for tracing to be enabled"); - await waitForState(dbg, state => { + await waitForState(dbg, () => { return dbg.selectors.getIsThreadCurrentlyTracing(topLevelThreadActorID); }); @@ -236,7 +236,7 @@ add_task(async function testPageKeyShortcut() { }); info("Wait for tracing to be disabled"); - await waitForState(dbg, state => { + await waitForState(dbg, () => { return !dbg.selectors.getIsThreadCurrentlyTracing(topLevelThreadActorID); }); }); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-layout-changes.js b/devtools/client/debugger/test/mochitest/browser_dbg-layout-changes.js index 609879c7b16a..0f006c61fe36 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-layout-changes.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-layout-changes.js @@ -46,10 +46,7 @@ async function testLayout(dbg, orientation, host) { await switchHost(dbg, host); await resizeToolboxWindow(dbg, host); - return waitForState( - dbg, - state => dbg.selectors.getOrientation() == orientation - ); + return waitForState(dbg, () => dbg.selectors.getOrientation() == orientation); } function getHost(host) { diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-pause-on-next.js b/devtools/client/debugger/test/mochitest/browser_dbg-pause-on-next.js index 27ae30983ff7..ee275542809b 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-pause-on-next.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-pause-on-next.js @@ -13,7 +13,7 @@ add_task(async function () { } = dbg; clickElement(dbg, "pause"); - await waitForState(dbg, state => getIsWaitingOnBreak(getCurrentThread())); + await waitForState(dbg, () => getIsWaitingOnBreak(getCurrentThread())); invokeInTab("simple"); await waitForPaused(dbg, "simple3"); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-pause-points.js b/devtools/client/debugger/test/mochitest/browser_dbg-pause-points.js index 456e4e10f56b..35903957010d 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-pause-points.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-pause-points.js @@ -14,7 +14,7 @@ async function testCase(dbg, { name, steps }) { } = dbg; const locations = []; - const recordFrame = state => { + const recordFrame = () => { const { line, column } = getTopFrame(getCurrentThread()).location; locations.push([line, column]); info(`Break on ${line}:${column}`); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-pretty-print-paused.js b/devtools/client/debugger/test/mochitest/browser_dbg-pretty-print-paused.js index a5b9260af2b3..43bb6279fd65 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-pretty-print-paused.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-pretty-print-paused.js @@ -21,7 +21,7 @@ add_task(async function () { await waitForSelectedSource(dbg, "math.min.js:formatted"); await waitForState( dbg, - state => dbg.selectors.getSelectedFrame(thread).location.line == 18 + () => dbg.selectors.getSelectedFrame(thread).location.line == 18 ); assertPausedAtSourceAndLine( dbg, diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-preview-frame.js b/devtools/client/debugger/test/mochitest/browser_dbg-preview-frame.js index 4075b6525a9b..b58dd19686d7 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-preview-frame.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-preview-frame.js @@ -60,7 +60,7 @@ add_task(async function () { function waitForSelectedFrame(dbg, displayName) { const { getInScopeLines, getVisibleSelectedFrame } = dbg.selectors; - return waitForState(dbg, state => { + return waitForState(dbg, () => { const frame = getVisibleSelectedFrame(); return frame?.displayName == displayName && getInScopeLines(frame.location); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-react-app.js b/devtools/client/debugger/test/mochitest/browser_dbg-react-app.js index 2882bba1b6ab..f2f304805ec4 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-react-app.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-react-app.js @@ -15,7 +15,7 @@ add_task(async function () { invokeInTab("clickButton"); await waitForPaused(dbg); - await waitForState(dbg, state => + await waitForState(dbg, () => dbg.selectors.getSelectedScopeMappings(dbg.selectors.getCurrentThread()) ); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-search-file.js b/devtools/client/debugger/test/mochitest/browser_dbg-search-file.js index 75daa9a469e9..57238dc36c7a 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-search-file.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-search-file.js @@ -125,7 +125,7 @@ add_task(async function () { is(dbg.win.document.activeElement.tagName, "INPUT", "Search field focused"); }); -async function navigateWithKey(dbg, key, expectedLine, assertionMessage) { +async function navigateWithKey(dbg, key, expectedLine) { pressKey(dbg, key); await waitForCursorPosition(dbg, expectedLine); } diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-slow-script.js b/devtools/client/debugger/test/mochitest/browser_dbg-slow-script.js index 39d9581c6115..39008a747852 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-slow-script.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-slow-script.js @@ -67,7 +67,7 @@ add_task(async function openDebuggerFromDialog() { // And mochitest may consider this as an error. So ignore any rejection. SpecialPowers.spawn(gBrowser.selectedBrowser, [], function () { content.wrappedJSObject.infiniteLoop(); - }).catch(e => {}); + }).catch(() => {}); info("Wait for the slow script warning"); const notification = await alert; diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps-reloading.js b/devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps-reloading.js index c10273baaf9e..5814e423f26d 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps-reloading.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps-reloading.js @@ -54,8 +54,5 @@ add_task(async function () { }); async function waitForBreakpointCount(dbg, count) { - return waitForState( - dbg, - state => dbg.selectors.getBreakpointCount() === count - ); + return waitForState(dbg, () => dbg.selectors.getBreakpointCount() === count); } diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps.js b/devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps.js index 9b779fdb4b4f..d7c71aade808 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps.js @@ -191,5 +191,5 @@ async function waitForBreakpointCount(dbg, count) { const { selectors: { getBreakpointCount }, } = dbg; - await waitForState(dbg, state => getBreakpointCount() == count); + await waitForState(dbg, () => getBreakpointCount() == count); } diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-ua-widgets.js b/devtools/client/debugger/test/mochitest/browser_dbg-ua-widgets.js index e563d52824c2..07d628c45a4b 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-ua-widgets.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-ua-widgets.js @@ -28,7 +28,7 @@ add_task(async function () { ); clickElement(dbg, "pause"); - await waitForState(dbg, state => + await waitForState(dbg, () => dbg.selectors.getIsWaitingOnBreak(dbg.selectors.getCurrentThread()) ); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-windowless-service-workers.js b/devtools/client/debugger/test/mochitest/browser_dbg-windowless-service-workers.js index a38aebe6e03a..f2e20f454189 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-windowless-service-workers.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-windowless-service-workers.js @@ -168,7 +168,7 @@ add_task(async function () { await removeTab(gBrowser.selectedTab); }); -async function checkWorkerStatus(dbg, status) { +async function checkWorkerStatus(_dbg, _status) { /* TODO: Re-Add support for showing service worker status (Bug 1641099) await waitUntil(() => { const threads = dbg.selectors.getThreads(); diff --git a/devtools/client/debugger/test/mochitest/shared-head.js b/devtools/client/debugger/test/mochitest/shared-head.js index 61e7d6155bc3..b2a1c7c3d75e 100644 --- a/devtools/client/debugger/test/mochitest/shared-head.js +++ b/devtools/client/debugger/test/mochitest/shared-head.js @@ -137,7 +137,7 @@ async function waitForSources(dbg, ...sources) { function waitForSource(dbg, url) { return waitForState( dbg, - state => findSource(dbg, url, { silent: true }), + () => findSource(dbg, url, { silent: true }), "source exists" ); } @@ -189,7 +189,7 @@ function assertClass(el, className, exists = true) { } function waitForSelectedLocation(dbg, line, column) { - return waitForState(dbg, state => { + return waitForState(dbg, () => { const location = dbg.selectors.getSelectedLocation(); return ( location && @@ -220,7 +220,7 @@ function waitForSelectedSource(dbg, sourceOrUrl) { return waitForState( dbg, - state => { + () => { const location = dbg.selectors.getSelectedLocation() || {}; const sourceTextContent = getSelectedSourceTextContent(); if (!sourceTextContent) { @@ -508,10 +508,7 @@ async function waitForLoadedScopes(dbg) { } function waitForBreakpointCount(dbg, count) { - return waitForState( - dbg, - state => dbg.selectors.getBreakpointCount() == count - ); + return waitForState(dbg, () => dbg.selectors.getBreakpointCount() == count); } function waitForBreakpoint(dbg, url, line) { @@ -573,7 +570,7 @@ async function waitForPaused( await waitForState( dbg, - state => isPaused(dbg) && !!getSelectedScope(getCurrentThread()), + () => isPaused(dbg) && !!getSelectedScope(getCurrentThread()), "paused" ); @@ -592,7 +589,7 @@ async function waitForPaused( */ function waitForResumed(dbg) { info("Waiting for the debugger to resume"); - return waitForState(dbg, state => !dbg.selectors.getIsCurrentThreadPaused()); + return waitForState(dbg, () => !dbg.selectors.getIsCurrentThreadPaused()); } function waitForInlinePreviews(dbg) { @@ -600,7 +597,7 @@ function waitForInlinePreviews(dbg) { } function waitForCondition(dbg, condition) { - return waitForState(dbg, state => + return waitForState(dbg, () => dbg.selectors .getBreakpointsList() .find(bp => bp.options.condition == condition) @@ -608,7 +605,7 @@ function waitForCondition(dbg, condition) { } function waitForLog(dbg, logValue) { - return waitForState(dbg, state => + return waitForState(dbg, () => dbg.selectors .getBreakpointsList() .find(bp => bp.options.logValue == logValue) @@ -616,10 +613,10 @@ function waitForLog(dbg, logValue) { } async function waitForPausedThread(dbg, thread) { - return waitForState(dbg, state => dbg.selectors.getIsPaused(thread)); + return waitForState(dbg, () => dbg.selectors.getIsPaused(thread)); } -function isSelectedFrameSelected(dbg, state) { +function isSelectedFrameSelected(dbg) { const frame = dbg.selectors.getVisibleSelectedFrame(); // Make sure the source text is completely loaded for the @@ -788,7 +785,7 @@ function sourceExists(dbg, url) { function waitForLoadedSource(dbg, url) { return waitForState( dbg, - state => { + () => { const source = findSource(dbg, url, { silent: true }); return ( source && @@ -2576,14 +2573,13 @@ async function assertPreviews(dbg, previews) { * @param {Number} column * @param {Object} options * @param {String} options.result - Expected text shown in the preview - * @param {String} options.expression - The expression hovered over * @param {Array} options.fields - The expected stacktrace information */ async function assertInlineExceptionPreview( dbg, line, column, - { expression, result, fields } + { result, fields } ) { info(" # Assert preview on " + line + ":" + column); const { element: popupEl, tokenEl } = await tryHovering( @@ -2634,7 +2630,7 @@ async function assertInlineExceptionPreview( async function waitForBreakableLine(dbg, source, lineNumber) { await waitForState( dbg, - state => { + () => { const currentSource = findSource(dbg, source); const breakableLines = @@ -2997,10 +2993,7 @@ async function setLogPoint(dbg, index, value) { function openProjectSearch(dbg) { info("Opening the project search panel"); synthesizeKeyShortcut("CmdOrCtrl+Shift+F"); - return waitForState( - dbg, - state => dbg.selectors.getActiveSearch() === "project" - ); + return waitForState(dbg, () => dbg.selectors.getActiveSearch() === "project"); } /** @@ -3139,7 +3132,7 @@ function assertOutlineItems(dbg, expectedItems) { async function checkAdditionalThreadCount(dbg, count) { await waitForState( dbg, - state => { + () => { return dbg.selectors.getThreads().length == count; }, "Have the expected number of additional threads" diff --git a/devtools/client/dom/content/dom-decorator.js b/devtools/client/dom/content/dom-decorator.js index a711a95d83a8..625caaf55b91 100644 --- a/devtools/client/dom/content/dom-decorator.js +++ b/devtools/client/dom/content/dom-decorator.js @@ -41,7 +41,7 @@ DomDecorator.prototype = { * Return custom React template for specified object. The template * might depend on specified column. */ - getValueRep(value, colId) {}, + getValueRep() {}, }; // Exports from this module diff --git a/devtools/client/dom/content/reducers/grips.js b/devtools/client/dom/content/reducers/grips.js index 1413baa1ce81..f5871d59dd8f 100644 --- a/devtools/client/dom/content/reducers/grips.js +++ b/devtools/client/dom/content/reducers/grips.js @@ -36,7 +36,7 @@ function grips(state = getInitialState(), action) { /** * Handle requestProperties action */ -function onRequestProperties(state, action) { +function onRequestProperties(state) { return state; } diff --git a/devtools/client/dom/panel.js b/devtools/client/dom/panel.js index 98e821cbd8d3..427ffe58f308 100644 --- a/devtools/client/dom/panel.js +++ b/devtools/client/dom/panel.js @@ -147,7 +147,7 @@ DomPanel.prototype = { this.refresh(); }, - _onTargetSelected({ targetFront }) { + _onTargetSelected() { this.forceRefresh(); }, diff --git a/devtools/client/framework/actions/dom-mutation-breakpoints.js b/devtools/client/framework/actions/dom-mutation-breakpoints.js index 1e1273d711cd..9780771a24a3 100644 --- a/devtools/client/framework/actions/dom-mutation-breakpoints.js +++ b/devtools/client/framework/actions/dom-mutation-breakpoints.js @@ -47,7 +47,7 @@ function createDOMMutationBreakpoint(nodeFront, mutationType) { assert(typeof nodeFront === "object" && nodeFront); assert(typeof mutationType === "string"); - return async function ({ dispatch, getState }) { + return async function ({ dispatch }) { const walker = nodeFront.walkerFront; dispatch({ @@ -67,7 +67,7 @@ function deleteDOMMutationBreakpoint(nodeFront, mutationType) { assert(typeof nodeFront === "object" && nodeFront); assert(typeof mutationType === "string"); - return async function ({ dispatch, getState }) { + return async function ({ dispatch }) { const walker = nodeFront.walkerFront; await walker.setMutationBreakpoints(nodeFront, { [mutationType]: false, @@ -141,7 +141,7 @@ function toggleDOMMutationBreakpointState(id, enabled) { assert(typeof id === "string"); assert(typeof enabled === "boolean"); - return async function ({ dispatch, getState }) { + return async function ({ getState }) { const bp = getDOMMutationBreakpoint(getState(), id); if (!bp) { throw new Error(`No DOM mutation BP with ID ${id}`); diff --git a/devtools/client/framework/browser-toolbox/test/browser_browser_toolbox_unavailable_children.js b/devtools/client/framework/browser-toolbox/test/browser_browser_toolbox_unavailable_children.js index 5029c623060b..d06274591ed4 100644 --- a/devtools/client/framework/browser-toolbox/test/browser_browser_toolbox_unavailable_children.js +++ b/devtools/client/framework/browser-toolbox/test/browser_browser_toolbox_unavailable_children.js @@ -38,107 +38,99 @@ add_task(async function () { selectNode, }); - const tabProcessID = - tab.linkedBrowser.browsingContext.currentWindowGlobal.osPid; + await ToolboxTask.spawn([], async () => { + /* global gToolbox */ + const inspector = gToolbox.getPanel("inspector"); - const decodedTabURI = decodeURI(tab.linkedBrowser.currentURI.spec); + info("Select the test browser element."); + await selectNode('browser[remote="true"][test-tab]', inspector); - await ToolboxTask.spawn( - [tabProcessID, isFissionEnabled(), decodedTabURI], - async (processID, _isFissionEnabled, tabURI) => { - /* global gToolbox */ - const inspector = gToolbox.getPanel("inspector"); + info("Retrieve the node front for selected node."); + const browserNodeFront = inspector.selection.nodeFront; + ok(!!browserNodeFront, "Retrieved a node front for the browser"); + is(browserNodeFront.displayName, "browser"); - info("Select the test browser element."); - await selectNode('browser[remote="true"][test-tab]', inspector); + // Small helper to expand containers and return the child container + // matching the provided display name. + async function expandContainer(container, expectedChildName) { + info(`Expand the node expected to contain a ${expectedChildName}`); + await inspector.markup.expandNode(container.node); + await waitUntil(() => !!container.getChildContainers().length); - info("Retrieve the node front for selected node."); - const browserNodeFront = inspector.selection.nodeFront; - ok(!!browserNodeFront, "Retrieved a node front for the browser"); - is(browserNodeFront.displayName, "browser"); - - // Small helper to expand containers and return the child container - // matching the provided display name. - async function expandContainer(container, expectedChildName) { - info(`Expand the node expected to contain a ${expectedChildName}`); - await inspector.markup.expandNode(container.node); - await waitUntil(() => !!container.getChildContainers().length); - - const children = container - .getChildContainers() - .filter(child => child.node.displayName === expectedChildName); - is(children.length, 1); - return children[0]; - } - - info("Check that the corresponding markup view container has children"); - const browserContainer = inspector.markup.getContainer(browserNodeFront); - ok(browserContainer.hasChildren); - ok( - !browserContainer.node.childrenUnavailable, - "childrenUnavailable un-set" - ); - ok( - !browserContainer.elt.querySelector(".unavailable-children"), - "The unavailable badge is not displayed" - ); - - // Store the asserts as a helper to reuse it later in the test. - async function assertMarkupView() { - info("Check that the children are #document > html > body > div"); - let container = await expandContainer(browserContainer, "#document"); - container = await expandContainer(container, "html"); - container = await expandContainer(container, "body"); - container = await expandContainer(container, "div"); - - info("Select the #pick-me div"); - await selectNode(container.node, inspector); - is(inspector.selection.nodeFront.id, "pick-me"); - } - await assertMarkupView(); - - const parentProcessScope = gToolbox.doc.querySelector( - 'input[name="chrome-debug-mode"][value="parent-process"]' - ); - - info("Switch to parent process only scope"); - const onInspectorUpdated = inspector.once("inspector-updated"); - parentProcessScope.click(); - await onInspectorUpdated; - - // Note: `getChildContainers` returns null when the container has no - // children, instead of an empty array. - await waitUntil(() => browserContainer.getChildContainers() === null); - - ok(!browserContainer.hasChildren, "browser container has no children"); - ok(browserContainer.node.childrenUnavailable, "childrenUnavailable set"); - ok( - !!browserContainer.elt.querySelector(".unavailable-children"), - "The unavailable badge is displayed" - ); - - const everythingScope = gToolbox.doc.querySelector( - 'input[name="chrome-debug-mode"][value="everything"]' - ); - - info("Switch to multi process scope"); - everythingScope.click(); - - info("Wait until browserContainer has children"); - await waitUntil(() => browserContainer.hasChildren); - ok(browserContainer.hasChildren, "browser container has children"); - ok( - !browserContainer.node.childrenUnavailable, - "childrenUnavailable un-set" - ); - ok( - !browserContainer.elt.querySelector(".unavailable-children"), - "The unavailable badge is no longer displayed" - ); - - await assertMarkupView(); + const children = container + .getChildContainers() + .filter(child => child.node.displayName === expectedChildName); + is(children.length, 1); + return children[0]; } - ); + + info("Check that the corresponding markup view container has children"); + const browserContainer = inspector.markup.getContainer(browserNodeFront); + ok(browserContainer.hasChildren); + ok( + !browserContainer.node.childrenUnavailable, + "childrenUnavailable un-set" + ); + ok( + !browserContainer.elt.querySelector(".unavailable-children"), + "The unavailable badge is not displayed" + ); + + // Store the asserts as a helper to reuse it later in the test. + async function assertMarkupView() { + info("Check that the children are #document > html > body > div"); + let container = await expandContainer(browserContainer, "#document"); + container = await expandContainer(container, "html"); + container = await expandContainer(container, "body"); + container = await expandContainer(container, "div"); + + info("Select the #pick-me div"); + await selectNode(container.node, inspector); + is(inspector.selection.nodeFront.id, "pick-me"); + } + await assertMarkupView(); + + const parentProcessScope = gToolbox.doc.querySelector( + 'input[name="chrome-debug-mode"][value="parent-process"]' + ); + + info("Switch to parent process only scope"); + const onInspectorUpdated = inspector.once("inspector-updated"); + parentProcessScope.click(); + await onInspectorUpdated; + + // Note: `getChildContainers` returns null when the container has no + // children, instead of an empty array. + await waitUntil(() => browserContainer.getChildContainers() === null); + + ok(!browserContainer.hasChildren, "browser container has no children"); + ok(browserContainer.node.childrenUnavailable, "childrenUnavailable set"); + ok( + !!browserContainer.elt.querySelector(".unavailable-children"), + "The unavailable badge is displayed" + ); + + const everythingScope = gToolbox.doc.querySelector( + 'input[name="chrome-debug-mode"][value="everything"]' + ); + + info("Switch to multi process scope"); + everythingScope.click(); + + info("Wait until browserContainer has children"); + await waitUntil(() => browserContainer.hasChildren); + ok(browserContainer.hasChildren, "browser container has children"); + ok( + !browserContainer.node.childrenUnavailable, + "childrenUnavailable un-set" + ); + ok( + !browserContainer.elt.querySelector(".unavailable-children"), + "The unavailable badge is no longer displayed" + ); + + await assertMarkupView(); + }); await ToolboxTask.destroy(); }); diff --git a/devtools/client/framework/browser-toolbox/window.js b/devtools/client/framework/browser-toolbox/window.js index e84ef02829ed..e1b4c8031bf1 100644 --- a/devtools/client/framework/browser-toolbox/window.js +++ b/devtools/client/framework/browser-toolbox/window.js @@ -185,7 +185,7 @@ window.addEventListener( { once: true } ); -function onCloseCommand(event) { +function onCloseCommand() { window.close(); } diff --git a/devtools/client/framework/components/ToolboxTabs.js b/devtools/client/framework/components/ToolboxTabs.js index 04b7d653a4f7..ad392a87002f 100644 --- a/devtools/client/framework/components/ToolboxTabs.js +++ b/devtools/client/framework/components/ToolboxTabs.js @@ -97,7 +97,7 @@ class ToolboxTabs extends Component { } } - componentDidUpdate(prevProps, prevState) { + componentDidUpdate(prevProps) { if (this.shouldUpdateToolboxTabs(prevProps, this.props)) { this.updateCachedToolTabsWidthMap(); this.updateOverflowedTabs(); @@ -226,7 +226,7 @@ class ToolboxTabs extends Component { } } - resizeHandler(evt) { + resizeHandler() { window.cancelIdleCallback(this._resizeTimerId); this._resizeTimerId = window.requestIdleCallback( () => { diff --git a/devtools/client/framework/components/ToolboxToolbar.js b/devtools/client/framework/components/ToolboxToolbar.js index 6f94d0282bca..f9998db0ab7c 100644 --- a/devtools/client/framework/components/ToolboxToolbar.js +++ b/devtools/client/framework/components/ToolboxToolbar.js @@ -354,7 +354,7 @@ class ToolboxToolbar extends Component { } const items = []; - toolbox.frameMap.forEach((frame, index) => { + toolbox.frameMap.forEach(frame => { const label = toolbox.target.isWebExtension ? toolbox.target.getExtensionPathName(frame.url) : getUnicodeUrl(frame.url); diff --git a/devtools/client/framework/menu.js b/devtools/client/framework/menu.js index a4cd8af5f737..2aef8aaf014f 100644 --- a/devtools/client/framework/menu.js +++ b/devtools/client/framework/menu.js @@ -49,10 +49,10 @@ Menu.prototype.clear = function () { /** * Add an item to a specified position in the menu * - * @param {int} pos - * @param {MenuItem} menuItem + * @param {int} _pos + * @param {MenuItem} _menuItem */ -Menu.prototype.insert = function (pos, menuItem) { +Menu.prototype.insert = function (_pos, _menuItem) { throw Error("Not implemented"); }; diff --git a/devtools/client/framework/source-map-url-service.js b/devtools/client/framework/source-map-url-service.js index 8e08e9e4cbbf..043211a723e7 100644 --- a/devtools/client/framework/source-map-url-service.js +++ b/devtools/client/framework/source-map-url-service.js @@ -296,7 +296,7 @@ class SourceMapURLService { return query; } - _dispatchQuery(query, newSubscribers = null) { + _dispatchQuery(query) { if (!this._prefValue) { throw new Error("This function should only be called if the pref is on."); } diff --git a/devtools/client/framework/test/browser_devtools_api_destroy.js b/devtools/client/framework/test/browser_devtools_api_destroy.js index 736455df65bd..56cf001f76de 100644 --- a/devtools/client/framework/test/browser_devtools_api_destroy.js +++ b/devtools/client/framework/test/browser_devtools_api_destroy.js @@ -38,11 +38,11 @@ async function runTests(aTab) { const panel = toolbox.getPanel(toolDefinition.id); ok(panel, "Tool open"); - gDevTools.once("toolbox-destroy", (toolbox, iframe) => { + gDevTools.once("toolbox-destroy", () => { collectedEvents.push("toolbox-destroy"); }); - gDevTools.once(toolDefinition.id + "-destroy", (toolbox, iframe) => { + gDevTools.once(toolDefinition.id + "-destroy", () => { collectedEvents.push("gDevTools-" + toolDefinition.id + "-destroy"); }); diff --git a/devtools/client/framework/test/browser_target_parents.js b/devtools/client/framework/test/browser_target_parents.js index 795219abefd3..d66339739cf6 100644 --- a/devtools/client/framework/test/browser_target_parents.js +++ b/devtools/client/framework/test/browser_target_parents.js @@ -60,7 +60,7 @@ add_task(async function () { // With that, we were chasing a precise race, where a second call to ProcessDescriptor.getTarget() // happens between the instantiation of ContentProcessTarget and its call to attach() from getTarget // function. - await testGetTargetWithConcurrentCalls(processes, processTarget => { + await testGetTargetWithConcurrentCalls(processes, () => { // We only call ContentProcessTargetFront.attach and not TargetMixin.attachAndInitThread. // So nothing is done for content process targets. return true; diff --git a/devtools/client/framework/test/browser_target_server_compartment.js b/devtools/client/framework/test/browser_target_server_compartment.js index c0bd8e56f075..652f9e0bfbae 100644 --- a/devtools/client/framework/test/browser_target_server_compartment.js +++ b/devtools/client/framework/test/browser_target_server_compartment.js @@ -26,7 +26,7 @@ async function testChromeTab() { ); const onThreadActorInstantiated = new Promise(resolve => { - const observe = function (subject, topic, data) { + const observe = function (subject, topic) { if (topic === "devtools-thread-ready") { Services.obs.removeObserver(observe, "devtools-thread-ready"); const threadActor = subject.wrappedJSObject; @@ -62,7 +62,7 @@ async function testChromeTab() { ); const onDedicatedLoaderDestroy = new Promise(resolve => { - const observe = function (subject, topic, data) { + const observe = function (subject, topic) { if (topic === "devtools:loader:destroy") { Services.obs.removeObserver(observe, "devtools:loader:destroy"); resolve(); @@ -81,7 +81,7 @@ async function testChromeTab() { // Test that Main process Target can debug chrome scripts async function testMainProcess() { const onThreadActorInstantiated = new Promise(resolve => { - const observe = function (subject, topic, data) { + const observe = function (subject, topic) { if (topic === "devtools-thread-ready") { Services.obs.removeObserver(observe, "devtools-thread-ready"); const threadActor = subject.wrappedJSObject; diff --git a/devtools/client/framework/test/browser_toolbox_highlight.js b/devtools/client/framework/test/browser_toolbox_highlight.js index d0712aeed5ae..401f5df9f60a 100644 --- a/devtools/client/framework/test/browser_toolbox_highlight.js +++ b/devtools/client/framework/test/browser_toolbox_highlight.js @@ -62,7 +62,7 @@ function test() { finish(); }); }); - })().catch(error => { + })().catch(() => { ok(false, "There was an error running the test."); }); } diff --git a/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing.html b/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing.html index 4065aabc2bf1..06b628158848 100644 --- a/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing.html +++ b/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing.html @@ -15,9 +15,9 @@ // enabled, so dereferencing it would throw a ReferenceError (which // is then caught in the .catch() clause). return window.navigator.serviceWorker.register("serviceworker.js"); - }).then(registration => { + }).then(() => { return {success: true}; - }).catch(error => { + }).catch(() => { return {success: false}; }); } @@ -36,7 +36,7 @@ function iframeRegisterAndUnregister() { var frame = window.document.createElement("iframe"); - var promise = new Promise(function(resolve, reject) { + var promise = new Promise(function(resolve) { frame.addEventListener("load", function() { Promise.resolve().then(_ => { return frame.contentWindow.navigator.serviceWorker.register("serviceworker.js"); @@ -45,7 +45,7 @@ }).then(_ => { frame.remove(); resolve({success: true}); - }).catch(error => { + }).catch(() => { resolve({success: false}); }); }, {once: true}); diff --git a/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing.js b/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing.js index 152f64f835d1..315b1f1e55f7 100644 --- a/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing.js +++ b/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing.js @@ -67,7 +67,7 @@ function register() { return sendMessage("devtools:sw-test:register"); } -function unregister(swr) { +function unregister() { return sendMessage("devtools:sw-test:unregister"); } diff --git a/devtools/client/framework/test/browser_toolbox_options_multiple_tabs.js b/devtools/client/framework/test/browser_toolbox_options_multiple_tabs.js index 74c0983d4e8f..d8d4d3057d63 100644 --- a/devtools/client/framework/test/browser_toolbox_options_multiple_tabs.js +++ b/devtools/client/framework/test/browser_toolbox_options_multiple_tabs.js @@ -66,7 +66,7 @@ async function testToggleTools() { await toggleTool(tab2, toolId); } -async function toggleTool({ doc, panelWin, checkbox, tab }, toolId) { +async function toggleTool({ panelWin, checkbox }, toolId) { const prevChecked = checkbox.checked; (prevChecked ? checkRegistered : checkUnregistered)(toolId); diff --git a/devtools/client/framework/test/browser_toolbox_select_event.js b/devtools/client/framework/test/browser_toolbox_select_event.js index ebdae9af13cc..bbfd36eae439 100644 --- a/devtools/client/framework/test/browser_toolbox_select_event.js +++ b/devtools/client/framework/test/browser_toolbox_select_event.js @@ -72,7 +72,7 @@ add_task(async function () { async function testSelectToolRace() { const toolbox = await openToolboxForTab(tab, "webconsole"); let selected = false; - const onSelect = (event, id) => { + const onSelect = () => { if (selected) { ok(false, "Got more than one 'select' event"); } else { diff --git a/devtools/client/framework/test/browser_toolbox_toolbar_minimum_width.js b/devtools/client/framework/test/browser_toolbox_toolbar_minimum_width.js index cdd6678e6fb1..d5780c083c4d 100644 --- a/devtools/client/framework/test/browser_toolbox_toolbar_minimum_width.js +++ b/devtools/client/framework/test/browser_toolbox_toolbar_minimum_width.js @@ -10,7 +10,7 @@ const SIDEBAR_WIDTH_PREF = "devtools.toolbox.sidebar.width"; const { Toolbox } = require("resource://devtools/client/framework/toolbox.js"); -add_task(async function (pickerEnable, commandsEnable) { +add_task(async function () { // 74px is Chevron(26px) + Meatball(24px) + Close(24px) // devtools-browser.css defined this minimum width by using min-width. Services.prefs.setIntPref(SIDEBAR_WIDTH_PREF, 74); diff --git a/devtools/client/framework/test/browser_toolbox_window_reload_target.js b/devtools/client/framework/test/browser_toolbox_window_reload_target.js index d9a4eb34c164..8415af88f249 100644 --- a/devtools/client/framework/test/browser_toolbox_window_reload_target.js +++ b/devtools/client/framework/test/browser_toolbox_window_reload_target.js @@ -46,7 +46,7 @@ add_task(async function () { "Listen to page reloads to check that they are indeed sent by the toolbox" ); let reloadDetected = 0; - const reloadCounter = msg => { + const reloadCounter = () => { reloadDetected++; info("Detected reload #" + reloadDetected); is( diff --git a/devtools/client/framework/toolbox-hosts.js b/devtools/client/framework/toolbox-hosts.js index 59d113848fe3..889a8cec36d3 100644 --- a/devtools/client/framework/toolbox-hosts.js +++ b/devtools/client/framework/toolbox-hosts.js @@ -413,7 +413,7 @@ PageHost.prototype = { raise() {}, // Do nothing. - setTitle(title) {}, + setTitle() {}, // Do nothing. destroy() { diff --git a/devtools/client/framework/toolbox-options.js b/devtools/client/framework/toolbox-options.js index 57fa1202b77a..98b263ad444b 100644 --- a/devtools/client/framework/toolbox-options.js +++ b/devtools/client/framework/toolbox-options.js @@ -148,7 +148,7 @@ OptionsPanel.prototype = { } }, - _themeRegistered(themeId) { + _themeRegistered() { this.setupThemeList(); }, diff --git a/devtools/client/framework/toolbox.js b/devtools/client/framework/toolbox.js index 4b08fb499f17..a03360aa26ee 100644 --- a/devtools/client/framework/toolbox.js +++ b/devtools/client/framework/toolbox.js @@ -2016,7 +2016,7 @@ Toolbox.prototype = { this.errorCountButton = this._createButtonState({ id: "command-button-errorcount", isInStartContainer: false, - isToolSupported: toolbox => true, + isToolSupported: () => true, description: L10N.getStr("toolbox.errorCountButton.description"), }); // Use updateErrorCountButton to set some properties so we don't have to repeat @@ -3363,7 +3363,7 @@ Toolbox.prototype = { return prefFront.getBoolPref(DISABLE_AUTOHIDE_PREF); }, - async _listFrames(event) { + async _listFrames() { if ( !this.target.getTrait("frames") || this.target.targetForm.ignoreSubFrames diff --git a/devtools/client/fronts/css-properties.js b/devtools/client/fronts/css-properties.js index 93e9d52900c3..47bfe3e41168 100644 --- a/devtools/client/fronts/css-properties.js +++ b/devtools/client/fronts/css-properties.js @@ -131,7 +131,7 @@ CssProperties.prototype = { * * @return {Array} An array of strings. */ - getNames(property) { + getNames() { return Object.keys(this.properties); }, diff --git a/devtools/client/fronts/node.js b/devtools/client/fronts/node.js index 8df63f2c1b89..d56f2d93f11e 100644 --- a/devtools/client/fronts/node.js +++ b/devtools/client/fronts/node.js @@ -585,7 +585,7 @@ class NodeFront extends FrontClassWithSpec(nodeSpec) { * and is only intended as a stopgap during the transition to the remote * protocol. If you depend on this you're likely to break soon. */ - rawNode(rawNode) { + rawNode() { if (!this.isLocalToBeDeprecated()) { console.warn("Tried to use rawNode on a remote connection."); return null; diff --git a/devtools/client/fronts/storage.js b/devtools/client/fronts/storage.js index 76374711263e..a6ccd8251491 100644 --- a/devtools/client/fronts/storage.js +++ b/devtools/client/fronts/storage.js @@ -26,7 +26,7 @@ for (const childSpec of Object.values(childSpecs)) { } // Update the storage fronts `hosts` properties with potential new hosts and remove the deleted ones - async _onStoreUpdate({ changed, added, deleted }) { + async _onStoreUpdate({ added, deleted }) { // `resourceKey` comes from the storage resource and is set by the legacy listener // -or- the resource transformer. const { resourceKey } = this; diff --git a/devtools/client/inspector/animation/components/App.js b/devtools/client/inspector/animation/components/App.js index 75a000286c02..74ce8e7b40e4 100644 --- a/devtools/client/inspector/animation/components/App.js +++ b/devtools/client/inspector/animation/components/App.js @@ -60,7 +60,7 @@ class App extends Component { }; } - shouldComponentUpdate(nextProps, nextState) { + shouldComponentUpdate(nextProps) { return ( this.props.animations.length !== 0 || nextProps.animations.length !== 0 ); diff --git a/devtools/client/inspector/animation/components/NoAnimationPanel.js b/devtools/client/inspector/animation/components/NoAnimationPanel.js index ea034e413d71..260325518bcd 100644 --- a/devtools/client/inspector/animation/components/NoAnimationPanel.js +++ b/devtools/client/inspector/animation/components/NoAnimationPanel.js @@ -26,7 +26,7 @@ class NoAnimationPanel extends Component { }; } - shouldComponentUpdate(nextProps, nextState) { + shouldComponentUpdate(nextProps) { return this.props.elementPickerEnabled != nextProps.elementPickerEnabled; } diff --git a/devtools/client/inspector/animation/components/PlaybackRateSelector.js b/devtools/client/inspector/animation/components/PlaybackRateSelector.js index 2d0de53a0c13..9f2c56cdb653 100644 --- a/devtools/client/inspector/animation/components/PlaybackRateSelector.js +++ b/devtools/client/inspector/animation/components/PlaybackRateSelector.js @@ -28,7 +28,7 @@ class PlaybackRateSelector extends PureComponent { }; } - static getDerivedStateFromProps(props, state) { + static getDerivedStateFromProps(props) { const { animations, playbackRates } = props; const currentPlaybackRates = sortAndUnique( diff --git a/devtools/client/inspector/animation/test/browser_animation_keyframes-progress-bar.js b/devtools/client/inspector/animation/test/browser_animation_keyframes-progress-bar.js index a7051d9a01c0..bb69249907db 100644 --- a/devtools/client/inspector/animation/test/browser_animation_keyframes-progress-bar.js +++ b/devtools/client/inspector/animation/test/browser_animation_keyframes-progress-bar.js @@ -91,7 +91,7 @@ add_task(async function () { } }); -function assertPosition(barEl, areaEl, expectedRate, animationInspector) { +function assertPosition(barEl, areaEl, expectedRate) { const controllerBounds = areaEl.getBoundingClientRect(); const barBounds = barEl.getBoundingClientRect(); const barX = barBounds.x + barBounds.width / 2 - controllerBounds.x; diff --git a/devtools/client/inspector/boxmodel/components/BoxModelInfo.js b/devtools/client/inspector/boxmodel/components/BoxModelInfo.js index e64faba05aaf..2444b7107d68 100644 --- a/devtools/client/inspector/boxmodel/components/BoxModelInfo.js +++ b/devtools/client/inspector/boxmodel/components/BoxModelInfo.js @@ -32,7 +32,7 @@ class BoxModelInfo extends PureComponent { this.onToggleGeometryEditor = this.onToggleGeometryEditor.bind(this); } - onToggleGeometryEditor(e) { + onToggleGeometryEditor() { this.props.onToggleGeometryEditor(); } diff --git a/devtools/client/inspector/breadcrumbs.js b/devtools/client/inspector/breadcrumbs.js index 68bafb591c8d..47700f7d401a 100644 --- a/devtools/client/inspector/breadcrumbs.js +++ b/devtools/client/inspector/breadcrumbs.js @@ -588,9 +588,8 @@ HTMLBreadcrumbs.prototype = { /** * On mouse out, make sure to unhighlight. - * @param {DOMEvent} event. */ - handleMouseOut(event) { + handleMouseOut() { this.inspector.highlighters.hideHighlighterType( this.inspector.highlighters.TYPES.BOXMODEL ); diff --git a/devtools/client/inspector/changes/reducers/changes.js b/devtools/client/inspector/changes/reducers/changes.js index 23e82a3ba7ea..82a5a92ed776 100644 --- a/devtools/client/inspector/changes/reducers/changes.js +++ b/devtools/client/inspector/changes/reducers/changes.js @@ -371,7 +371,7 @@ const reducers = { return state; }, - [RESET_CHANGES](state) { + [RESET_CHANGES]() { return INITIAL_STATE; }, }; diff --git a/devtools/client/inspector/changes/selectors/changes.js b/devtools/client/inspector/changes/selectors/changes.js index a6b99e45794c..a176e110829e 100644 --- a/devtools/client/inspector/changes/selectors/changes.js +++ b/devtools/client/inspector/changes/selectors/changes.js @@ -65,7 +65,7 @@ function getChangesTree(state, filter = {}) { } return Object.entries(state) - .filter(([sourceId, source]) => { + .filter(([sourceId]) => { // Use only matching sources if an array to filter by was provided. if (sourceIdsFilter.length) { return sourceIdsFilter.includes(sourceId); @@ -87,7 +87,7 @@ function getChangesTree(state, filter = {}) { ...source, // Build a new collection of rules keyed by rule id. rules: Object.entries(rules) - .filter(([ruleId, rule]) => { + .filter(([ruleId]) => { // Use only matching rules if an array to filter by was provided. if (rulesIdsFilter.length) { return rulesIdsFilter.includes(ruleId); @@ -237,22 +237,19 @@ function getChangesStylesheet(state, filter) { } // Iterate through all sources in the change tree and build a CSS stylesheet string. - return Object.entries(changeTree).reduce( - (stylesheetText, [sourceId, source]) => { - const { href, rules } = source; - // Write code comment with source origin - stylesheetText += `\n/* ${getSourceForDisplay(source)} | ${href} */\n`; - // Write CSS rules - stylesheetText += Object.entries(rules).reduce((str, [ruleId, rule]) => { - // Add a new like only after top-level rules (level == 0) - str += writeRule(ruleId, rule, 0) + "\n"; - return str; - }, ""); + return Object.values(changeTree).reduce((stylesheetText, source) => { + const { href, rules } = source; + // Write code comment with source origin + stylesheetText += `\n/* ${getSourceForDisplay(source)} | ${href} */\n`; + // Write CSS rules + stylesheetText += Object.entries(rules).reduce((str, [ruleId, rule]) => { + // Add a new like only after top-level rules (level == 0) + str += writeRule(ruleId, rule, 0) + "\n"; + return str; + }, ""); - return stylesheetText; - }, - "" - ); + return stylesheetText; + }, ""); } module.exports = { diff --git a/devtools/client/inspector/compatibility/CompatibilityView.js b/devtools/client/inspector/compatibility/CompatibilityView.js index 19c3263f00ce..548246fd54ae 100644 --- a/devtools/client/inspector/compatibility/CompatibilityView.js +++ b/devtools/client/inspector/compatibility/CompatibilityView.js @@ -32,7 +32,7 @@ const CompatibilityApp = createFactory( ); class CompatibilityView { - constructor(inspector, window) { + constructor(inspector) { this.inspector = inspector; this.inspector.store.injectReducer("compatibility", compatibilityReducer); @@ -133,7 +133,7 @@ class CompatibilityView { ); } - _parseMarkup(str) { + _parseMarkup() { // Using a BrowserLoader for the inspector is currently blocked on performance regressions, // see Bug 1471853. throw new Error( diff --git a/devtools/client/inspector/compatibility/actions/compatibility.js b/devtools/client/inspector/compatibility/actions/compatibility.js index fa9f410e0d3c..3ff512f1b02a 100644 --- a/devtools/client/inspector/compatibility/actions/compatibility.js +++ b/devtools/client/inspector/compatibility/actions/compatibility.js @@ -74,7 +74,7 @@ function clearDestroyedNodes() { } function initUserSettings() { - return async ({ dispatch, getState }) => { + return async ({ dispatch }) => { dispatch({ type: COMPATIBILITY_INIT_USER_SETTINGS_START }); try { diff --git a/devtools/client/inspector/compatibility/reducers/compatibility.js b/devtools/client/inspector/compatibility/reducers/compatibility.js index 925616760151..ce54e856a983 100644 --- a/devtools/client/inspector/compatibility/reducers/compatibility.js +++ b/devtools/client/inspector/compatibility/reducers/compatibility.js @@ -139,7 +139,7 @@ const reducers = { _showError(COMPATIBILITY_UPDATE_TOP_LEVEL_TARGET_FAILURE, error); return state; }, - [COMPATIBILITY_UPDATE_TOP_LEVEL_TARGET_COMPLETE](state, { target }) { + [COMPATIBILITY_UPDATE_TOP_LEVEL_TARGET_COMPLETE](state) { return Object.assign({}, state, { isTopLevelTargetProcessing: false }); }, }; diff --git a/devtools/client/inspector/computed/computed.js b/devtools/client/inspector/computed/computed.js index 7d2c129c7bba..9b051425e2c4 100644 --- a/devtools/client/inspector/computed/computed.js +++ b/devtools/client/inspector/computed/computed.js @@ -1383,7 +1383,7 @@ class PropertyView { /** * The action when a user clicks on the MDN help link for a property. */ - mdnLinkClick(event) { + mdnLinkClick() { if (!this.link) { return; } diff --git a/devtools/client/inspector/computed/test/browser_computed_keybindings_01.js b/devtools/client/inspector/computed/test/browser_computed_keybindings_01.js index 5a6681f13977..351d640bf92b 100644 --- a/devtools/client/inspector/computed/test/browser_computed_keybindings_01.js +++ b/devtools/client/inspector/computed/test/browser_computed_keybindings_01.js @@ -83,7 +83,7 @@ function checkHelpLinkKeybinding(view) { info('Check that MDN link is opened on "F1"'); const propView = getFirstVisiblePropertyView(view); return new Promise(resolve => { - propView.mdnLinkClick = function (event) { + propView.mdnLinkClick = function () { ok(true, "Pressing F1 opened the MDN link"); resolve(); }; diff --git a/devtools/client/inspector/flexbox/components/FlexItemSizingProperties.js b/devtools/client/inspector/flexbox/components/FlexItemSizingProperties.js index 00bea31e572b..ad26d3beab83 100644 --- a/devtools/client/inspector/flexbox/components/FlexItemSizingProperties.js +++ b/devtools/client/inspector/flexbox/components/FlexItemSizingProperties.js @@ -90,12 +90,10 @@ class FlexItemSizingProperties extends PureComponent { * The name for this CSS property * @param {String} value * The property value - * @param {Booleam} isDefaultValue - * Whether the value come from the browser default style * @return {Object} * The React component representing this CSS property */ - renderCssProperty(name, value, isDefaultValue) { + renderCssProperty(name, value) { return dom.span({ className: "css-property-link" }, `(${name}: ${value})`); } @@ -115,7 +113,7 @@ class FlexItemSizingProperties extends PureComponent { ); } - renderBaseSizeSection({ mainBaseSize, clampState }, properties, dimension) { + renderBaseSizeSection({ mainBaseSize }, properties, dimension) { const flexBasisValue = properties["flex-basis"]; const dimensionValue = properties[dimension]; diff --git a/devtools/client/inspector/flexbox/reducers/flexbox.js b/devtools/client/inspector/flexbox/reducers/flexbox.js index 856294a5497d..46c1d4525c80 100644 --- a/devtools/client/inspector/flexbox/reducers/flexbox.js +++ b/devtools/client/inspector/flexbox/reducers/flexbox.js @@ -58,7 +58,7 @@ const INITIAL_FLEXBOX = { }; const reducers = { - [CLEAR_FLEXBOX](flexbox, _) { + [CLEAR_FLEXBOX](_) { return INITIAL_FLEXBOX; }, diff --git a/devtools/client/inspector/fonts/reducers/font-editor.js b/devtools/client/inspector/fonts/reducers/font-editor.js index b40fff4ba143..fbfee2d6663e 100644 --- a/devtools/client/inspector/fonts/reducers/font-editor.js +++ b/devtools/client/inspector/fonts/reducers/font-editor.js @@ -62,7 +62,7 @@ const reducers = { return newState; }, - [RESET_EDITOR](state) { + [RESET_EDITOR]() { return { ...INITIAL_STATE }; }, diff --git a/devtools/client/inspector/grids/components/GridOutline.js b/devtools/client/inspector/grids/components/GridOutline.js index 65771f3f456e..2a7a195bd0cb 100644 --- a/devtools/client/inspector/grids/components/GridOutline.js +++ b/devtools/client/inspector/grids/components/GridOutline.js @@ -344,7 +344,7 @@ class GridOutline extends PureComponent { ); } - renderGridOutlineBorder(borderWidth, borderHeight, color) { + renderGridOutlineBorder(borderWidth, borderHeight) { return dom.rect({ key: "border", className: "grid-outline-border", diff --git a/devtools/client/inspector/markup/markup.js b/devtools/client/inspector/markup/markup.js index 1818632e17cc..7975d442f805 100644 --- a/devtools/client/inspector/markup/markup.js +++ b/devtools/client/inspector/markup/markup.js @@ -1551,7 +1551,7 @@ MarkupView.prototype = { } }, - _onTargetAvailable({ targetFront }) {}, + _onTargetAvailable() {}, _onTargetDestroyed({ targetFront, isModeSwitching }) { // Bug 1776250: We only watch targets in order to update containers which @@ -2099,14 +2099,12 @@ MarkupView.prototype = { * Mark the given node selected, and update the inspector.selection * object's NodeFront to keep consistent state between UI and selection. * - * @param {NodeFront} aNode + * @param {NodeFront} node * The NodeFront to mark as selected. - * @param {String} reason - * The reason for marking the node as selected. * @return {Boolean} False if the node is already marked as selected, true * otherwise. */ - markNodeAsSelected(node, reason = "nodeselected") { + markNodeAsSelected(node) { const container = this.getContainer(node); return this._markContainerAsSelected(container); }, diff --git a/devtools/client/inspector/markup/test/browser_markup_tag_edit_07.js b/devtools/client/inspector/markup/test/browser_markup_tag_edit_07.js index 38f7361725c0..563863d6143a 100644 --- a/devtools/client/inspector/markup/test/browser_markup_tag_edit_07.js +++ b/devtools/client/inspector/markup/test/browser_markup_tag_edit_07.js @@ -59,7 +59,7 @@ var TEST_DATA = [ expectedAttributes: { style: DATA_URL_INLINE_STYLE, }, - validate: (container, inspector) => { + validate: container => { const editor = container.editor; const visibleAttrText = editor.attrElements .get("style") @@ -75,7 +75,7 @@ var TEST_DATA = [ expectedAttributes: { "data-long": LONG_ATTRIBUTE, }, - validate: (container, inspector) => { + validate: container => { const editor = container.editor; const visibleAttrText = editor.attrElements .get("data-long") @@ -91,7 +91,7 @@ var TEST_DATA = [ expectedAttributes: { src: DATA_URL_ATTRIBUTE, }, - validate: (container, inspector) => { + validate: container => { const editor = container.editor; const visibleAttrText = editor.attrElements .get("src") @@ -107,17 +107,17 @@ var TEST_DATA = [ expectedAttributes: { "data-long": LONG_ATTRIBUTE, }, - setUp(inspector) { + setUp() { Services.prefs.setBoolPref("devtools.markup.collapseAttributes", false); }, - validate: (container, inspector) => { + validate: container => { const editor = container.editor; const visibleAttrText = editor.attrElements .get("data-long") .querySelector(".attr-value").textContent; is(visibleAttrText, LONG_ATTRIBUTE); }, - tearDown(inspector) { + tearDown() { Services.prefs.clearUserPref("devtools.markup.collapseAttributes"); }, }, @@ -127,10 +127,10 @@ var TEST_DATA = [ expectedAttributes: { "data-long": LONG_ATTRIBUTE, }, - setUp(inspector) { + setUp() { Services.prefs.setIntPref("devtools.markup.collapseAttributeLength", 2); }, - validate: (container, inspector) => { + validate: container => { const firstChar = LONG_ATTRIBUTE[0]; const lastChar = LONG_ATTRIBUTE[LONG_ATTRIBUTE.length - 1]; const collapsed = firstChar + "\u2026" + lastChar; @@ -140,7 +140,7 @@ var TEST_DATA = [ .querySelector(".attr-value").textContent; is(visibleAttrText, collapsed); }, - tearDown(inspector) { + tearDown() { Services.prefs.clearUserPref("devtools.markup.collapseAttributeLength"); }, }, diff --git a/devtools/client/inspector/node-picker.js b/devtools/client/inspector/node-picker.js index 24b53b51e03b..ca837b12f157 100644 --- a/devtools/client/inspector/node-picker.js +++ b/devtools/client/inspector/node-picker.js @@ -22,11 +22,9 @@ loader.lazyRequireGetter( * * @param {Commands} commands * The commands object with all interfaces defined from devtools/shared/commands/ - * @param {Selection} selection - * The global Selection object */ class NodePicker extends EventEmitter { - constructor(commands, selection) { + constructor(commands) { super(); this.commands = commands; this.targetCommand = commands.targetCommand; @@ -305,7 +303,7 @@ class NodePicker extends EventEmitter { * When the picker is canceled, stop the picker, and make sure the toolbox * gets the focus. */ - #onCanceled = data => { + #onCanceled = () => { return this.stop({ canceled: true }); }; } diff --git a/devtools/client/inspector/rules/test/browser_rules_colorpicker-contrast-ratio.js b/devtools/client/inspector/rules/test/browser_rules_colorpicker-contrast-ratio.js index 6bdb9dd9d327..42a0f869049e 100644 --- a/devtools/client/inspector/rules/test/browser_rules_colorpicker-contrast-ratio.js +++ b/devtools/client/inspector/rules/test/browser_rules_colorpicker-contrast-ratio.js @@ -122,11 +122,7 @@ async function checkColorPickerConstrastData({ expectedContrastValueScore, expectContrastRange = false, expectedMinContrastValueResult, - expectedMinContrastValueTitle, - expectedMinContrastValueScore, expectedMaxContrastValueResult, - expectedMaxContrastValueTitle, - expectedMaxContrastValueScore, }) { info(`Checking color picker: "${label}"`); const cPicker = view.tooltips.getTooltip("colorPicker"); diff --git a/devtools/client/inspector/rules/test/browser_rules_edit-size-property-dragging.js b/devtools/client/inspector/rules/test/browser_rules_edit-size-property-dragging.js index c95506de504f..a10e7a6625a3 100644 --- a/devtools/client/inspector/rules/test/browser_rules_edit-size-property-dragging.js +++ b/devtools/client/inspector/rules/test/browser_rules_edit-size-property-dragging.js @@ -335,12 +335,11 @@ async function runIncrementTest(editor, view, tests) { * @param {String} options.description * @param {Boolean} options.ctrl Small increment key * @param {Boolean} options.alt Small increment key for macosx - * @param {Boolean} option.deadzoneIncluded True if the provided distance + * @param {Boolean} options.deadzoneIncluded True if the provided distance * accounts for the deadzone. When false, the deadzone will automatically * be added to the distance. - * @param {CSSRuleView} view */ -async function testIncrement(editor, options, view) { +async function testIncrement(editor, options) { info("Running subtest: " + options.description); editor.valueSpan.scrollIntoView(); diff --git a/devtools/client/inspector/rules/test/browser_rules_original-source-link.js b/devtools/client/inspector/rules/test/browser_rules_original-source-link.js index 9d440659a2f1..473d0037b0e7 100644 --- a/devtools/client/inspector/rules/test/browser_rules_original-source-link.js +++ b/devtools/client/inspector/rules/test/browser_rules_original-source-link.js @@ -64,7 +64,7 @@ async function testClickingLink(toolbox, view) { function waitForOriginalStyleSheetEditorSelection(toolbox) { const panel = toolbox.getCurrentPanel(); - return new Promise((resolve, reject) => { + return new Promise(resolve => { const maybeContinue = editor => { // The style editor selects the first sheet at first load before // selecting the desired sheet. diff --git a/devtools/client/inspector/rules/test/browser_rules_original-source-link2.js b/devtools/client/inspector/rules/test/browser_rules_original-source-link2.js index 87963f9ec54f..6e8faecc33c3 100644 --- a/devtools/client/inspector/rules/test/browser_rules_original-source-link2.js +++ b/devtools/client/inspector/rules/test/browser_rules_original-source-link2.js @@ -61,7 +61,7 @@ async function testClickingLink(toolbox, view) { function waitForOriginalStyleSheetEditorSelection(toolbox) { const panel = toolbox.getCurrentPanel(); - return new Promise((resolve, reject) => { + return new Promise(resolve => { const maybeContinue = editor => { // The style editor selects the first sheet at first load before // selecting the desired sheet. diff --git a/devtools/client/inspector/rules/views/rule-editor.js b/devtools/client/inspector/rules/views/rule-editor.js index 93e24f09461f..a5717976d07b 100644 --- a/devtools/client/inspector/rules/views/rule-editor.js +++ b/devtools/client/inspector/rules/views/rule-editor.js @@ -410,7 +410,7 @@ RuleEditor.prototype = { this._ruleViewIsEditing = this.ruleView.isEditing; }); - code.addEventListener("click", event => { + code.addEventListener("click", () => { const selection = this.doc.defaultView.getSelection(); if (selection.isCollapsed && !this._ruleViewIsEditing) { this.newProperty(); @@ -905,10 +905,8 @@ RuleEditor.prototype = { * True if the change should be applied. * @param {Number} direction * The move focus direction number. - * @param {Number} key - * The event keyCode that trigger the editor to close */ - async _onSelectorDone(value, commit, direction, key) { + async _onSelectorDone(value, commit, direction) { if ( !commit || this.isEditing || diff --git a/devtools/client/inspector/rules/views/text-property-editor.js b/devtools/client/inspector/rules/views/text-property-editor.js index 8546417cfbb6..edcdb856a879 100644 --- a/devtools/client/inspector/rules/views/text-property-editor.js +++ b/devtools/client/inspector/rules/views/text-property-editor.js @@ -385,7 +385,7 @@ TextPropertyEditor.prototype = { } }); - this.valueSpan.addEventListener("mouseup", event => { + this.valueSpan.addEventListener("mouseup", () => { // if we have dragged, we will handle the pending click in _draggingOnMouseUp instead if (this._hasDragged) { return; @@ -1146,10 +1146,8 @@ TextPropertyEditor.prototype = { * True if the change should be applied. * @param {Number} direction * The move focus direction number. - * @param {Number} key - * The event keyCode that trigger the editor to close */ - _onNameDone(value, commit, direction, key) { + _onNameDone(value, commit, direction) { const isNameUnchanged = (!commit && !this.ruleEditor.isEditing) || this.committed.name === value; if (this.prop.value && isNameUnchanged) { @@ -1233,10 +1231,8 @@ TextPropertyEditor.prototype = { * True if the change should be applied. * @param {Number} direction * The move focus direction number. - * @param {Number} key - * The event keyCode that trigger the editor to close */ - _onValueDone(value = "", commit, direction, key) { + _onValueDone(value = "", commit, direction) { const parsedProperties = this._getValueAndExtraProperties(value); const val = parseSingleValue( this.cssProperties.isKnown, diff --git a/devtools/client/inspector/shared/highlighters-overlay.js b/devtools/client/inspector/shared/highlighters-overlay.js index 6082b8b8426b..7f44f8b55587 100644 --- a/devtools/client/inspector/shared/highlighters-overlay.js +++ b/devtools/client/inspector/shared/highlighters-overlay.js @@ -793,13 +793,8 @@ class HighlightersOverlay { /** * Called after the shapes highlighter was hidden. - * - * @param {Object} data - * Data associated with the event. - * Contains: - * - {NodeFront} node: The NodeFront of the element that was highlighted. */ - onShapesHighlighterHidden(data) { + onShapesHighlighterHidden() { this.emit( "shapes-highlighter-hidden", this.shapesHighlighterShown, @@ -1178,7 +1173,7 @@ class HighlightersOverlay { async restoreParentGridHighlighter(node) { // Find the highlighter map entry for the subgrid whose parent grid is the given node. const entry = Array.from(this.gridHighlighters.entries()).find( - ([key, value]) => { + ([, value]) => { return value?.parentGridNode === node; } ); diff --git a/devtools/client/inspector/test/browser_inspector_highlighter-autohide-config_03.js b/devtools/client/inspector/test/browser_inspector_highlighter-autohide-config_03.js index 188b99a7cb29..e90bd87ad02f 100644 --- a/devtools/client/inspector/test/browser_inspector_highlighter-autohide-config_03.js +++ b/devtools/client/inspector/test/browser_inspector_highlighter-autohide-config_03.js @@ -60,7 +60,7 @@ add_task(async function () { somehow not overwritten and fires another "highlighter-hidden" event. */ let wasEmitted = false; - const waitForExtraEvent = new Promise((resolve, reject) => { + const waitForExtraEvent = new Promise(resolve => { const _handler = () => { wasEmitted = true; resolve(); diff --git a/devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-events.js b/devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-events.js index 0c05aa219f41..5fa5567e3fef 100644 --- a/devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-events.js +++ b/devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-events.js @@ -60,10 +60,10 @@ const MOVE_EVENTS_DATA = [ // Mouse initialization for right snapping { type: "mouse", - x: (width, height) => width - 5, + x: width => width - 5, y: 0, expected: { - x: (width, height) => width - 5, + x: width => width - 5, y: 0, }, }, @@ -73,7 +73,7 @@ const MOVE_EVENTS_DATA = [ key: "VK_RIGHT", shift: true, expected: { - x: (width, height) => width, + x: width => width, y: 0, }, desc: "Right snapping to x=max window width available", diff --git a/devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-label.js b/devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-label.js index d9413e5d3943..37d3070c04a8 100644 --- a/devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-label.js +++ b/devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-label.js @@ -65,14 +65,14 @@ const TEST_DATA = [ }, { desc: "Move the mouse to the top left", - getCoordinates: (width, height) => { + getCoordinates: () => { return { x: 0, y: 0 }; }, expectedPositions: { top: false, right: true, left: false }, }, { desc: "Move the mouse to the top right", - getCoordinates: (width, height) => { + getCoordinates: width => { return { x: width, y: 0 }; }, expectedPositions: { top: false, right: false, left: true }, diff --git a/devtools/client/inspector/test/browser_inspector_highlighter-geometry_01.js b/devtools/client/inspector/test/browser_inspector_highlighter-geometry_01.js index c50dee30b0f3..bfdfd12cd8a1 100644 --- a/devtools/client/inspector/test/browser_inspector_highlighter-geometry_01.js +++ b/devtools/client/inspector/test/browser_inspector_highlighter-geometry_01.js @@ -58,7 +58,6 @@ async function hasArrowsAndLabelsAndHandlers({ getElementAttribute }) { async function isHiddenForNonPositionedNonSizedElement({ show, - hide, isElementHidden, }) { info("Asking to show the highlighter on an inline, non p ositioned element"); diff --git a/devtools/client/inspector/test/browser_inspector_highlighter-measure_03.js b/devtools/client/inspector/test/browser_inspector_highlighter-measure_03.js index 906284ba86fe..dbe70d83aefc 100644 --- a/devtools/client/inspector/test/browser_inspector_highlighter-measure_03.js +++ b/devtools/client/inspector/test/browser_inspector_highlighter-measure_03.js @@ -16,10 +16,10 @@ const WIDTH = 160; const HEIGHT = 100; const HANDLER_MAP = { - top(areaWidth, areaHeight) { + top(areaWidth) { return { x: Math.round(areaWidth / 2), y: 0 }; }, - topright(areaWidth, areaHeight) { + topright(areaWidth) { return { x: areaWidth, y: 0 }; }, right(areaWidth, areaHeight) { @@ -37,7 +37,7 @@ const HANDLER_MAP = { left(areaWidth, areaHeight) { return { x: 0, y: Math.round(areaHeight / 2) }; }, - topleft(areaWidth, areaHeight) { + topleft() { return { x: 0, y: 0 }; }, }; diff --git a/devtools/client/inspector/test/browser_inspector_highlighter-measure_04.js b/devtools/client/inspector/test/browser_inspector_highlighter-measure_04.js index d9dcd5d89fa3..8493981dd3ac 100644 --- a/devtools/client/inspector/test/browser_inspector_highlighter-measure_04.js +++ b/devtools/client/inspector/test/browser_inspector_highlighter-measure_04.js @@ -18,10 +18,10 @@ const X_OFFSET = 15; const Y_OFFSET = 10; const HANDLER_MAP = { - top(areaWidth, areaHeight) { + top(areaWidth) { return { x: Math.round(areaWidth / 2), y: 0 }; }, - topright(areaWidth, areaHeight) { + topright(areaWidth) { return { x: areaWidth, y: 0 }; }, right(areaWidth, areaHeight) { @@ -39,7 +39,7 @@ const HANDLER_MAP = { left(areaWidth, areaHeight) { return { x: 0, y: Math.round(areaHeight / 2) }; }, - topleft(areaWidth, areaHeight) { + topleft() { return { x: 0, y: 0 }; }, }; diff --git a/devtools/client/inspector/toolsidebar.js b/devtools/client/inspector/toolsidebar.js index cff5eb96fa17..422ae76b4373 100644 --- a/devtools/client/inspector/toolsidebar.js +++ b/devtools/client/inspector/toolsidebar.js @@ -151,10 +151,8 @@ ToolSidebar.prototype = { * @param {String} tabId The ID of the tab that was used to register it, or * the tab id attribute value if the tab existed before the sidebar * got created. - * @param {String} tabPanelId Optional. If provided, this ID will be used - * instead of the tabId to retrieve and remove the corresponding */ - removeTab(tabId, tabPanelId) { + removeTab(tabId) { this._tabbar.removeTab(tabId); this.emit("tab-unregistered", tabId); diff --git a/devtools/client/jsonview/Sniffer.sys.mjs b/devtools/client/jsonview/Sniffer.sys.mjs index d585ce8ab2bf..8deeece7061b 100644 --- a/devtools/client/jsonview/Sniffer.sys.mjs +++ b/devtools/client/jsonview/Sniffer.sys.mjs @@ -35,7 +35,7 @@ function getContentDisposition(channel) { * a compartment at startup when no JSON is being viewed. */ export class Sniffer { - getMIMETypeFromContent(request, data, length) { + getMIMETypeFromContent(request) { if (request instanceof Ci.nsIChannel) { // JSON View is enabled only for top level loads only. if ( diff --git a/devtools/client/jsonview/components/Headers.js b/devtools/client/jsonview/components/Headers.js index 7477627328b2..01b616071817 100644 --- a/devtools/client/jsonview/components/Headers.js +++ b/devtools/client/jsonview/components/Headers.js @@ -4,7 +4,7 @@ "use strict"; -define(function (require, exports, module) { +define(function (require, exports) { const { createFactory, Component, diff --git a/devtools/client/jsonview/components/HeadersPanel.js b/devtools/client/jsonview/components/HeadersPanel.js index 0e9e17190e74..45f216afb51a 100644 --- a/devtools/client/jsonview/components/HeadersPanel.js +++ b/devtools/client/jsonview/components/HeadersPanel.js @@ -4,7 +4,7 @@ "use strict"; -define(function (require, exports, module) { +define(function (require, exports) { const { Component } = require("devtools/client/shared/vendor/react"); const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const dom = require("devtools/client/shared/vendor/react-dom-factories"); diff --git a/devtools/client/jsonview/components/HeadersToolbar.js b/devtools/client/jsonview/components/HeadersToolbar.js index f9122c3a31ec..4033b6f1e4b5 100644 --- a/devtools/client/jsonview/components/HeadersToolbar.js +++ b/devtools/client/jsonview/components/HeadersToolbar.js @@ -4,7 +4,7 @@ "use strict"; -define(function (require, exports, module) { +define(function (require, exports) { const { Component } = require("devtools/client/shared/vendor/react"); const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { createFactories } = require("devtools/client/shared/react-utils"); @@ -31,7 +31,7 @@ define(function (require, exports, module) { // Commands - onCopy(event) { + onCopy() { this.props.actions.onCopyHeaders(); } diff --git a/devtools/client/jsonview/components/JsonPanel.js b/devtools/client/jsonview/components/JsonPanel.js index f569aad4c645..6e7aef1f1640 100644 --- a/devtools/client/jsonview/components/JsonPanel.js +++ b/devtools/client/jsonview/components/JsonPanel.js @@ -4,7 +4,7 @@ "use strict"; -define(function (require, exports, module) { +define(function (require, exports) { const { createFactory, Component, @@ -71,7 +71,7 @@ define(function (require, exports, module) { document.removeEventListener("keypress", this.onKeyPress, true); } - onKeyPress(e) { + onKeyPress() { // XXX shortcut for focusing the Filter field (see Bug 1178771). } diff --git a/devtools/client/jsonview/components/JsonToolbar.js b/devtools/client/jsonview/components/JsonToolbar.js index 34e6ed285bbb..2e3a07453881 100644 --- a/devtools/client/jsonview/components/JsonToolbar.js +++ b/devtools/client/jsonview/components/JsonToolbar.js @@ -4,7 +4,7 @@ "use strict"; -define(function (require, exports, module) { +define(function (require, exports) { const { Component } = require("devtools/client/shared/vendor/react"); const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); @@ -42,19 +42,19 @@ define(function (require, exports, module) { // Commands - onSave(event) { + onSave() { this.props.actions.onSaveJson(); } - onCopy(event) { + onCopy() { this.props.actions.onCopyJson(); } - onCollapse(event) { + onCollapse() { this.props.actions.onCollapse(); } - onExpand(event) { + onExpand() { this.props.actions.onExpand(); } diff --git a/devtools/client/jsonview/components/LiveText.js b/devtools/client/jsonview/components/LiveText.js index d90c099340cc..8e3563d2daab 100644 --- a/devtools/client/jsonview/components/LiveText.js +++ b/devtools/client/jsonview/components/LiveText.js @@ -4,7 +4,7 @@ "use strict"; -define(function (require, exports, module) { +define(function (require, exports) { const { Component } = require("devtools/client/shared/vendor/react"); const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { findDOMNode } = require("devtools/client/shared/vendor/react-dom"); diff --git a/devtools/client/jsonview/components/MainTabbedArea.js b/devtools/client/jsonview/components/MainTabbedArea.js index 5341e590ce85..d800a1f58cf5 100644 --- a/devtools/client/jsonview/components/MainTabbedArea.js +++ b/devtools/client/jsonview/components/MainTabbedArea.js @@ -4,7 +4,7 @@ "use strict"; -define(function (require, exports, module) { +define(function (require, exports) { const { Component } = require("devtools/client/shared/vendor/react"); const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { createFactories } = require("devtools/client/shared/react-utils"); diff --git a/devtools/client/jsonview/components/SearchBox.js b/devtools/client/jsonview/components/SearchBox.js index cb736db85b73..45b9ac8752cb 100644 --- a/devtools/client/jsonview/components/SearchBox.js +++ b/devtools/client/jsonview/components/SearchBox.js @@ -4,7 +4,7 @@ "use strict"; -define(function (require, exports, module) { +define(function (require, exports) { const { Component } = require("devtools/client/shared/vendor/react"); const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const dom = require("devtools/client/shared/vendor/react-dom-factories"); diff --git a/devtools/client/jsonview/components/TextPanel.js b/devtools/client/jsonview/components/TextPanel.js index b5b674b6cec9..30cfede32614 100644 --- a/devtools/client/jsonview/components/TextPanel.js +++ b/devtools/client/jsonview/components/TextPanel.js @@ -4,7 +4,7 @@ "use strict"; -define(function (require, exports, module) { +define(function (require, exports) { const { Component } = require("devtools/client/shared/vendor/react"); const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const dom = require("devtools/client/shared/vendor/react-dom-factories"); diff --git a/devtools/client/jsonview/components/TextToolbar.js b/devtools/client/jsonview/components/TextToolbar.js index 0ab16ef1922d..e0bbee2d0ff3 100644 --- a/devtools/client/jsonview/components/TextToolbar.js +++ b/devtools/client/jsonview/components/TextToolbar.js @@ -4,7 +4,7 @@ "use strict"; -define(function (require, exports, module) { +define(function (require, exports) { const { Component } = require("devtools/client/shared/vendor/react"); const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const { createFactories } = require("devtools/client/shared/react-utils"); @@ -33,15 +33,15 @@ define(function (require, exports, module) { // Commands - onPrettify(event) { + onPrettify() { this.props.actions.onPrettify(); } - onSave(event) { + onSave() { this.props.actions.onSaveJson(); } - onCopy(event) { + onCopy() { this.props.actions.onCopyJson(); } diff --git a/devtools/client/jsonview/components/reps/Toolbar.js b/devtools/client/jsonview/components/reps/Toolbar.js index 458acf236f40..bed0a77799c0 100644 --- a/devtools/client/jsonview/components/reps/Toolbar.js +++ b/devtools/client/jsonview/components/reps/Toolbar.js @@ -4,7 +4,7 @@ "use strict"; -define(function (require, exports, module) { +define(function (require, exports) { const { Component } = require("devtools/client/shared/vendor/react"); const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const dom = require("devtools/client/shared/vendor/react-dom-factories"); diff --git a/devtools/client/jsonview/converter-child.js b/devtools/client/jsonview/converter-child.js index 79fd4a68cda4..e249de018025 100644 --- a/devtools/client/jsonview/converter-child.js +++ b/devtools/client/jsonview/converter-child.js @@ -65,14 +65,14 @@ Converter.prototype = { * 5. convert does nothing, it's just the synchronous version * of asyncConvertData */ - convert(fromStream, fromType, toType, ctx) { + convert(fromStream) { return fromStream; }, - asyncConvertData(fromType, toType, listener, ctx) { + asyncConvertData(fromType, toType, listener) { this.listener = listener; }, - getConvertedType(fromType, channel) { + getConvertedType() { return "text/html"; }, @@ -395,7 +395,7 @@ function keepThemeUpdated(win) { addThemeObserver(listener); win.addEventListener( "unload", - function (event) { + function () { removeThemeObserver(listener); win = null; }, diff --git a/devtools/client/jsonview/json-viewer.js b/devtools/client/jsonview/json-viewer.js index 131307302e0f..cefeb7b8f649 100644 --- a/devtools/client/jsonview/json-viewer.js +++ b/devtools/client/jsonview/json-viewer.js @@ -4,7 +4,7 @@ "use strict"; -define(function (require, exports, module) { +define(function (require) { const { render } = require("devtools/client/shared/vendor/react-dom"); const { createFactories } = require("devtools/client/shared/react-utils"); const { MainTabbedArea } = createFactories( @@ -79,7 +79,7 @@ define(function (require, exports, module) { theApp.setState({ searchFilter: value }); }, - onPrettify(data) { + onPrettify() { if (input.json instanceof Error) { // Cannot prettify invalid JSON return; @@ -96,12 +96,12 @@ define(function (require, exports, module) { input.prettified = !input.prettified; }, - onCollapse(data) { + onCollapse() { input.expandedNodes.clear(); theApp.forceUpdate(); }, - onExpand(data) { + onExpand() { input.expandedNodes = TreeViewClass.getExpandedNodes(input.json); theApp.setState({ expandedNodes: input.expandedNodes }); }, diff --git a/devtools/client/jsonview/test/browser_jsonview_expand_collapse.js b/devtools/client/jsonview/test/browser_jsonview_expand_collapse.js index 46ce800b1fa0..04e0834f2a86 100644 --- a/devtools/client/jsonview/test/browser_jsonview_expand_collapse.js +++ b/devtools/client/jsonview/test/browser_jsonview_expand_collapse.js @@ -45,7 +45,7 @@ add_task(async function () { const json = JSON.stringify({ data: Array(1e5) .fill() - .map(x => "hoot"), + .map(() => "hoot"), status: "ok", }); Assert.greater( diff --git a/devtools/client/jsonview/test/browser_jsonview_serviceworker.js b/devtools/client/jsonview/test/browser_jsonview_serviceworker.js index 3d68cad065ff..c8be1a939a30 100644 --- a/devtools/client/jsonview/test/browser_jsonview_serviceworker.js +++ b/devtools/client/jsonview/test/browser_jsonview_serviceworker.js @@ -34,7 +34,7 @@ add_task(async function () { resolve(); return; } - worker.addEventListener("statechange", evt => { + worker.addEventListener("statechange", () => { if (worker.state === "activated") { resolve(); } diff --git a/devtools/client/memory/actions/census-display.js b/devtools/client/memory/actions/census-display.js index d266fe04a552..9abd16d99b0b 100644 --- a/devtools/client/memory/actions/census-display.js +++ b/devtools/client/memory/actions/census-display.js @@ -10,7 +10,7 @@ const { } = require("resource://devtools/client/memory/actions/refresh.js"); exports.setCensusDisplayAndRefresh = function (heapWorker, display) { - return async function ({ dispatch, getState }) { + return async function ({ dispatch }) { dispatch(setCensusDisplay(display)); await dispatch(refresh(heapWorker)); }; diff --git a/devtools/client/memory/actions/filter.js b/devtools/client/memory/actions/filter.js index 1bc9fd35dbba..7f5295872d54 100644 --- a/devtools/client/memory/actions/filter.js +++ b/devtools/client/memory/actions/filter.js @@ -26,7 +26,7 @@ const debouncedRefreshDispatcher = debounce( ); exports.setFilterStringAndRefresh = function (filterString, heapWorker) { - return ({ dispatch, getState }) => { + return ({ dispatch }) => { dispatch(setFilterString(filterString)); debouncedRefreshDispatcher(dispatch, heapWorker); }; diff --git a/devtools/client/memory/actions/io.js b/devtools/client/memory/actions/io.js index c811478df554..bedd5d8bfc90 100644 --- a/devtools/client/memory/actions/io.js +++ b/devtools/client/memory/actions/io.js @@ -25,7 +25,7 @@ const { const VALID_EXPORT_STATES = [states.SAVED, states.READ]; exports.pickFileAndExportSnapshot = function (snapshot) { - return async function ({ dispatch, getState }) { + return async function ({ dispatch }) { const outputFile = await openFilePicker({ title: L10N.getFormatStr("snapshot.io.save.window"), defaultName: PathUtils.filename(snapshot.path), @@ -42,7 +42,7 @@ exports.pickFileAndExportSnapshot = function (snapshot) { }; const exportSnapshot = (exports.exportSnapshot = function (snapshot, dest) { - return async function ({ dispatch, getState }) { + return async function ({ dispatch }) { dispatch({ type: actions.EXPORT_SNAPSHOT_START, snapshot }); assert( @@ -62,7 +62,7 @@ const exportSnapshot = (exports.exportSnapshot = function (snapshot, dest) { }); exports.pickFileAndImportSnapshotAndCensus = function (heapWorker) { - return async function ({ dispatch, getState }) { + return async function ({ dispatch }) { const input = await openFilePicker({ title: L10N.getFormatStr("snapshot.io.import.window"), filters: [[L10N.getFormatStr("snapshot.io.filter"), "*.fxsnapshot"]], diff --git a/devtools/client/memory/actions/label-display.js b/devtools/client/memory/actions/label-display.js index c8a6db35ec49..cd90fcff3bb2 100644 --- a/devtools/client/memory/actions/label-display.js +++ b/devtools/client/memory/actions/label-display.js @@ -14,7 +14,7 @@ const { * current data. */ exports.setLabelDisplayAndRefresh = function (heapWorker, display) { - return async function ({ dispatch, getState }) { + return async function ({ dispatch }) { // Clears out all stored census data and sets the display. dispatch(setLabelDisplay(display)); await dispatch(refresh(heapWorker)); diff --git a/devtools/client/memory/actions/snapshot.js b/devtools/client/memory/actions/snapshot.js index 63885be251f4..21b54e9e284a 100644 --- a/devtools/client/memory/actions/snapshot.js +++ b/devtools/client/memory/actions/snapshot.js @@ -727,7 +727,7 @@ const computeAndFetchDominatorTree = (exports.computeAndFetchDominatorTree = return id; }, - async task(heapWorker, id, removeFromCache, dispatch, getState) { + async task(heapWorker, id, removeFromCache, dispatch) { const dominatorTreeId = await dispatch( computeDominatorTree(heapWorker, id) ); @@ -843,7 +843,7 @@ exports.clearSnapshots = function (heapWorker) { * @param {snapshotModel} snapshot */ exports.deleteSnapshot = function (heapWorker, snapshot) { - return async function ({ dispatch, getState }) { + return async function ({ dispatch }) { dispatch({ type: actions.DELETE_SNAPSHOTS_START, ids: [snapshot.id] }); try { diff --git a/devtools/client/memory/actions/tree-map-display.js b/devtools/client/memory/actions/tree-map-display.js index e1c4a2113279..38de0478c3a9 100644 --- a/devtools/client/memory/actions/tree-map-display.js +++ b/devtools/client/memory/actions/tree-map-display.js @@ -13,7 +13,7 @@ const { * census. */ exports.setTreeMapAndRefresh = function (heapWorker, display) { - return async function ({ dispatch, getState }) { + return async function ({ dispatch }) { dispatch(setTreeMap(display)); await dispatch(refresh(heapWorker)); }; diff --git a/devtools/client/memory/actions/view.js b/devtools/client/memory/actions/view.js index af1bc7b21ad3..5f1ab5c26355 100644 --- a/devtools/client/memory/actions/view.js +++ b/devtools/client/memory/actions/view.js @@ -49,7 +49,7 @@ const popView = (exports.popView = function () { * @param {HeapAnalysesClient} heapWorker */ exports.changeViewAndRefresh = function (view, heapWorker) { - return async function ({ dispatch, getState }) { + return async function ({ dispatch }) { dispatch(changeView(view)); await dispatch(refresh.refresh(heapWorker)); }; @@ -62,7 +62,7 @@ exports.changeViewAndRefresh = function (view, heapWorker) { * @param {HeapAnalysesClient} heapWorker */ exports.popViewAndRefresh = function (heapWorker) { - return async function ({ dispatch, getState }) { + return async function ({ dispatch }) { dispatch(popView()); await dispatch(refresh.refresh(heapWorker)); }; diff --git a/devtools/client/memory/components/CensusTreeItem.js b/devtools/client/memory/components/CensusTreeItem.js index 39fdbeb0522e..b3dd5545de22 100644 --- a/devtools/client/memory/components/CensusTreeItem.js +++ b/devtools/client/memory/components/CensusTreeItem.js @@ -45,7 +45,7 @@ class CensusTreeItem extends Component { this.toLabel = this.toLabel.bind(this); } - shouldComponentUpdate(nextProps, nextState) { + shouldComponentUpdate(nextProps) { return ( this.props.item != nextProps.item || this.props.depth != nextProps.depth || diff --git a/devtools/client/memory/components/DominatorTree.js b/devtools/client/memory/components/DominatorTree.js index 9c767cece7a4..3cb1f89856a7 100644 --- a/devtools/client/memory/components/DominatorTree.js +++ b/devtools/client/memory/components/DominatorTree.js @@ -44,7 +44,7 @@ class DominatorTreeSubtreeFetchingClass extends Component { }; } - shouldComponentUpdate(nextProps, nextState) { + shouldComponentUpdate(nextProps) { return ( this.props.depth !== nextProps.depth || this.props.focused !== nextProps.focused @@ -84,7 +84,7 @@ class DominatorTreeSiblingLinkClass extends Component { }; } - shouldComponentUpdate(nextProps, nextState) { + shouldComponentUpdate(nextProps) { return ( this.props.depth !== nextProps.depth || this.props.focused !== nextProps.focused @@ -129,7 +129,7 @@ class DominatorTree extends Component { }; } - shouldComponentUpdate(nextProps, nextState) { + shouldComponentUpdate(nextProps) { // Safe to use referential equality here because all of our mutations on // dominator tree models use immutableUpdate in a persistent manner. The // exception to the rule are mutations of the expanded set, however we take diff --git a/devtools/client/memory/components/DominatorTreeItem.js b/devtools/client/memory/components/DominatorTreeItem.js index 59cb542a3adb..88dddf0563f6 100644 --- a/devtools/client/memory/components/DominatorTreeItem.js +++ b/devtools/client/memory/components/DominatorTreeItem.js @@ -47,7 +47,7 @@ class DominatorTreeItem extends Component { }; } - shouldComponentUpdate(nextProps, nextState) { + shouldComponentUpdate(nextProps) { return ( this.props.item != nextProps.item || this.props.depth != nextProps.depth || diff --git a/devtools/client/memory/components/Individuals.js b/devtools/client/memory/components/Individuals.js index dd0e9acc813d..ed48232c68ed 100644 --- a/devtools/client/memory/components/Individuals.js +++ b/devtools/client/memory/components/Individuals.js @@ -42,9 +42,9 @@ class Individuals extends Component { autoExpandDepth: 0, preventNavigationOnArrowRight: false, focused: individuals.focused, - getParent: node => null, - getChildren: node => [], - isExpanded: node => false, + getParent: () => null, + getChildren: () => [], + isExpanded: () => false, onExpand: () => {}, onCollapse: () => {}, onFocus, diff --git a/devtools/client/memory/components/TreeMap.js b/devtools/client/memory/components/TreeMap.js index b9a3c39495bd..6dd404d3e9dd 100644 --- a/devtools/client/memory/components/TreeMap.js +++ b/devtools/client/memory/components/TreeMap.js @@ -38,7 +38,7 @@ class TreeMap extends Component { return oldTreeMap !== newTreeMap; } - componentDidUpdate(prevProps) { + componentDidUpdate() { this._stopVisualization(); if (this.props.treeMap && this.props.treeMap.report) { diff --git a/devtools/client/memory/components/tree-map/drag-zoom.js b/devtools/client/memory/components/tree-map/drag-zoom.js index 034017e086d6..f0f94a926a1c 100644 --- a/devtools/client/memory/components/tree-map/drag-zoom.js +++ b/devtools/client/memory/components/tree-map/drag-zoom.js @@ -295,10 +295,9 @@ function setScrollHandlers(container, dragZoom, emitChanged, update) { * Account for the various mouse wheel event types, per pixel or per line * * @param {WheelEvent} event - * @param {Window} window * @return {Number} The scroll size in pixels */ -function getScrollDelta(event, window) { +function getScrollDelta(event) { if (event.deltaMode === LINE_SCROLL_MODE) { // Update by a fixed arbitrary value to normalize scroll types return event.deltaY * SCROLL_LINE_SIZE; diff --git a/devtools/client/memory/models.js b/devtools/client/memory/models.js index 83ed3641b0c9..9429fdae4a3e 100644 --- a/devtools/client/memory/models.js +++ b/devtools/client/memory/models.js @@ -289,7 +289,7 @@ const snapshotModel = (exports.snapshot = PropTypes.shape({ creationTime: PropTypes.number, // The current state the snapshot is in. // @see ./constants.js - state: catchAndIgnore(function (snapshot, propName) { + state: catchAndIgnore(function (snapshot) { const current = snapshot.state; const shouldHavePath = [states.IMPORTING, states.SAVED, states.READ]; const shouldHaveCreationTime = [states.READ]; diff --git a/devtools/client/memory/reducers/allocations.js b/devtools/client/memory/reducers/allocations.js index f0197055601a..895e61676d7f 100644 --- a/devtools/client/memory/reducers/allocations.js +++ b/devtools/client/memory/reducers/allocations.js @@ -9,10 +9,7 @@ const { actions } = require("resource://devtools/client/memory/constants.js"); const handlers = Object.create(null); -handlers[actions.TOGGLE_RECORD_ALLOCATION_STACKS_START] = function ( - state, - action -) { +handlers[actions.TOGGLE_RECORD_ALLOCATION_STACKS_START] = function (state) { assert( !state.togglingInProgress, "Changing recording state must not be reentrant." @@ -24,10 +21,7 @@ handlers[actions.TOGGLE_RECORD_ALLOCATION_STACKS_START] = function ( }; }; -handlers[actions.TOGGLE_RECORD_ALLOCATION_STACKS_END] = function ( - state, - action -) { +handlers[actions.TOGGLE_RECORD_ALLOCATION_STACKS_END] = function (state) { assert( state.togglingInProgress, "Should not complete changing recording state if we weren't changing " + diff --git a/devtools/client/memory/reducers/individuals.js b/devtools/client/memory/reducers/individuals.js index 9b5a2c89a518..57b096f870df 100644 --- a/devtools/client/memory/reducers/individuals.js +++ b/devtools/client/memory/reducers/individuals.js @@ -38,7 +38,7 @@ handlers[actions.FOCUS_INDIVIDUAL] = function (individuals, { node }) { return immutableUpdate(individuals, { focused: node }); }; -handlers[actions.FETCH_INDIVIDUALS_START] = function (individuals, action) { +handlers[actions.FETCH_INDIVIDUALS_START] = function (individuals) { assert(individuals, "Should have individuals"); return Object.freeze({ state: individualsState.FETCHING, diff --git a/devtools/client/memory/test/browser/browser_memory_allocationStackDisplay_01.js b/devtools/client/memory/test/browser/browser_memory_allocationStackDisplay_01.js index b526025b1737..e145732b7ab5 100644 --- a/devtools/client/memory/test/browser/browser_memory_allocationStackDisplay_01.js +++ b/devtools/client/memory/test/browser/browser_memory_allocationStackDisplay_01.js @@ -20,7 +20,7 @@ const { const TEST_URL = "http://example.com/browser/devtools/client/memory/test/browser/doc_steady_allocation.html"; -this.test = makeMemoryTest(TEST_URL, async function ({ tab, panel }) { +this.test = makeMemoryTest(TEST_URL, async function ({ panel }) { const heapWorker = panel.panelWin.gHeapAnalysesClient; const { getState, dispatch } = panel.panelWin.gStore; const front = getState().front; diff --git a/devtools/client/memory/test/browser/browser_memory_allocationStackDisplay_02.js b/devtools/client/memory/test/browser/browser_memory_allocationStackDisplay_02.js index 34492187a2d0..b9c80c394c30 100644 --- a/devtools/client/memory/test/browser/browser_memory_allocationStackDisplay_02.js +++ b/devtools/client/memory/test/browser/browser_memory_allocationStackDisplay_02.js @@ -20,7 +20,7 @@ const { const TEST_URL = "https://example.com/browser/devtools/client/memory/test/browser/doc_steady_allocation.html"; -this.test = makeMemoryTest("about:blank", async function ({ tab, panel }) { +this.test = makeMemoryTest("about:blank", async function ({ panel }) { const heapWorker = panel.panelWin.gHeapAnalysesClient; const { getState, dispatch } = panel.panelWin.gStore; const doc = panel.panelWin.document; diff --git a/devtools/client/memory/test/browser/browser_memory_clear_snapshots.js b/devtools/client/memory/test/browser/browser_memory_clear_snapshots.js index 52eecd283870..333459cc3e55 100644 --- a/devtools/client/memory/test/browser/browser_memory_clear_snapshots.js +++ b/devtools/client/memory/test/browser/browser_memory_clear_snapshots.js @@ -13,7 +13,7 @@ const { const TEST_URL = "http://example.com/browser/devtools/client/memory/test/browser/doc_steady_allocation.html"; -this.test = makeMemoryTest(TEST_URL, async function ({ tab, panel }) { +this.test = makeMemoryTest(TEST_URL, async function ({ panel }) { const { gStore, document } = panel.panelWin; const { getState } = gStore; diff --git a/devtools/client/memory/test/browser/browser_memory_diff_01.js b/devtools/client/memory/test/browser/browser_memory_diff_01.js index 7b6487565f7a..638586f667cb 100644 --- a/devtools/client/memory/test/browser/browser_memory_diff_01.js +++ b/devtools/client/memory/test/browser/browser_memory_diff_01.js @@ -13,7 +13,7 @@ const { const TEST_URL = "http://example.com/browser/devtools/client/memory/test/browser/doc_steady_allocation.html"; -this.test = makeMemoryTest(TEST_URL, async function ({ tab, panel }) { +this.test = makeMemoryTest(TEST_URL, async function ({ panel }) { const store = panel.panelWin.gStore; const { getState } = store; const doc = panel.panelWin.document; diff --git a/devtools/client/memory/test/browser/browser_memory_displays_01.js b/devtools/client/memory/test/browser/browser_memory_displays_01.js index 89296b77f422..7e9561796d5c 100644 --- a/devtools/client/memory/test/browser/browser_memory_displays_01.js +++ b/devtools/client/memory/test/browser/browser_memory_displays_01.js @@ -13,7 +13,7 @@ const { changeView, } = require("resource://devtools/client/memory/actions/view.js"); -this.test = makeMemoryTest(TEST_URL, async function ({ tab, panel }) { +this.test = makeMemoryTest(TEST_URL, async function ({ panel }) { const { gStore, document } = panel.panelWin; const { dispatch } = panel.panelWin.gStore; diff --git a/devtools/client/memory/test/browser/browser_memory_dominator_trees_01.js b/devtools/client/memory/test/browser/browser_memory_dominator_trees_01.js index 1faaf365a110..39b984eadd70 100644 --- a/devtools/client/memory/test/browser/browser_memory_dominator_trees_01.js +++ b/devtools/client/memory/test/browser/browser_memory_dominator_trees_01.js @@ -20,7 +20,7 @@ const { const TEST_URL = "http://example.com/browser/devtools/client/memory/test/browser/doc_big_tree.html"; -this.test = makeMemoryTest(TEST_URL, async function ({ tab, panel }) { +this.test = makeMemoryTest(TEST_URL, async function ({ panel }) { // Taking snapshots and computing dominator trees is slow :-/ requestLongerTimeout(4); diff --git a/devtools/client/memory/test/browser/browser_memory_filter_01.js b/devtools/client/memory/test/browser/browser_memory_filter_01.js index 00dcfdb951c8..7f2e39ac2086 100644 --- a/devtools/client/memory/test/browser/browser_memory_filter_01.js +++ b/devtools/client/memory/test/browser/browser_memory_filter_01.js @@ -17,7 +17,7 @@ const { const TEST_URL = "http://example.com/browser/devtools/client/memory/test/browser/doc_steady_allocation.html"; -this.test = makeMemoryTest(TEST_URL, async function ({ tab, panel }) { +this.test = makeMemoryTest(TEST_URL, async function ({ panel }) { const heapWorker = panel.panelWin.gHeapAnalysesClient; const store = panel.panelWin.gStore; const { dispatch } = store; diff --git a/devtools/client/memory/test/browser/browser_memory_individuals_01.js b/devtools/client/memory/test/browser/browser_memory_individuals_01.js index f54154b9495b..7be5fb2ac446 100644 --- a/devtools/client/memory/test/browser/browser_memory_individuals_01.js +++ b/devtools/client/memory/test/browser/browser_memory_individuals_01.js @@ -17,7 +17,7 @@ const { const TEST_URL = "http://example.com/browser/devtools/client/memory/test/browser/doc_steady_allocation.html"; -this.test = makeMemoryTest(TEST_URL, async function ({ tab, panel }) { +this.test = makeMemoryTest(TEST_URL, async function ({ panel }) { const store = panel.panelWin.gStore; const { dispatch } = store; const doc = panel.panelWin.document; diff --git a/devtools/client/memory/test/browser/browser_memory_keyboard.js b/devtools/client/memory/test/browser/browser_memory_keyboard.js index 0fba33c45675..642eacd43c1c 100644 --- a/devtools/client/memory/test/browser/browser_memory_keyboard.js +++ b/devtools/client/memory/test/browser/browser_memory_keyboard.js @@ -39,7 +39,7 @@ function waitUntilExpanded(store, node) { ); } -this.test = makeMemoryTest(TEST_URL, async function ({ tab, panel }) { +this.test = makeMemoryTest(TEST_URL, async function ({ panel }) { const heapWorker = panel.panelWin.gHeapAnalysesClient; const store = panel.panelWin.gStore; const { getState, dispatch } = store; diff --git a/devtools/client/memory/test/browser/browser_memory_no_allocation_stacks.js b/devtools/client/memory/test/browser/browser_memory_no_allocation_stacks.js index b8b09b35d001..086bc77ef549 100644 --- a/devtools/client/memory/test/browser/browser_memory_no_allocation_stacks.js +++ b/devtools/client/memory/test/browser/browser_memory_no_allocation_stacks.js @@ -17,7 +17,7 @@ const { const TEST_URL = "http://example.com/browser/devtools/client/memory/test/browser/doc_steady_allocation.html"; -this.test = makeMemoryTest(TEST_URL, async function ({ tab, panel }) { +this.test = makeMemoryTest(TEST_URL, async function ({ panel }) { const heapWorker = panel.panelWin.gHeapAnalysesClient; const { getState, dispatch } = panel.panelWin.gStore; const front = getState().front; diff --git a/devtools/client/memory/test/browser/browser_memory_no_auto_expand.js b/devtools/client/memory/test/browser/browser_memory_no_auto_expand.js index 9704d925d1cc..f4e9800f2837 100644 --- a/devtools/client/memory/test/browser/browser_memory_no_auto_expand.js +++ b/devtools/client/memory/test/browser/browser_memory_no_auto_expand.js @@ -17,7 +17,7 @@ const { const TEST_URL = "http://example.com/browser/devtools/client/memory/test/browser/doc_steady_allocation.html"; -this.test = makeMemoryTest(TEST_URL, async function ({ tab, panel }) { +this.test = makeMemoryTest(TEST_URL, async function ({ panel }) { const heapWorker = panel.panelWin.gHeapAnalysesClient; const { getState, dispatch } = panel.panelWin.gStore; const front = getState().front; diff --git a/devtools/client/memory/test/browser/browser_memory_percents_01.js b/devtools/client/memory/test/browser/browser_memory_percents_01.js index c4bb254b071c..8e9202b705f9 100644 --- a/devtools/client/memory/test/browser/browser_memory_percents_01.js +++ b/devtools/client/memory/test/browser/browser_memory_percents_01.js @@ -29,7 +29,7 @@ function checkCells(cells) { } } -this.test = makeMemoryTest(TEST_URL, async function ({ tab, panel }) { +this.test = makeMemoryTest(TEST_URL, async function ({ panel }) { const heapWorker = panel.panelWin.gHeapAnalysesClient; const { getState, dispatch } = panel.panelWin.gStore; const front = getState().front; diff --git a/devtools/client/memory/test/browser/browser_memory_refresh_does_not_leak.js b/devtools/client/memory/test/browser/browser_memory_refresh_does_not_leak.js index e0ee1eee413b..1ecb6275d4d4 100644 --- a/devtools/client/memory/test/browser/browser_memory_refresh_does_not_leak.js +++ b/devtools/client/memory/test/browser/browser_memory_refresh_does_not_leak.js @@ -53,7 +53,7 @@ const DESCRIPTION = { }, }; -this.test = makeMemoryTest(TEST_URL, async function ({ tab, panel }) { +this.test = makeMemoryTest(TEST_URL, async function ({ panel }) { let front = panel.panelWin.gStore.getState().front; const startWindows = await getWindowsInSnapshot(front); diff --git a/devtools/client/memory/test/browser/browser_memory_simple_01.js b/devtools/client/memory/test/browser/browser_memory_simple_01.js index a983e23395d6..acafb46ca19b 100644 --- a/devtools/client/memory/test/browser/browser_memory_simple_01.js +++ b/devtools/client/memory/test/browser/browser_memory_simple_01.js @@ -14,7 +14,7 @@ const { changeView, } = require("resource://devtools/client/memory/actions/view.js"); -this.test = makeMemoryTest(TEST_URL, async function ({ tab, panel }) { +this.test = makeMemoryTest(TEST_URL, async function ({ panel }) { const { gStore, document } = panel.panelWin; const { getState, dispatch } = gStore; diff --git a/devtools/client/memory/test/browser/browser_memory_transferHeapSnapshot_e10s_01.js b/devtools/client/memory/test/browser/browser_memory_transferHeapSnapshot_e10s_01.js index c64783633223..169a96865368 100644 --- a/devtools/client/memory/test/browser/browser_memory_transferHeapSnapshot_e10s_01.js +++ b/devtools/client/memory/test/browser/browser_memory_transferHeapSnapshot_e10s_01.js @@ -11,7 +11,7 @@ const TEST_URL = "data:text/html,"; -this.test = makeMemoryTest(TEST_URL, async function ({ tab, panel }) { +this.test = makeMemoryTest(TEST_URL, async function ({ panel }) { const memoryFront = panel.panelWin.gStore.getState().front; ok(memoryFront, "Should get the MemoryFront"); diff --git a/devtools/client/memory/test/browser/browser_memory_tree_map-01.js b/devtools/client/memory/test/browser/browser_memory_tree_map-01.js index c65b7fc079e3..97e69f6f6d2c 100644 --- a/devtools/client/memory/test/browser/browser_memory_tree_map-01.js +++ b/devtools/client/memory/test/browser/browser_memory_tree_map-01.js @@ -12,7 +12,7 @@ const D3_SCRIPT = 'src="chrome://global/content/third_party/d3/d3.js">'; const TEST_URL = `data:text/html,${D3_SCRIPT}`; -this.test = makeMemoryTest(TEST_URL, async function ({ tab, panel }) { +this.test = makeMemoryTest(TEST_URL, async function ({ panel }) { const document = panel.panelWin.document; const window = panel.panelWin; const div = document.createElement("div"); diff --git a/devtools/client/memory/test/browser/browser_memory_tree_map-02.js b/devtools/client/memory/test/browser/browser_memory_tree_map-02.js index 890ede23b53e..f48bb66c13ca 100644 --- a/devtools/client/memory/test/browser/browser_memory_tree_map-02.js +++ b/devtools/client/memory/test/browser/browser_memory_tree_map-02.js @@ -14,7 +14,7 @@ const PIXEL_SCROLL_MODE = 0; const PIXEL_DELTA = 10; const MAX_RAF_LOOP = 1000; -this.test = makeMemoryTest(TEST_URL, async function ({ tab, panel }) { +this.test = makeMemoryTest(TEST_URL, async function ({ panel }) { const panelWin = panel.panelWin; const panelDoc = panelWin.document; const div = panelDoc.createElement("div"); diff --git a/devtools/client/menus.js b/devtools/client/menus.js index e22a2beac6aa..e75115c22070 100644 --- a/devtools/client/menus.js +++ b/devtools/client/menus.js @@ -179,7 +179,7 @@ exports.menuitems = [ id: "extensionsForDevelopers", l10nKey: "extensionsForDevelopersCmd", appMenuL10nId: "appmenu-developer-tools-extensions", - oncommand(event) { + oncommand() { openDocLink( "https://addons.mozilla.org/firefox/collections/mozilla/webdeveloper/" ); diff --git a/devtools/client/netmonitor/src/actions/http-custom-request.js b/devtools/client/netmonitor/src/actions/http-custom-request.js index e04510741073..7b2da3b40342 100644 --- a/devtools/client/netmonitor/src/actions/http-custom-request.js +++ b/devtools/client/netmonitor/src/actions/http-custom-request.js @@ -34,7 +34,7 @@ const { * @returns {Function} */ function openHTTPCustomRequest(isOpen) { - return ({ dispatch, getState }) => { + return ({ dispatch }) => { dispatch({ type: OPEN_ACTION_BAR, open: isOpen }); dispatch({ diff --git a/devtools/client/netmonitor/src/actions/request-blocking.js b/devtools/client/netmonitor/src/actions/request-blocking.js index 502999c79fcc..ab2a1430a93c 100644 --- a/devtools/client/netmonitor/src/actions/request-blocking.js +++ b/devtools/client/netmonitor/src/actions/request-blocking.js @@ -114,7 +114,7 @@ function closeRequestBlocking() { } function openRequestBlockingAndAddUrl(url) { - return async ({ dispatch, getState }) => { + return async ({ dispatch }) => { const showBlockingPanel = Services.prefs.getBoolPref( "devtools.netmonitor.features.requestBlocking" ); @@ -127,7 +127,7 @@ function openRequestBlockingAndAddUrl(url) { } function openRequestBlockingAndDisableUrls(url) { - return async ({ dispatch, getState }) => { + return async ({ dispatch }) => { const showBlockingPanel = Services.prefs.getBoolPref( "devtools.netmonitor.features.requestBlocking" ); diff --git a/devtools/client/netmonitor/src/actions/search.js b/devtools/client/netmonitor/src/actions/search.js index 97b123d36162..647164cc1135 100644 --- a/devtools/client/netmonitor/src/actions/search.js +++ b/devtools/client/netmonitor/src/actions/search.js @@ -176,7 +176,7 @@ function clearSearchResults() { * @returns {Function} */ function clearSearchResultAndCancel() { - return ({ dispatch, getState }) => { + return ({ dispatch }) => { dispatch(stopOngoingSearch()); dispatch(clearSearchResults()); }; @@ -196,7 +196,7 @@ function updateSearchStatus(status) { * Close the entire search panel. */ function closeSearch() { - return ({ dispatch, getState }) => { + return ({ dispatch }) => { dispatch(stopOngoingSearch()); dispatch({ type: OPEN_ACTION_BAR, open: false }); }; @@ -207,7 +207,7 @@ function closeSearch() { * @returns {Function} */ function openSearch() { - return ({ dispatch, getState }) => { + return ({ dispatch }) => { dispatch({ type: OPEN_ACTION_BAR, open: true }); dispatch({ @@ -222,7 +222,7 @@ function openSearch() { * @returns {Function} */ function toggleCaseSensitiveSearch() { - return ({ dispatch, getState }) => { + return ({ dispatch }) => { dispatch({ type: TOGGLE_SEARCH_CASE_SENSITIVE_SEARCH }); }; } @@ -280,7 +280,7 @@ function stopOngoingSearch() { * clicked search result. */ function navigate(searchResult) { - return ({ dispatch, getState }) => { + return ({ dispatch }) => { // Store target search result in Search reducer. It's used // for search result navigation within the side panels. dispatch(setTargetSearchResult(searchResult)); diff --git a/devtools/client/netmonitor/src/app.js b/devtools/client/netmonitor/src/app.js index d7cf642d4814..a41ae2156c5b 100644 --- a/devtools/client/netmonitor/src/app.js +++ b/devtools/client/netmonitor/src/app.js @@ -41,7 +41,7 @@ function NetMonitorApp(api) { } NetMonitorApp.prototype = { - async bootstrap({ toolbox, document, win }) { + async bootstrap({ toolbox, document }) { // Get the root element for mounting. this.mount = document.querySelector("#mount"); diff --git a/devtools/client/netmonitor/src/components/CustomRequestPanel.js b/devtools/client/netmonitor/src/components/CustomRequestPanel.js index 66f63b7d8da9..14ca7ca21420 100644 --- a/devtools/client/netmonitor/src/components/CustomRequestPanel.js +++ b/devtools/client/netmonitor/src/components/CustomRequestPanel.js @@ -361,7 +361,7 @@ class CustomRequestPanel extends Component { module.exports = connect( state => ({ request: getSelectedRequest(state) }), - (dispatch, props) => ({ + dispatch => ({ removeSelectedCustomRequest: () => dispatch(Actions.removeSelectedCustomRequest()), sendCustomRequest: () => dispatch(Actions.sendCustomRequest()), diff --git a/devtools/client/netmonitor/src/components/StatisticsPanel.js b/devtools/client/netmonitor/src/components/StatisticsPanel.js index e3d67878191a..d7b2fb9ddf6f 100644 --- a/devtools/client/netmonitor/src/components/StatisticsPanel.js +++ b/devtools/client/netmonitor/src/components/StatisticsPanel.js @@ -108,7 +108,7 @@ class StatisticsPanel extends Component { }); } - componentDidUpdate(prevProps) { + componentDidUpdate() { MediaQueryList.addListener(this.onLayoutChange); const { hasLoad, requests } = this.props; diff --git a/devtools/client/netmonitor/src/components/Toolbar.js b/devtools/client/netmonitor/src/components/Toolbar.js index 0da3d826c2d5..d48d96b84619 100644 --- a/devtools/client/netmonitor/src/components/Toolbar.js +++ b/devtools/client/netmonitor/src/components/Toolbar.js @@ -336,7 +336,7 @@ class Toolbar extends Component { /** * Render a blocking button. */ - renderBlockingButton(toggleSearchPanel) { + renderBlockingButton() { const { networkActionBarOpen, toggleRequestBlockingPanel, diff --git a/devtools/client/netmonitor/src/components/new-request/HTTPCustomRequestPanel.js b/devtools/client/netmonitor/src/components/new-request/HTTPCustomRequestPanel.js index 826f0317baf6..1894f1be042d 100644 --- a/devtools/client/netmonitor/src/components/new-request/HTTPCustomRequestPanel.js +++ b/devtools/client/netmonitor/src/components/new-request/HTTPCustomRequestPanel.js @@ -476,12 +476,12 @@ class HTTPCustomRequestPanel extends Component { url: this.state.url, cause: this.props.request?.cause, urlQueryParams: this.state.urlQueryParams.map( - ({ checked, ...params }) => params + ({ ...params }) => params ), requestHeaders: { headers: this.state.headers .filter(({ checked }) => checked) - .map(({ checked, ...headersValues }) => headersValues), + .map(({ ...headersValues }) => headersValues), }, }; @@ -504,7 +504,7 @@ class HTTPCustomRequestPanel extends Component { module.exports = connect( state => ({ request: getClickedRequest(state) }), - (dispatch, props) => ({ + dispatch => ({ sendCustomRequest: request => dispatch(Actions.sendHTTPCustomRequest(request)), }) diff --git a/devtools/client/netmonitor/src/components/request-details/HeadersPanel.js b/devtools/client/netmonitor/src/components/request-details/HeadersPanel.js index 09226b72c52e..5b8822d53b71 100644 --- a/devtools/client/netmonitor/src/components/request-details/HeadersPanel.js +++ b/devtools/client/netmonitor/src/components/request-details/HeadersPanel.js @@ -907,7 +907,7 @@ module.exports = connect( state => ({ shouldExpandPreview: state.ui.shouldExpandHeadersUrlPreview, }), - (dispatch, props) => ({ + dispatch => ({ setHeadersUrlPreviewExpanded: expanded => dispatch(Actions.setHeadersUrlPreviewExpanded(expanded)), openRequestBlockingAndAddUrl: url => diff --git a/devtools/client/netmonitor/src/components/request-details/ResponsePanel.js b/devtools/client/netmonitor/src/components/request-details/ResponsePanel.js index ac4435ea1dfa..d222f7bc5eab 100644 --- a/devtools/client/netmonitor/src/components/request-details/ResponsePanel.js +++ b/devtools/client/netmonitor/src/components/request-details/ResponsePanel.js @@ -228,7 +228,7 @@ class ResponsePanel extends Component { image: "", priority: PriorityLevels.PRIORITY_INFO_HIGH, type: "info", - eventCallback: e => {}, + eventCallback: () => {}, buttons: [ { mdnUrl: getCORSErrorURL(blockedReason), @@ -394,7 +394,7 @@ class ResponsePanel extends Component { image: "", priority: PriorityLevels.PRIORITY_INFO_MEDIUM, type: "info", - eventCallback: e => {}, + eventCallback: () => {}, buttons: [], }); diff --git a/devtools/client/netmonitor/src/components/request-details/TimingsPanel.js b/devtools/client/netmonitor/src/components/request-details/TimingsPanel.js index 6cba22fa71ae..8452e0ecb9bb 100644 --- a/devtools/client/netmonitor/src/components/request-details/TimingsPanel.js +++ b/devtools/client/netmonitor/src/components/request-details/TimingsPanel.js @@ -78,7 +78,7 @@ class TimingsPanel extends Component { { className: "label-separator" }, L10N.getStr("netmonitor.timings.serviceWorkerTiming") ), - Object.entries(serviceWorkerTimings).map(([key, value], index) => { + Object.entries(serviceWorkerTimings).map(([key, value]) => { if (preValue > 0) { offset += preValue / totalTime; } diff --git a/devtools/client/netmonitor/src/connector/firefox-data-provider.js b/devtools/client/netmonitor/src/connector/firefox-data-provider.js index 9cdf6fc1d7eb..ea3cf9cd8388 100644 --- a/devtools/client/netmonitor/src/connector/firefox-data-provider.js +++ b/devtools/client/netmonitor/src/connector/firefox-data-provider.js @@ -460,7 +460,7 @@ class FirefoxDataProvider { * @param {string} protocols webSocket protocols * @param {string} extensions */ - async onWebSocketOpened(httpChannelId, effectiveURI, protocols, extensions) {} + async onWebSocketOpened() {} /** * The "webSocketClosed" message type handler. diff --git a/devtools/client/netmonitor/src/har/har-automation.js b/devtools/client/netmonitor/src/har/har-automation.js index b3c4153d1ef8..f798b2965f1e 100644 --- a/devtools/client/netmonitor/src/har/har-automation.js +++ b/devtools/client/netmonitor/src/har/har-automation.js @@ -21,7 +21,7 @@ const prefDomain = "devtools.netmonitor.har."; // Helper tracer. Should be generic sharable by other modules (bug 1171927) const trace = { - log(...args) {}, + log() {}, }; /** @@ -88,7 +88,7 @@ HarAutomation.prototype = { ); }, - pageLoadBegin(response) { + pageLoadBegin() { this.resetCollector(); }, @@ -120,7 +120,7 @@ HarAutomation.prototype = { trace.log("HarAutomation.pageLoadDone; ", response); if (this.collector) { - this.collector.waitForHarLoad().then(collector => { + this.collector.waitForHarLoad().then(() => { return this.autoExport(); }); } diff --git a/devtools/client/netmonitor/src/har/har-builder.js b/devtools/client/netmonitor/src/har/har-builder.js index 8f1a9095c7f6..ee281e20f6c1 100644 --- a/devtools/client/netmonitor/src/har/har-builder.js +++ b/devtools/client/netmonitor/src/har/har-builder.js @@ -208,7 +208,7 @@ HarBuilder.prototype = { return entry; }, - buildPageTimings(page, networkEvent) { + buildPageTimings() { // Event timing info isn't available const timings = { onContentLoad: -1, diff --git a/devtools/client/netmonitor/src/har/har-collector.js b/devtools/client/netmonitor/src/har/har-collector.js index c5a4ae959db6..c02669be6e5e 100644 --- a/devtools/client/netmonitor/src/har/har-collector.js +++ b/devtools/client/netmonitor/src/har/har-collector.js @@ -10,7 +10,7 @@ const { // Helper tracer. Should be generic sharable by other modules (bug 1171927) const trace = { - log(...args) {}, + log() {}, }; /** diff --git a/devtools/client/netmonitor/src/har/har-exporter.js b/devtools/client/netmonitor/src/har/har-exporter.js index fb401c27376d..9204e9899403 100644 --- a/devtools/client/netmonitor/src/har/har-exporter.js +++ b/devtools/client/netmonitor/src/har/har-exporter.js @@ -18,7 +18,7 @@ var uid = 1; // Helper tracer. Should be generic sharable by other modules (bug 1171927) const trace = { - log(...args) {}, + log() {}, }; /** diff --git a/devtools/client/netmonitor/src/har/test/browser_net_har_copy_all_as_har.js b/devtools/client/netmonitor/src/har/test/browser_net_har_copy_all_as_har.js index bcbb4bef2aeb..2faaf01b73c8 100644 --- a/devtools/client/netmonitor/src/har/test/browser_net_har_copy_all_as_har.js +++ b/devtools/client/netmonitor/src/har/test/browser_net_har_copy_all_as_har.js @@ -111,7 +111,7 @@ async function testManyReloads({ tab, monitor, toolbox }) { assertNavigationRequestEntry(entry); } -async function testClearedRequests({ tab, monitor, toolbox }) { +async function testClearedRequests({ tab, monitor }) { info("Navigate to an empty page"); const topDocumentURL = "https://example.org/document-builder.sjs?html=empty-document"; @@ -196,7 +196,6 @@ function assertNavigationRequestEntry(entry) { * Reload the page and copy all as HAR. */ async function reloadAndCopyAllAsHar({ - tab, monitor, toolbox, reloadTwice = false, diff --git a/devtools/client/netmonitor/src/har/test/html_har_post-data-test-page.html b/devtools/client/netmonitor/src/har/test/html_har_post-data-test-page.html index 5e42c6139d37..9be2e3c16aae 100644 --- a/devtools/client/netmonitor/src/har/test/html_har_post-data-test-page.html +++ b/devtools/client/netmonitor/src/har/test/html_har_post-data-test-page.html @@ -44,7 +44,7 @@ post(url, data); } - function executeTest3(size) { + function executeTest3() { const url = "html_har_post-data-test-page.html"; get(url); } diff --git a/devtools/client/netmonitor/src/middleware/batching.js b/devtools/client/netmonitor/src/middleware/batching.js index 9d8c57084c32..c546cc2e2240 100644 --- a/devtools/client/netmonitor/src/middleware/batching.js +++ b/devtools/client/netmonitor/src/middleware/batching.js @@ -20,7 +20,7 @@ const REQUESTS_REFRESH_RATE = 50; // ms * - BATCH_ENABLE can be used to enable and disable the batching. * - BATCH_RESET discards the actions that are currently in the queue. */ -function batchingMiddleware(store) { +function batchingMiddleware() { return next => { let queuedActions = []; let enabled = true; diff --git a/devtools/client/netmonitor/src/middleware/prefs.js b/devtools/client/netmonitor/src/middleware/prefs.js index 6034a95dbf58..2ccbb4db3c0c 100644 --- a/devtools/client/netmonitor/src/middleware/prefs.js +++ b/devtools/client/netmonitor/src/middleware/prefs.js @@ -30,8 +30,8 @@ function prefsMiddleware(store) { const filters = Object.entries( store.getState().filters.requestFilterTypes ) - .filter(([type, check]) => check) - .map(([type, check]) => type); + .filter(([, check]) => check) + .map(([type]) => type); Services.prefs.setCharPref( "devtools.netmonitor.filters", JSON.stringify(filters) diff --git a/devtools/client/netmonitor/src/middleware/throttling.js b/devtools/client/netmonitor/src/middleware/throttling.js index 30f5a9b5f4de..ac72b556bbf9 100644 --- a/devtools/client/netmonitor/src/middleware/throttling.js +++ b/devtools/client/netmonitor/src/middleware/throttling.js @@ -14,7 +14,7 @@ const { * according to user actions. */ function throttlingMiddleware(connector) { - return store => next => action => { + return () => next => action => { const res = next(action); if (action.type === CHANGE_NETWORK_THROTTLING) { connector.updateNetworkThrottling(action.enabled, action.profile); diff --git a/devtools/client/netmonitor/src/reducers/messages.js b/devtools/client/netmonitor/src/reducers/messages.js index 27d7da28c7f3..cb21a08b91cf 100644 --- a/devtools/client/netmonitor/src/reducers/messages.js +++ b/devtools/client/netmonitor/src/reducers/messages.js @@ -208,7 +208,7 @@ function toggleMessageFilterType(state, action) { /** * Toggle control frames for the WebSocket connection. */ -function toggleControlFrames(state, action) { +function toggleControlFrames(state) { return { ...state, showControlFrames: !state.showControlFrames, diff --git a/devtools/client/netmonitor/src/reducers/request-blocking.js b/devtools/client/netmonitor/src/reducers/request-blocking.js index ffd0d8c97ab8..18dbe574f843 100644 --- a/devtools/client/netmonitor/src/reducers/request-blocking.js +++ b/devtools/client/netmonitor/src/reducers/request-blocking.js @@ -99,14 +99,14 @@ function removeBlockedUrl(state, action) { }; } -function removeAllBlockedUrls(state, action) { +function removeAllBlockedUrls(state) { return { ...state, blockedUrls: [], }; } -function enableAllBlockedUrls(state, action) { +function enableAllBlockedUrls(state) { const blockedUrls = state.blockedUrls.map(item => ({ ...item, enabled: true, @@ -117,7 +117,7 @@ function enableAllBlockedUrls(state, action) { }; } -function disableAllBlockedUrls(state, action) { +function disableAllBlockedUrls(state) { const blockedUrls = state.blockedUrls.map(item => ({ ...item, enabled: false, diff --git a/devtools/client/netmonitor/src/reducers/timing-markers.js b/devtools/client/netmonitor/src/reducers/timing-markers.js index 4a41f9b4950b..1b6367483312 100644 --- a/devtools/client/netmonitor/src/reducers/timing-markers.js +++ b/devtools/client/netmonitor/src/reducers/timing-markers.js @@ -51,7 +51,7 @@ function addTimingMarker(state, action) { return state; } -function clearTimingMarkers(state) { +function clearTimingMarkers() { return new TimingMarkers(); } diff --git a/devtools/client/netmonitor/src/utils/context-menu-utils.js b/devtools/client/netmonitor/src/utils/context-menu-utils.js index 3b44ff20cc5b..2643913d119b 100644 --- a/devtools/client/netmonitor/src/utils/context-menu-utils.js +++ b/devtools/client/netmonitor/src/utils/context-menu-utils.js @@ -8,7 +8,7 @@ * The default format for the content copied to the * clipboard when the `Copy Value` option is selected. */ -function baseCopyFormatter({ name, value, object, hasChildren }) { +function baseCopyFormatter({ name, value, hasChildren }) { if (hasChildren) { return baseCopyAllFormatter({ [name]: value }); } diff --git a/devtools/client/netmonitor/test/browser_net_cached-status.js b/devtools/client/netmonitor/test/browser_net_cached-status.js index 77346e684215..b41362b398ed 100644 --- a/devtools/client/netmonitor/test/browser_net_cached-status.js +++ b/devtools/client/netmonitor/test/browser_net_cached-status.js @@ -94,7 +94,7 @@ add_task(async function () { // that the NS_BINDING_ABORTED status is never displayed for cached requests. const observer = { QueryInterface: ChromeUtils.generateQI(["nsIObserver"]), - observe(subject, topic, data) { + observe(subject) { subject = subject.QueryInterface(Ci.nsIHttpChannel); if (subject.URI.spec == STATUS_CODES_SJS + "?sts=ok&cached") { subject.cancel(Cr.NS_BINDING_ABORTED); diff --git a/devtools/client/netmonitor/test/browser_net_curl-utils.js b/devtools/client/netmonitor/test/browser_net_curl-utils.js index 32b7aca316d0..cdf64ad5f951 100644 --- a/devtools/client/netmonitor/test/browser_net_curl-utils.js +++ b/devtools/client/netmonitor/test/browser_net_curl-utils.js @@ -139,7 +139,7 @@ function testWritePostDataTextParams(data) { ); } -function testWriteEmptyPostDataTextParams(data) { +function testWriteEmptyPostDataTextParams() { const params = CurlUtils.writePostDataTextParams(null); is(params, "", "Should return a empty string when no parameters provided"); } diff --git a/devtools/client/netmonitor/test/browser_net_header-docs.js b/devtools/client/netmonitor/test/browser_net_header-docs.js index 91d2794d5f32..e4cdcb5c613b 100644 --- a/devtools/client/netmonitor/test/browser_net_header-docs.js +++ b/devtools/client/netmonitor/test/browser_net_header-docs.js @@ -48,9 +48,9 @@ add_task(async function () { * Tests that a "Learn More" button is only shown if * and only if a header is documented in MDN. */ - function testShowLearnMore(data) { + function testShowLearnMore() { const selector = ".properties-view .treeRow.stringRow"; - document.querySelectorAll(selector).forEach((rowEl, index) => { + document.querySelectorAll(selector).forEach(rowEl => { const headerName = rowEl.querySelectorAll(".treeLabelCell .treeLabel")[0] .textContent; const headerDocURL = getHeadersURL(headerName); diff --git a/devtools/client/netmonitor/test/browser_net_prefs-reload.js b/devtools/client/netmonitor/test/browser_net_prefs-reload.js index 523c4dc805b0..42c90a2f25fe 100644 --- a/devtools/client/netmonitor/test/browser_net_prefs-reload.js +++ b/devtools/client/netmonitor/test/browser_net_prefs-reload.js @@ -36,8 +36,8 @@ add_task(async function () { // to verify that the pref was applied properly. validateValue: () => Object.entries(getState().filters.requestFilterTypes) - .filter(([type, check]) => check) - .map(([type, check]) => type), + .filter(([, check]) => check) + .map(([type]) => type), // Predicate used to modify the frontend when setting the new pref value, // before trying to validate the changes. modifyFrontend: value => diff --git a/devtools/client/netmonitor/test/browser_net_simple-request-data.js b/devtools/client/netmonitor/test/browser_net_simple-request-data.js index 7b112ef7d851..450313a4c9ad 100644 --- a/devtools/client/netmonitor/test/browser_net_simple-request-data.js +++ b/devtools/client/netmonitor/test/browser_net_simple-request-data.js @@ -17,72 +17,67 @@ function test() { L10N, } = require("resource://devtools/client/netmonitor/src/utils/l10n.js"); - initNetMonitor(SIMPLE_SJS, { requestCount: 1 }).then( - async ({ tab, monitor }) => { - info("Starting test... "); + initNetMonitor(SIMPLE_SJS, { requestCount: 1 }).then(async ({ monitor }) => { + info("Starting test... "); - const { document, store, windowRequire, connector } = monitor.panelWin; - const { EVENTS, TEST_EVENTS } = windowRequire( - "devtools/client/netmonitor/src/constants" + const { document, store, windowRequire, connector } = monitor.panelWin; + const { EVENTS, TEST_EVENTS } = windowRequire( + "devtools/client/netmonitor/src/constants" + ); + const { getDisplayedRequests, getSelectedRequest, getSortedRequests } = + windowRequire("devtools/client/netmonitor/src/selectors/index"); + + const promiseList = []; + promiseList.push(waitForNetworkEvents(monitor, 1)); + + function expectEvent(evt, cb) { + promiseList.push( + new Promise((resolve, reject) => { + monitor.panelWin.api.once(evt, _ => { + cb().then(resolve, reject); + }); + }) ); - const { getDisplayedRequests, getSelectedRequest, getSortedRequests } = - windowRequire("devtools/client/netmonitor/src/selectors/index"); + } - const promiseList = []; - promiseList.push(waitForNetworkEvents(monitor, 1)); + expectEvent(TEST_EVENTS.NETWORK_EVENT, async () => { + is( + getSelectedRequest(store.getState()), + undefined, + "There shouldn't be any selected item in the requests menu." + ); + is( + store.getState().requests.requests.length, + 1, + "The requests menu should not be empty after the first request." + ); + is( + !!document.querySelector(".network-details-bar"), + false, + "The network details panel should still be hidden after first request." + ); - function expectEvent(evt, cb) { - promiseList.push( - new Promise((resolve, reject) => { - monitor.panelWin.api.once(evt, _ => { - cb().then(resolve, reject); - }); - }) - ); - } + const requestItem = getSortedRequests(store.getState())[0]; - expectEvent(TEST_EVENTS.NETWORK_EVENT, async () => { - is( - getSelectedRequest(store.getState()), - undefined, - "There shouldn't be any selected item in the requests menu." - ); - is( - store.getState().requests.requests.length, - 1, - "The requests menu should not be empty after the first request." - ); - is( - !!document.querySelector(".network-details-bar"), - false, - "The network details panel should still be hidden after first request." - ); + is( + typeof requestItem.id, + "string", + "The attached request id is incorrect." + ); + isnot(requestItem.id, "", "The attached request id should not be empty."); - const requestItem = getSortedRequests(store.getState())[0]; + is( + typeof requestItem.startedMs, + "number", + "The attached startedMs is incorrect." + ); + isnot( + requestItem.startedMs, + 0, + "The attached startedMs should not be zero." + ); - is( - typeof requestItem.id, - "string", - "The attached request id is incorrect." - ); - isnot( - requestItem.id, - "", - "The attached request id should not be empty." - ); - - is( - typeof requestItem.startedMs, - "number", - "The attached startedMs is incorrect." - ); - isnot( - requestItem.startedMs, - 0, - "The attached startedMs should not be zero." - ); - - /* + /* * Bug 1666495: this is not possible to assert not yet set attributes * because of throttling, which only updates the frontend after a few attributes * are already retrieved via onResourceUpdates events. @@ -162,328 +157,319 @@ function test() { ); */ - verifyRequestItemTarget( - document, - getDisplayedRequests(store.getState()), - requestItem, - "GET", - SIMPLE_SJS - ); - }); + verifyRequestItemTarget( + document, + getDisplayedRequests(store.getState()), + requestItem, + "GET", + SIMPLE_SJS + ); + }); - expectEvent(TEST_EVENTS.RECEIVED_REQUEST_HEADERS, async () => { - await waitForRequestData(store, ["requestHeaders"]); - - const requestItem = getSortedRequests(store.getState())[0]; - - ok( - requestItem.requestHeaders, - "There should be a requestHeaders data available." - ); - is( - requestItem.requestHeaders.headers.length, - 10, - "The requestHeaders data has an incorrect |headers| property." - ); - isnot( - requestItem.requestHeaders.headersSize, - 0, - "The requestHeaders data has an incorrect |headersSize| property." - ); - // Can't test for the exact request headers size because the value may - // vary across platforms ("User-Agent" header differs). - - verifyRequestItemTarget( - document, - getDisplayedRequests(store.getState()), - requestItem, - "GET", - SIMPLE_SJS - ); - }); - - expectEvent(TEST_EVENTS.RECEIVED_REQUEST_COOKIES, async () => { - await waitForRequestData(store, ["requestCookies"]); - - const requestItem = getSortedRequests(store.getState())[0]; - - ok( - requestItem.requestCookies, - "There should be a requestCookies data available." - ); - is( - requestItem.requestCookies.length, - 2, - "The requestCookies data has an incorrect |cookies| property." - ); - - verifyRequestItemTarget( - document, - getDisplayedRequests(store.getState()), - requestItem, - "GET", - SIMPLE_SJS - ); - }); - - monitor.panelWin.api.once(TEST_EVENTS.RECEIVED_REQUEST_POST_DATA, () => { - ok(false, "Trap listener: this request doesn't have any post data."); - }); - - expectEvent(TEST_EVENTS.RECEIVED_RESPONSE_HEADERS, async () => { - await waitForRequestData(store, ["responseHeaders"]); - - const requestItem = getSortedRequests(store.getState())[0]; - - ok( - requestItem.responseHeaders, - "There should be a responseHeaders data available." - ); - is( - requestItem.responseHeaders.headers.length, - 13, - "The responseHeaders data has an incorrect |headers| property." - ); - is( - requestItem.responseHeaders.headersSize, - 335, - "The responseHeaders data has an incorrect |headersSize| property." - ); - - verifyRequestItemTarget( - document, - getDisplayedRequests(store.getState()), - requestItem, - "GET", - SIMPLE_SJS - ); - }); - - expectEvent(TEST_EVENTS.RECEIVED_RESPONSE_COOKIES, async () => { - await waitForRequestData(store, ["responseCookies"]); - - const requestItem = getSortedRequests(store.getState())[0]; - - ok( - requestItem.responseCookies, - "There should be a responseCookies data available." - ); - is( - requestItem.responseCookies.length, - 2, - "The responseCookies data has an incorrect |cookies| property." - ); - - verifyRequestItemTarget( - document, - getDisplayedRequests(store.getState()), - requestItem, - "GET", - SIMPLE_SJS - ); - }); - - expectEvent(TEST_EVENTS.STARTED_RECEIVING_RESPONSE, async () => { - await waitForRequestData(store, [ - "httpVersion", - "status", - "statusText", - "headersSize", - ]); - - const requestItem = getSortedRequests(store.getState())[0]; - - is( - requestItem.httpVersion, - "HTTP/1.1", - "The httpVersion data has an incorrect value." - ); - is( - requestItem.status, - "200", - "The status data has an incorrect value." - ); - is( - requestItem.statusText, - "Och Aye", - "The statusText data has an incorrect value." - ); - is( - requestItem.headersSize, - 335, - "The headersSize data has an incorrect value." - ); - - const requestListItem = document.querySelector(".request-list-item"); - requestListItem.scrollIntoView(); - const requestsListStatus = - requestListItem.querySelector(".status-code"); - EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus); - await waitUntil(() => requestsListStatus.title); - await waitForDOMIfNeeded( - requestListItem, - ".requests-list-timings-total" - ); - - verifyRequestItemTarget( - document, - getDisplayedRequests(store.getState()), - requestItem, - "GET", - SIMPLE_SJS, - { - status: "200", - statusText: "Och Aye", - } - ); - }); - - expectEvent(EVENTS.PAYLOAD_READY, async () => { - await waitForRequestData(store, [ - "transferredSize", - "contentSize", - "mimeType", - ]); - - const requestItem = getSortedRequests(store.getState())[0]; - - is( - requestItem.transferredSize, - 347, - "The transferredSize data has an incorrect value." - ); - is( - requestItem.contentSize, - 12, - "The contentSize data has an incorrect value." - ); - is( - requestItem.mimeType, - "text/plain; charset=utf-8", - "The mimeType data has an incorrect value." - ); - - verifyRequestItemTarget( - document, - getDisplayedRequests(store.getState()), - requestItem, - "GET", - SIMPLE_SJS, - { - type: "plain", - fullMimeType: "text/plain; charset=utf-8", - transferred: L10N.getFormatStrWithNumbers("networkMenu.sizeB", 347), - size: L10N.getFormatStrWithNumbers("networkMenu.sizeB", 12), - } - ); - }); - - expectEvent(EVENTS.UPDATING_EVENT_TIMINGS, async () => { - await waitForRequestData(store, ["eventTimings"]); - - const requestItem = getSortedRequests(store.getState())[0]; - - is( - typeof requestItem.totalTime, - "number", - "The attached totalTime is incorrect." - ); - Assert.greaterOrEqual( - requestItem.totalTime, - 0, - "The attached totalTime should be positive." - ); - - verifyRequestItemTarget( - document, - getDisplayedRequests(store.getState()), - requestItem, - "GET", - SIMPLE_SJS, - { - time: true, - } - ); - }); - - expectEvent(EVENTS.RECEIVED_EVENT_TIMINGS, async () => { - await waitForRequestData(store, ["eventTimings"]); - - const requestItem = getSortedRequests(store.getState())[0]; - - ok( - requestItem.eventTimings, - "There should be a eventTimings data available." - ); - is( - typeof requestItem.eventTimings.timings.blocked, - "number", - "The eventTimings data has an incorrect |timings.blocked| property." - ); - is( - typeof requestItem.eventTimings.timings.dns, - "number", - "The eventTimings data has an incorrect |timings.dns| property." - ); - is( - typeof requestItem.eventTimings.timings.ssl, - "number", - "The eventTimings data has an incorrect |timings.ssl| property." - ); - is( - typeof requestItem.eventTimings.timings.connect, - "number", - "The eventTimings data has an incorrect |timings.connect| property." - ); - is( - typeof requestItem.eventTimings.timings.send, - "number", - "The eventTimings data has an incorrect |timings.send| property." - ); - is( - typeof requestItem.eventTimings.timings.wait, - "number", - "The eventTimings data has an incorrect |timings.wait| property." - ); - is( - typeof requestItem.eventTimings.timings.receive, - "number", - "The eventTimings data has an incorrect |timings.receive| property." - ); - is( - typeof requestItem.eventTimings.totalTime, - "number", - "The eventTimings data has an incorrect |totalTime| property." - ); - - verifyRequestItemTarget( - document, - getDisplayedRequests(store.getState()), - requestItem, - "GET", - SIMPLE_SJS, - { - time: true, - } - ); - }); - - const wait = waitForNetworkEvents(monitor, 1); - await reloadBrowser(); - await wait; + expectEvent(TEST_EVENTS.RECEIVED_REQUEST_HEADERS, async () => { + await waitForRequestData(store, ["requestHeaders"]); const requestItem = getSortedRequests(store.getState())[0]; - if (!requestItem.requestHeaders) { - connector.requestData(requestItem.id, "requestHeaders"); - } - if (!requestItem.responseHeaders) { - connector.requestData(requestItem.id, "responseHeaders"); - } + ok( + requestItem.requestHeaders, + "There should be a requestHeaders data available." + ); + is( + requestItem.requestHeaders.headers.length, + 10, + "The requestHeaders data has an incorrect |headers| property." + ); + isnot( + requestItem.requestHeaders.headersSize, + 0, + "The requestHeaders data has an incorrect |headersSize| property." + ); + // Can't test for the exact request headers size because the value may + // vary across platforms ("User-Agent" header differs). - await Promise.all(promiseList); - await teardown(monitor); - finish(); + verifyRequestItemTarget( + document, + getDisplayedRequests(store.getState()), + requestItem, + "GET", + SIMPLE_SJS + ); + }); + + expectEvent(TEST_EVENTS.RECEIVED_REQUEST_COOKIES, async () => { + await waitForRequestData(store, ["requestCookies"]); + + const requestItem = getSortedRequests(store.getState())[0]; + + ok( + requestItem.requestCookies, + "There should be a requestCookies data available." + ); + is( + requestItem.requestCookies.length, + 2, + "The requestCookies data has an incorrect |cookies| property." + ); + + verifyRequestItemTarget( + document, + getDisplayedRequests(store.getState()), + requestItem, + "GET", + SIMPLE_SJS + ); + }); + + monitor.panelWin.api.once(TEST_EVENTS.RECEIVED_REQUEST_POST_DATA, () => { + ok(false, "Trap listener: this request doesn't have any post data."); + }); + + expectEvent(TEST_EVENTS.RECEIVED_RESPONSE_HEADERS, async () => { + await waitForRequestData(store, ["responseHeaders"]); + + const requestItem = getSortedRequests(store.getState())[0]; + + ok( + requestItem.responseHeaders, + "There should be a responseHeaders data available." + ); + is( + requestItem.responseHeaders.headers.length, + 13, + "The responseHeaders data has an incorrect |headers| property." + ); + is( + requestItem.responseHeaders.headersSize, + 335, + "The responseHeaders data has an incorrect |headersSize| property." + ); + + verifyRequestItemTarget( + document, + getDisplayedRequests(store.getState()), + requestItem, + "GET", + SIMPLE_SJS + ); + }); + + expectEvent(TEST_EVENTS.RECEIVED_RESPONSE_COOKIES, async () => { + await waitForRequestData(store, ["responseCookies"]); + + const requestItem = getSortedRequests(store.getState())[0]; + + ok( + requestItem.responseCookies, + "There should be a responseCookies data available." + ); + is( + requestItem.responseCookies.length, + 2, + "The responseCookies data has an incorrect |cookies| property." + ); + + verifyRequestItemTarget( + document, + getDisplayedRequests(store.getState()), + requestItem, + "GET", + SIMPLE_SJS + ); + }); + + expectEvent(TEST_EVENTS.STARTED_RECEIVING_RESPONSE, async () => { + await waitForRequestData(store, [ + "httpVersion", + "status", + "statusText", + "headersSize", + ]); + + const requestItem = getSortedRequests(store.getState())[0]; + + is( + requestItem.httpVersion, + "HTTP/1.1", + "The httpVersion data has an incorrect value." + ); + is(requestItem.status, "200", "The status data has an incorrect value."); + is( + requestItem.statusText, + "Och Aye", + "The statusText data has an incorrect value." + ); + is( + requestItem.headersSize, + 335, + "The headersSize data has an incorrect value." + ); + + const requestListItem = document.querySelector(".request-list-item"); + requestListItem.scrollIntoView(); + const requestsListStatus = requestListItem.querySelector(".status-code"); + EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus); + await waitUntil(() => requestsListStatus.title); + await waitForDOMIfNeeded(requestListItem, ".requests-list-timings-total"); + + verifyRequestItemTarget( + document, + getDisplayedRequests(store.getState()), + requestItem, + "GET", + SIMPLE_SJS, + { + status: "200", + statusText: "Och Aye", + } + ); + }); + + expectEvent(EVENTS.PAYLOAD_READY, async () => { + await waitForRequestData(store, [ + "transferredSize", + "contentSize", + "mimeType", + ]); + + const requestItem = getSortedRequests(store.getState())[0]; + + is( + requestItem.transferredSize, + 347, + "The transferredSize data has an incorrect value." + ); + is( + requestItem.contentSize, + 12, + "The contentSize data has an incorrect value." + ); + is( + requestItem.mimeType, + "text/plain; charset=utf-8", + "The mimeType data has an incorrect value." + ); + + verifyRequestItemTarget( + document, + getDisplayedRequests(store.getState()), + requestItem, + "GET", + SIMPLE_SJS, + { + type: "plain", + fullMimeType: "text/plain; charset=utf-8", + transferred: L10N.getFormatStrWithNumbers("networkMenu.sizeB", 347), + size: L10N.getFormatStrWithNumbers("networkMenu.sizeB", 12), + } + ); + }); + + expectEvent(EVENTS.UPDATING_EVENT_TIMINGS, async () => { + await waitForRequestData(store, ["eventTimings"]); + + const requestItem = getSortedRequests(store.getState())[0]; + + is( + typeof requestItem.totalTime, + "number", + "The attached totalTime is incorrect." + ); + Assert.greaterOrEqual( + requestItem.totalTime, + 0, + "The attached totalTime should be positive." + ); + + verifyRequestItemTarget( + document, + getDisplayedRequests(store.getState()), + requestItem, + "GET", + SIMPLE_SJS, + { + time: true, + } + ); + }); + + expectEvent(EVENTS.RECEIVED_EVENT_TIMINGS, async () => { + await waitForRequestData(store, ["eventTimings"]); + + const requestItem = getSortedRequests(store.getState())[0]; + + ok( + requestItem.eventTimings, + "There should be a eventTimings data available." + ); + is( + typeof requestItem.eventTimings.timings.blocked, + "number", + "The eventTimings data has an incorrect |timings.blocked| property." + ); + is( + typeof requestItem.eventTimings.timings.dns, + "number", + "The eventTimings data has an incorrect |timings.dns| property." + ); + is( + typeof requestItem.eventTimings.timings.ssl, + "number", + "The eventTimings data has an incorrect |timings.ssl| property." + ); + is( + typeof requestItem.eventTimings.timings.connect, + "number", + "The eventTimings data has an incorrect |timings.connect| property." + ); + is( + typeof requestItem.eventTimings.timings.send, + "number", + "The eventTimings data has an incorrect |timings.send| property." + ); + is( + typeof requestItem.eventTimings.timings.wait, + "number", + "The eventTimings data has an incorrect |timings.wait| property." + ); + is( + typeof requestItem.eventTimings.timings.receive, + "number", + "The eventTimings data has an incorrect |timings.receive| property." + ); + is( + typeof requestItem.eventTimings.totalTime, + "number", + "The eventTimings data has an incorrect |totalTime| property." + ); + + verifyRequestItemTarget( + document, + getDisplayedRequests(store.getState()), + requestItem, + "GET", + SIMPLE_SJS, + { + time: true, + } + ); + }); + + const wait = waitForNetworkEvents(monitor, 1); + await reloadBrowser(); + await wait; + + const requestItem = getSortedRequests(store.getState())[0]; + + if (!requestItem.requestHeaders) { + connector.requestData(requestItem.id, "requestHeaders"); } - ); + if (!requestItem.responseHeaders) { + connector.requestData(requestItem.id, "responseHeaders"); + } + + await Promise.all(promiseList); + await teardown(monitor); + finish(); + }); } diff --git a/devtools/client/netmonitor/test/head.js b/devtools/client/netmonitor/test/head.js index aa92b55f7444..b171b51715a2 100644 --- a/devtools/client/netmonitor/test/head.js +++ b/devtools/client/netmonitor/test/head.js @@ -878,7 +878,7 @@ function testFilterButtonsCustom(monitor, isChecked) { * */ function promiseXHR(data) { - return new Promise((resolve, reject) => { + return new Promise(resolve => { const xhr = new content.XMLHttpRequest(); const method = data.method || "GET"; @@ -891,7 +891,7 @@ function promiseXHR(data) { xhr.addEventListener( "loadend", - function (event) { + function () { resolve({ status: xhr.status, response: xhr.response }); }, { once: true } @@ -925,7 +925,7 @@ function promiseXHR(data) { * */ function promiseWS(data) { - return new Promise((resolve, reject) => { + return new Promise(resolve => { let url = data.url; if (data.nocache) { @@ -936,7 +936,7 @@ function promiseWS(data) { const socket = new content.WebSocket(url); /* Since we only use HTTP server to mock websocket, so just ignore the error */ - socket.onclose = e => { + socket.onclose = () => { socket.close(); resolve({ status: 101, @@ -944,7 +944,7 @@ function promiseWS(data) { }); }; - socket.onerror = e => { + socket.onerror = () => { socket.close(); resolve({ status: 101, @@ -1395,7 +1395,7 @@ function clickElement(element, monitor) { * Target browser to observe the favicon load. */ function registerFaviconNotifier(browser) { - const listener = async (name, data) => { + const listener = async name => { if (name == "SetIcon" || name == "SetFailedIcon") { await SpecialPowers.spawn(browser, [], async () => { content.document diff --git a/devtools/client/netmonitor/test/html_custom-get-page.html b/devtools/client/netmonitor/test/html_custom-get-page.html index b44bf754a469..db4e45e81c9b 100644 --- a/devtools/client/netmonitor/test/html_custom-get-page.html +++ b/devtools/client/netmonitor/test/html_custom-get-page.html @@ -45,7 +45,7 @@ // For testing the offline mode in the netmonitor let isOfflineEventFired = false; - window.addEventListener("offline", (event) => { + window.addEventListener("offline", () => { isOfflineEventFired = true }, { once: true }); diff --git a/devtools/client/netmonitor/test/html_pause-test-page.html b/devtools/client/netmonitor/test/html_pause-test-page.html index a4ed668ce8d1..a093ae9c0641 100644 --- a/devtools/client/netmonitor/test/html_pause-test-page.html +++ b/devtools/client/netmonitor/test/html_pause-test-page.html @@ -19,7 +19,7 @@ "use strict"; function performRequests(url) { - return new Promise((resolve, reject) => { + return new Promise((resolve) => { const xhr = new XMLHttpRequest(); xhr.open("GET", url, true); xhr.onreadystatechange = function() { diff --git a/devtools/client/netmonitor/test/html_post-json-test-page.html b/devtools/client/netmonitor/test/html_post-json-test-page.html index 8c18e91dbb0c..b6c734c19219 100644 --- a/devtools/client/netmonitor/test/html_post-json-test-page.html +++ b/devtools/client/netmonitor/test/html_post-json-test-page.html @@ -18,7 +18,7 @@ /* exported performRequests performLargePostDataRequest */ "use strict"; - function post(address, message, callback) { + function post(address, message) { return new Promise(resolve => { const xhr = new XMLHttpRequest(); xhr.open("POST", address, true); diff --git a/devtools/client/netmonitor/test/html_sse-test-page.html b/devtools/client/netmonitor/test/html_sse-test-page.html index bb726d4c1fd0..7f3fd33bfb27 100644 --- a/devtools/client/netmonitor/test/html_sse-test-page.html +++ b/devtools/client/netmonitor/test/html_sse-test-page.html @@ -20,7 +20,7 @@ function openConnection() { return new Promise(resolve => { es = new EventSource("sjs_sse-test-server.sjs"); - es.onmessage = function (e) { + es.onmessage = function () { es.close(); resolve(); }; diff --git a/devtools/client/netmonitor/test/html_ws-sse-test-page.html b/devtools/client/netmonitor/test/html_ws-sse-test-page.html index 8936efa81e20..637848eea39b 100644 --- a/devtools/client/netmonitor/test/html_ws-sse-test-page.html +++ b/devtools/client/netmonitor/test/html_ws-sse-test-page.html @@ -22,7 +22,7 @@ "ws://mochi.test:8888/browser/devtools/client/netmonitor/test/file_ws_backend" ); - ws.onopen = e => { + ws.onopen = () => { for (let i = 0; i < numFramesToSend; i++) { ws.send("Payload " + i); } @@ -33,7 +33,7 @@ function closeWsConnection() { return new Promise(resolve => { - ws.onclose = e => { + ws.onclose = () => { resolve(); }; ws.close(); @@ -48,7 +48,7 @@ function openSseConnection() { return new Promise(resolve => { es = new EventSource("sjs_sse-test-server.sjs"); - es.onmessage = function(e) { + es.onmessage = function() { es.close(); resolve(); }; diff --git a/devtools/client/netmonitor/test/html_ws-test-page.html b/devtools/client/netmonitor/test/html_ws-test-page.html index de32b2a18ae3..7abcd033ed43 100644 --- a/devtools/client/netmonitor/test/html_ws-test-page.html +++ b/devtools/client/netmonitor/test/html_ws-test-page.html @@ -21,7 +21,7 @@ ws = new WebSocket( "ws://mochi.test:8888/browser/devtools/client/netmonitor/test/file_ws_backend"); - ws.onopen = e => { + ws.onopen = () => { for (let i = 0; i < numFramesToSend; i++) { ws.send("Payload " + i); } @@ -41,7 +41,7 @@ function closeConnection() { return new Promise(resolve => { - ws.onclose = e => { + ws.onclose = () => { resolve(); } ws.close(); diff --git a/devtools/client/netmonitor/test/service-workers/status-codes.html b/devtools/client/netmonitor/test/service-workers/status-codes.html index 05664d13a721..cb6f8fc535c4 100644 --- a/devtools/client/netmonitor/test/service-workers/status-codes.html +++ b/devtools/client/netmonitor/test/service-workers/status-codes.html @@ -39,7 +39,7 @@ }, {once: true}); } }); - }).catch(err => { + }).catch(() => { console.error("Registration failed"); }); } diff --git a/devtools/client/performance-new/panel/panel.js b/devtools/client/performance-new/panel/panel.js index d099f3c29669..2377855d3160 100644 --- a/devtools/client/performance-new/panel/panel.js +++ b/devtools/client/performance-new/panel/panel.js @@ -37,9 +37,9 @@ class PerformancePanel { * This is implemented (and overwritten) by the EventEmitter. Is there a way * to use mixins with JSDoc? * - * @param {string} eventName + * @param {string} _eventName */ - emit(eventName) {} + emit(_eventName) {} /** * Open is effectively an asynchronous constructor. diff --git a/devtools/client/performance-new/popup/menu-button.sys.mjs b/devtools/client/performance-new/popup/menu-button.sys.mjs index f1aee09af4db..3dfffb4098db 100644 --- a/devtools/client/performance-new/popup/menu-button.sys.mjs +++ b/devtools/client/performance-new/popup/menu-button.sys.mjs @@ -32,10 +32,9 @@ const WIDGET_ID = "profiler-button"; /** * Add the profiler button to the navbar. * - * @param {ChromeDocument} document The browser's document. * @return {void} */ -function addToNavbar(document) { +function addToNavbar() { const { CustomizableUI } = lazy.CustomizableUI(); CustomizableUI.addWidgetToArea(WIDGET_ID, CustomizableUI.AREA_NAVBAR); @@ -173,7 +172,7 @@ function initialize(toggleProfilerKeyShortcuts) { /** * @type {(event: { target: ChromeHTMLElement | XULElement }) => void} */ - onViewHiding(event) { + onViewHiding() { // Clean-up the view. This removes all of the event listeners. for (const fn of panelState.cleanup) { fn(); @@ -292,8 +291,7 @@ function initialize(toggleProfilerKeyShortcuts) { }); }, - // @ts-ignore - Bug 1674368 - onCommand: event => { + onCommand: () => { if (Services.profiler.IsPaused()) { // A profile is already being captured, ignore this event. return; diff --git a/devtools/client/performance-new/shared/background.sys.mjs b/devtools/client/performance-new/shared/background.sys.mjs index f538500a422b..8238725744cb 100644 --- a/devtools/client/performance-new/shared/background.sys.mjs +++ b/devtools/client/performance-new/shared/background.sys.mjs @@ -761,7 +761,7 @@ async function getResponseForMessage(request, browser) { // Enable the profiler menu button. const { ProfilerMenuButton } = lazy.ProfilerMenuButton(); - ProfilerMenuButton.addToNavbar(ownerDocument); + ProfilerMenuButton.addToNavbar(); // Dispatch the change event manually, so that the shortcuts will also be // added. diff --git a/devtools/client/performance-new/store/actions.js b/devtools/client/performance-new/store/actions.js index 2bb7ce126c02..970ce4e6440a 100644 --- a/devtools/client/performance-new/store/actions.js +++ b/devtools/client/performance-new/store/actions.js @@ -181,7 +181,7 @@ exports.startRecording = perfFront => { * @return {ThunkAction>} */ exports.getProfileAndStopProfiler = perfFront => { - return async ({ dispatch, getState }) => { + return async ({ dispatch }) => { dispatch({ type: "REQUESTING_PROFILE" }); const profile = await perfFront.getProfileAndStopProfiler(); dispatch({ type: "OBTAINED_PROFILE" }); @@ -195,7 +195,7 @@ exports.getProfileAndStopProfiler = perfFront => { * @return {ThunkAction} */ exports.stopProfilerAndDiscardProfile = perfFront => { - return async ({ dispatch, getState }) => { + return async ({ dispatch }) => { dispatch({ type: "REQUESTING_TO_STOP_RECORDING" }); try { diff --git a/devtools/client/performance-new/test/browser/browser_webchannel-enable-menu-button-preset.js b/devtools/client/performance-new/test/browser/browser_webchannel-enable-menu-button-preset.js index 4732f8f037aa..aefcd175c94f 100644 --- a/devtools/client/performance-new/test/browser/browser_webchannel-enable-menu-button-preset.js +++ b/devtools/client/performance-new/test/browser/browser_webchannel-enable-menu-button-preset.js @@ -33,7 +33,7 @@ add_task(async function test() { ); // Enable the profiler menu button with web channel. - await withWebChannelTestDocument(async browser => { + await withWebChannelTestDocument(async _browser => { await waitForTabTitle("WebChannel Page Ready"); await waitForProfilerMenuButton(); ok(true, "The profiler menu button was enabled by the WebChannel."); diff --git a/devtools/client/performance-new/test/browser/browser_webchannel-enable-menu-button.js b/devtools/client/performance-new/test/browser/browser_webchannel-enable-menu-button.js index a1864c475dc8..23d72225e541 100644 --- a/devtools/client/performance-new/test/browser/browser_webchannel-enable-menu-button.js +++ b/devtools/client/performance-new/test/browser/browser_webchannel-enable-menu-button.js @@ -8,7 +8,7 @@ add_task(async function test() { info("Test the WebChannel mechanism works for turning on the menu button."); await makeSureProfilerPopupIsDisabled(); - await withWebChannelTestDocument(async browser => { + await withWebChannelTestDocument(async () => { await waitForTabTitle("WebChannel Page Ready"); await waitForProfilerMenuButton(); ok(true, "The profiler menu button was enabled by the WebChannel."); diff --git a/devtools/client/responsive/reducers/devices.js b/devtools/client/responsive/reducers/devices.js index 98f0602175aa..960ecc336a93 100644 --- a/devtools/client/responsive/reducers/devices.js +++ b/devtools/client/responsive/reducers/devices.js @@ -70,21 +70,21 @@ const reducers = { }; }, - [LOAD_DEVICE_LIST_START](devices, action) { + [LOAD_DEVICE_LIST_START](devices) { return { ...devices, listState: Types.loadableState.LOADING, }; }, - [LOAD_DEVICE_LIST_ERROR](devices, action) { + [LOAD_DEVICE_LIST_ERROR](devices) { return { ...devices, listState: Types.loadableState.ERROR, }; }, - [LOAD_DEVICE_LIST_END](devices, action) { + [LOAD_DEVICE_LIST_END](devices) { return { ...devices, listState: Types.loadableState.LOADED, diff --git a/devtools/client/responsive/reducers/screenshot.js b/devtools/client/responsive/reducers/screenshot.js index 67f26f1f9a84..dcf962a9ebf6 100644 --- a/devtools/client/responsive/reducers/screenshot.js +++ b/devtools/client/responsive/reducers/screenshot.js @@ -14,14 +14,14 @@ const INITIAL_SCREENSHOT = { }; const reducers = { - [TAKE_SCREENSHOT_END](screenshot, action) { + [TAKE_SCREENSHOT_END](screenshot) { return { ...screenshot, isCapturing: false, }; }, - [TAKE_SCREENSHOT_START](screenshot, action) { + [TAKE_SCREENSHOT_START](screenshot) { return { ...screenshot, isCapturing: true, diff --git a/devtools/client/responsive/test/browser/browser_device_pixel_ratio_change.js b/devtools/client/responsive/test/browser/browser_device_pixel_ratio_change.js index c11313a18861..798cec8c5dd9 100644 --- a/devtools/client/responsive/test/browser/browser_device_pixel_ratio_change.js +++ b/devtools/client/responsive/test/browser/browser_device_pixel_ratio_change.js @@ -27,7 +27,7 @@ addDeviceForTest(testDevice); addRDMTask( TEST_URL, - async function ({ ui, manager }) { + async function ({ ui }) { await waitStartup(ui); await testDefaults(ui); diff --git a/devtools/client/responsive/test/browser/browser_device_state_restore.js b/devtools/client/responsive/test/browser/browser_device_state_restore.js index f8778795c2e6..8bfda3e5c6b6 100644 --- a/devtools/client/responsive/test/browser/browser_device_state_restore.js +++ b/devtools/client/responsive/test/browser/browser_device_state_restore.js @@ -75,7 +75,7 @@ addRDMTask( addRDMTaskWithPreAndPost( TEST_URL, - function rdmPreTask({ browser }) { + function rdmPreTask() { reloadOnUAChange(true); }, async function ({ ui }) { @@ -115,7 +115,7 @@ addRDMTaskWithPreAndPost( reloadOnUAChange(false); }, - function rdmPostTask({ browser }) {}, + function rdmPostTask() {}, { waitForDeviceList: true } ); diff --git a/devtools/client/responsive/test/browser/browser_ext_messaging.js b/devtools/client/responsive/test/browser/browser_ext_messaging.js index 5d1b5cf31790..470494697663 100644 --- a/devtools/client/responsive/test/browser/browser_ext_messaging.js +++ b/devtools/client/responsive/test/browser/browser_ext_messaging.js @@ -120,7 +120,7 @@ addRDMTask(TEST_URL, async function test_tab_sender() { let extTab; const contentMessage = new Promise(resolve => { browser.test.log("Listen to content"); - const listener = async (msg, sender, respond) => { + const listener = async (msg, sender) => { browser.test.assertEq( msg, "hello-from-content", diff --git a/devtools/client/responsive/test/browser/browser_many_toggles.js b/devtools/client/responsive/test/browser/browser_many_toggles.js index a0fe19dba4eb..beb8e0eafab6 100644 --- a/devtools/client/responsive/test/browser/browser_many_toggles.js +++ b/devtools/client/responsive/test/browser/browser_many_toggles.js @@ -21,7 +21,7 @@ addRDMTask( info(`Toggling RDM #${i + 1}`); // This may throw when we were just closing is still ongoing, // ignore any exception. - openRDM(tab).catch(e => {}); + openRDM(tab).catch(() => {}); // Sometime pause in order to cover both full synchronous opening and close // but also the same but with some pause between each operation. if (i % 2 == 0) { diff --git a/devtools/client/responsive/test/browser/browser_network_throttling.js b/devtools/client/responsive/test/browser/browser_network_throttling.js index fbf97b172a89..a9d1c1f07663 100644 --- a/devtools/client/responsive/test/browser/browser_network_throttling.js +++ b/devtools/client/responsive/test/browser/browser_network_throttling.js @@ -10,7 +10,7 @@ const { // Tests changing network throttling const TEST_URL = "data:text/html;charset=utf-8,Network throttling test"; -addRDMTask(TEST_URL, async function ({ ui, manager }) { +addRDMTask(TEST_URL, async function ({ ui }) { // Test defaults testNetworkThrottlingSelectorLabel(ui, "No Throttling", "No Throttling"); await testNetworkThrottlingState(ui, null); diff --git a/devtools/client/responsive/test/browser/browser_page_style.js b/devtools/client/responsive/test/browser/browser_page_style.js index c59ba03b4736..7f470baa945b 100644 --- a/devtools/client/responsive/test/browser/browser_page_style.js +++ b/devtools/client/responsive/test/browser/browser_page_style.js @@ -8,7 +8,7 @@ http://creativecommons.org/publicdomain/zero/1.0/ */ const TEST_URL = `${URL_ROOT}page_style.html`; -addRDMTask(TEST_URL, async function ({ ui, manager }) { +addRDMTask(TEST_URL, async function ({ ui }) { // Store the RDM body text color for later. const rdmWindow = ui.toolWindow; const rdmTextColor = rdmWindow.getComputedStyle( diff --git a/devtools/client/responsive/test/browser/browser_picker_link.js b/devtools/client/responsive/test/browser/browser_picker_link.js index 1aedb06dd08b..6a7df43130e9 100644 --- a/devtools/client/responsive/test/browser/browser_picker_link.js +++ b/devtools/client/responsive/test/browser/browser_picker_link.js @@ -9,7 +9,7 @@ */ const TEST_URI = `${URL_ROOT}doc_picker_link.html`; -addRDMTask(TEST_URI, async function ({ ui, manager }) { +addRDMTask(TEST_URI, async function ({ ui }) { info("Open the rule-view and select the test node before opening RDM"); const { inspector, toolbox } = await openRuleView(); await selectNode("body", inspector); diff --git a/devtools/client/responsive/test/browser/browser_touch_event_iframes.js b/devtools/client/responsive/test/browser/browser_touch_event_iframes.js index 11b94d2ab193..6ad963f4c078 100644 --- a/devtools/client/responsive/test/browser/browser_touch_event_iframes.js +++ b/devtools/client/responsive/test/browser/browser_touch_event_iframes.js @@ -72,7 +72,7 @@ for (const mvcontent of META_VIEWPORT_CONTENTS) { `style="margin:0; border:0; width:100%; height:100%">` + ``; - addRDMTask(TEST_URL, async function ({ ui, manager, browser }) { + addRDMTask(TEST_URL, async function ({ ui, manager }) { await setViewportSize(ui, manager, VIEWPORT_DIMENSION, VIEWPORT_DIMENSION); await setTouchAndMetaViewportSupport(ui, true); diff --git a/devtools/client/responsive/test/browser/browser_typeahead_find.js b/devtools/client/responsive/test/browser/browser_typeahead_find.js index 7bc22de1ef99..2d162c074f5d 100644 --- a/devtools/client/responsive/test/browser/browser_typeahead_find.js +++ b/devtools/client/responsive/test/browser/browser_typeahead_find.js @@ -17,7 +17,7 @@ const TEST_URL = "data:text/html;charset=utf-8," + '

text'; -addRDMTask(TEST_URL, async function ({ ui, manager }) { +addRDMTask(TEST_URL, async function ({ ui }) { // Turn on the pref that allows meta viewport support. await pushPref("accessibility.typeaheadfind", true); diff --git a/devtools/client/responsive/test/browser/browser_viewport_changed_meta.js b/devtools/client/responsive/test/browser/browser_viewport_changed_meta.js index f0bafdd5519a..c5a13b407a78 100644 --- a/devtools/client/responsive/test/browser/browser_viewport_changed_meta.js +++ b/devtools/client/responsive/test/browser/browser_viewport_changed_meta.js @@ -71,7 +71,7 @@ const TEST_URL = `data:text/html;charset=utf-8, `; -addRDMTask(TEST_URL, async function ({ ui, manager, browser }) { +addRDMTask(TEST_URL, async function ({ ui, manager }) { await setViewportSize(ui, manager, WIDTH, HEIGHT); await setTouchAndMetaViewportSupport(ui, true); diff --git a/devtools/client/responsive/test/browser/browser_viewport_zoom_toggle.js b/devtools/client/responsive/test/browser/browser_viewport_zoom_toggle.js index 400bfa99a99e..d6d2625492c2 100644 --- a/devtools/client/responsive/test/browser/browser_viewport_zoom_toggle.js +++ b/devtools/client/responsive/test/browser/browser_viewport_zoom_toggle.js @@ -17,7 +17,7 @@ function setZoomForBrowser(browser, zoom) { addRDMTask( null, - async function ({ message }) { + async function () { const INITIAL_ZOOM_LEVEL = 1; const PRE_RDM_ZOOM_LEVEL = 1.5; const MID_RDM_ZOOM_LEVEL = 2; diff --git a/devtools/client/responsive/test/browser/geolocation.html b/devtools/client/responsive/test/browser/geolocation.html index df0014dd0258..086bd7eaa8dc 100644 --- a/devtools/client/responsive/test/browser/geolocation.html +++ b/devtools/client/responsive/test/browser/geolocation.html @@ -7,7 +7,7 @@ diff --git a/devtools/client/responsive/test/browser/touch.html b/devtools/client/responsive/test/browser/touch.html index eed55426bde8..c19f26cd8faa 100644 --- a/devtools/client/responsive/test/browser/touch.html +++ b/devtools/client/responsive/test/browser/touch.html @@ -41,18 +41,18 @@ } }, true); - div.addEventListener("mouseenter", function (evt) { + div.addEventListener("mouseenter", function () { div.style.backgroundColor = "red"; }, true); - div.addEventListener("mouseover", function(evt) { + div.addEventListener("mouseover", function() { div.style.backgroundColor = "red"; }, true); - div.addEventListener("mouseout", function (evt) { + div.addEventListener("mouseout", function () { div.style.backgroundColor = "blue"; }, true); - div.addEventListener("mouseleave", function (evt) { + div.addEventListener("mouseleave", function () { div.style.backgroundColor = "blue"; }, true); diff --git a/devtools/client/responsive/ui.js b/devtools/client/responsive/ui.js index 713158d65494..7784887eb3d6 100644 --- a/devtools/client/responsive/ui.js +++ b/devtools/client/responsive/ui.js @@ -56,8 +56,8 @@ const RELOAD_CONDITION_PREF_PREFIX = "devtools.responsive.reloadConditions."; const RELOAD_NOTIFICATION_PREF = "devtools.responsive.reloadNotification.enabled"; -function debug(msg) { - // console.log(`RDM manager: ${msg}`); +function debug(_msg) { + // console.log(`RDM manager: ${_msg}`); } /** diff --git a/devtools/client/shared/async-store-helper.js b/devtools/client/shared/async-store-helper.js index 0919a07b986e..b24d56e62914 100644 --- a/devtools/client/shared/async-store-helper.js +++ b/devtools/client/shared/async-store-helper.js @@ -41,7 +41,7 @@ function asyncStoreHelper(root, mappings) { ); store = new Proxy(store, { - set(target, property, value, receiver) { + set(target, property) { if (!mappings.hasOwnProperty(property)) { throw new Error(`AsyncStore: ${property} is not defined in mappings`); } diff --git a/devtools/client/shared/autocomplete-popup.js b/devtools/client/shared/autocomplete-popup.js index 93ebc8d688dc..81e6070f8026 100644 --- a/devtools/client/shared/autocomplete-popup.js +++ b/devtools/client/shared/autocomplete-popup.js @@ -184,7 +184,7 @@ AutocompletePopup.prototype = { } }, - onInputBlur(event) { + onInputBlur() { if (this.isOpen) { this.clearItems(); this.hidePopup(); diff --git a/devtools/client/shared/components/Tree.js b/devtools/client/shared/components/Tree.js index b1e9e18780cf..23b725bcfe8a 100644 --- a/devtools/client/shared/components/Tree.js +++ b/devtools/client/shared/components/Tree.js @@ -51,7 +51,7 @@ class ArrowExpander extends Component { }; } - shouldComponentUpdate(nextProps, nextState) { + shouldComponentUpdate(nextProps) { return this.props.expanded !== nextProps.expanded; } @@ -555,11 +555,11 @@ class Tree extends Component { } // FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=1774507 - UNSAFE_componentWillReceiveProps(nextProps) { + UNSAFE_componentWillReceiveProps() { this._autoExpand(); } - componentDidUpdate(prevProps, prevState) { + componentDidUpdate(prevProps) { if (this.props.focused && prevProps.focused !== this.props.focused) { this._scrollNodeIntoView(this.props.focused); } diff --git a/devtools/client/shared/components/VirtualizedTree.js b/devtools/client/shared/components/VirtualizedTree.js index 4f8dab1bd553..de388a2e0922 100644 --- a/devtools/client/shared/components/VirtualizedTree.js +++ b/devtools/client/shared/components/VirtualizedTree.js @@ -300,7 +300,7 @@ class Tree extends Component { } // FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=1774507 - UNSAFE_componentWillReceiveProps(nextProps) { + UNSAFE_componentWillReceiveProps() { this._autoExpand(); this._updateHeight(); } @@ -559,10 +559,8 @@ class Tree extends Component { /** * Fired on a scroll within the tree's container, updates * the stored position of the view port to handle virtual view rendering. - * - * @param {Event} e */ - _onScroll(e) { + _onScroll() { this.setState({ scroll: Math.max(this.refs.tree.scrollTop, 0), height: this.refs.tree.clientHeight, @@ -882,7 +880,7 @@ class ArrowExpanderClass extends Component { }; } - shouldComponentUpdate(nextProps, nextState) { + shouldComponentUpdate(nextProps) { return ( this.props.item !== nextProps.item || this.props.visible !== nextProps.visible || diff --git a/devtools/client/shared/components/menu/MenuList.js b/devtools/client/shared/components/menu/MenuList.js index 4c355cca1083..dafcc407bcf4 100644 --- a/devtools/client/shared/components/menu/MenuList.js +++ b/devtools/client/shared/components/menu/MenuList.js @@ -55,7 +55,7 @@ class MenuList extends PureComponent { this.notifyHighlightedChildChange(e.target.id); } - onMouseOutOrBlur(e) { + onMouseOutOrBlur() { const hoveredElem = this.wrapperRef.querySelector(":hover"); if (!hoveredElem) { this.notifyHighlightedChildChange(null); diff --git a/devtools/client/shared/components/reps/reps/element-node.js b/devtools/client/shared/components/reps/reps/element-node.js index a31fb4225bac..af38cc0f6f42 100644 --- a/devtools/client/shared/components/reps/reps/element-node.js +++ b/devtools/client/shared/components/reps/reps/element-node.js @@ -180,7 +180,7 @@ define(function (require, exports, module) { attributeKeys.splice(attributeKeys.indexOf("id"), 1); attributeKeys.unshift("id"); } - const attributeElements = attributeKeys.reduce((arr, name, i, keys) => { + const attributeElements = attributeKeys.reduce((arr, name) => { const value = attributes[name]; let title = isLongString(value) ? value.initial : value; diff --git a/devtools/client/shared/components/reps/reps/error.js b/devtools/client/shared/components/reps/reps/error.js index 617bf8c8a2ed..688d10ba8951 100644 --- a/devtools/client/shared/components/reps/reps/error.js +++ b/devtools/client/shared/components/reps/reps/error.js @@ -161,7 +161,7 @@ define(function (require, exports, module) { return stack; } - parseStackString(preview.stack).forEach((frame, index, frames) => { + parseStackString(preview.stack).forEach((frame, index) => { let onLocationClick; const { filename, lineNumber, columnNumber, functionName, location } = frame; diff --git a/devtools/client/shared/components/reps/reps/function.js b/devtools/client/shared/components/reps/reps/function.js index 54d8905c2025..93d77b1392e2 100644 --- a/devtools/client/shared/components/reps/reps/function.js +++ b/devtools/client/shared/components/reps/reps/function.js @@ -118,7 +118,7 @@ define(function (require, exports, module) { return returnSpan; } - function getClassTitle(grip) { + function getClassTitle() { return span( { className: "objectTitle", diff --git a/devtools/client/shared/components/reps/reps/grip-map.js b/devtools/client/shared/components/reps/reps/grip-map.js index dcb7c5097256..918e37ac8c0b 100644 --- a/devtools/client/shared/components/reps/reps/grip-map.js +++ b/devtools/client/shared/components/reps/reps/grip-map.js @@ -168,7 +168,7 @@ define(function (require, exports, module) { return a - b; }); - return indexes.map((index, i) => { + return indexes.map(index => { const [key, entryValue] = entries[index]; const value = entryValue.value !== undefined ? entryValue.value : entryValue; diff --git a/devtools/client/shared/components/reps/reps/grip.js b/devtools/client/shared/components/reps/reps/grip.js index 68f356858aef..606ecfab8de2 100644 --- a/devtools/client/shared/components/reps/reps/grip.js +++ b/devtools/client/shared/components/reps/reps/grip.js @@ -375,7 +375,7 @@ define(function (require, exports, module) { } // Registration - function supportsObject(object, noGrip = false) { + function supportsObject(object) { if (object?.class === "DeadObject") { return true; } diff --git a/devtools/client/shared/components/reps/reps/text-node.js b/devtools/client/shared/components/reps/reps/text-node.js index ae9a7bb10961..474e647a9dec 100644 --- a/devtools/client/shared/components/reps/reps/text-node.js +++ b/devtools/client/shared/components/reps/reps/text-node.js @@ -123,13 +123,13 @@ define(function (require, exports, module) { }); } - function getTitle(grip) { + function getTitle() { const title = "#text"; return span({}, title); } // Registration - function supportsObject(grip, noGrip = false) { + function supportsObject(grip) { return grip?.preview && grip?.class == "Text"; } diff --git a/devtools/client/shared/components/tabs/TabBar.js b/devtools/client/shared/components/tabs/TabBar.js index 730e8c78028d..cbd1e927ae51 100644 --- a/devtools/client/shared/components/tabs/TabBar.js +++ b/devtools/client/shared/components/tabs/TabBar.js @@ -73,7 +73,7 @@ class Tabbar extends Component { super(props, context); const { activeTabId, children = [] } = props; const tabs = this.createTabs(children); - const activeTab = tabs.findIndex((tab, index) => tab.id === activeTabId); + const activeTab = tabs.findIndex(tab => tab.id === activeTabId); this.state = { activeTab: activeTab === -1 ? 0 : activeTab, @@ -103,7 +103,7 @@ class Tabbar extends Component { UNSAFE_componentWillReceiveProps(nextProps) { const { activeTabId, children = [] } = nextProps; const tabs = this.createTabs(children); - const activeTab = tabs.findIndex((tab, index) => tab.id === activeTabId); + const activeTab = tabs.findIndex(tab => tab.id === activeTabId); if ( activeTab !== this.state.activeTab || diff --git a/devtools/client/shared/components/tabs/Tabs.js b/devtools/client/shared/components/tabs/Tabs.js index a265032f9e88..bbb061503e2c 100644 --- a/devtools/client/shared/components/tabs/Tabs.js +++ b/devtools/client/shared/components/tabs/Tabs.js @@ -4,7 +4,7 @@ "use strict"; -define(function (require, exports, module) { +define(function (require, exports) { const { Component, createRef, diff --git a/devtools/client/shared/components/test/chrome/test_notification_box_04.html b/devtools/client/shared/components/test/chrome/test_notification_box_04.html index 07ad9af25c0e..fde11a7bff93 100644 --- a/devtools/client/shared/components/test/chrome/test_notification_box_04.html +++ b/devtools/client/shared/components/test/chrome/test_notification_box_04.html @@ -43,7 +43,7 @@ window.onload = async function () { null, PriorityLevels.PRIORITY_INFO_LOW, [mdnLinkButton], - (e) => false, + () => false, ); const linkNode = notificationNode.querySelector( diff --git a/devtools/client/shared/components/test/chrome/test_notification_box_05.html b/devtools/client/shared/components/test/chrome/test_notification_box_05.html index b3a4e96378bd..10d6b8971f74 100644 --- a/devtools/client/shared/components/test/chrome/test_notification_box_05.html +++ b/devtools/client/shared/components/test/chrome/test_notification_box_05.html @@ -42,7 +42,7 @@ window.onload = async function () { null, PriorityLevels.PRIORITY_INFO_LOW, [], - (e) => false, + () => false, ); // Ensure close button is not present diff --git a/devtools/client/shared/components/test/node/__mocks__/object-front.js b/devtools/client/shared/components/test/node/__mocks__/object-front.js index def182111d0a..5913deb82e30 100644 --- a/devtools/client/shared/components/test/node/__mocks__/object-front.js +++ b/devtools/client/shared/components/test/node/__mocks__/object-front.js @@ -14,7 +14,7 @@ function ObjectFront(grip, overrides) { }) ); }, - enumProperties(options) { + enumProperties() { return Promise.resolve( this.getIterator({ ownProperties: {}, @@ -43,7 +43,7 @@ function ObjectFront(grip, overrides) { // Declared here so we can override it. getIterator(res) { return { - slice(start, count) { + slice() { return Promise.resolve(res); }, }; diff --git a/devtools/client/shared/components/test/node/components/tree.test.js b/devtools/client/shared/components/test/node/components/tree.test.js index c70b66e8ffb1..eb6f95fa7d74 100644 --- a/devtools/client/shared/components/test/node/components/tree.test.js +++ b/devtools/client/shared/components/test/node/components/tree.test.js @@ -50,12 +50,12 @@ function mountTree(overrides = {}) { getKey: x => `key-${x}`, itemHeight: 1, onFocus: x => { - this.setState(previousState => { + this.setState(() => { return { focused: x }; }); }, onActivate: x => { - this.setState(previousState => { + this.setState(() => { return { active: x }; }); }, @@ -207,7 +207,7 @@ describe("Tree", () => { }); it("calls shouldItemUpdate when provided", () => { - const shouldItemUpdate = jest.fn((prev, next) => true); + const shouldItemUpdate = jest.fn(() => true); const wrapper = mountTree({ shouldItemUpdate, }); @@ -636,7 +636,7 @@ describe("Tree", () => { it("renders as expected navigating with arrows on unexpandable roots", () => { const wrapper = mountTree({ focused: "A", - isExpandable: item => false, + isExpandable: () => false, }); expect(formatTree(wrapper)).toMatchSnapshot(); diff --git a/devtools/client/shared/components/tree/ObjectProvider.js b/devtools/client/shared/components/tree/ObjectProvider.js index 48d577ff4ddc..80543df73af4 100644 --- a/devtools/client/shared/components/tree/ObjectProvider.js +++ b/devtools/client/shared/components/tree/ObjectProvider.js @@ -4,7 +4,7 @@ "use strict"; // Make this available to both AMD and CJS environments -define(function (require, exports, module) { +define(function (require, exports) { /** * Implementation of the default data provider. A provider is state less * object responsible for transformation data (usually a state) to diff --git a/devtools/client/shared/fluent-l10n/fluent-l10n.js b/devtools/client/shared/fluent-l10n/fluent-l10n.js index d3a5c33408d3..3a27b225fdb1 100644 --- a/devtools/client/shared/fluent-l10n/fluent-l10n.js +++ b/devtools/client/shared/fluent-l10n/fluent-l10n.js @@ -49,13 +49,13 @@ class FluentL10n { /** * Returns the localized string for the provided id, formatted using args. */ - getString(id, args, fallback) { + getString(...args) { // Forward arguments via .apply() so that the original method can: // - perform asserts based on the number of arguments // - add new arguments return this._reactLocalization.getString.apply( this._reactLocalization, - arguments + args ); } } diff --git a/devtools/client/shared/output-parser.js b/devtools/client/shared/output-parser.js index 4ae1a60b114a..fc1afca5a03b 100644 --- a/devtools/client/shared/output-parser.js +++ b/devtools/client/shared/output-parser.js @@ -1445,7 +1445,7 @@ class OutputParser { nodes[nodeIndex].classList.add(point); } - nodes.forEach((node, j, array) => { + nodes.forEach((node, j) => { for (const text of otherText[j]) { appendText(container, text); } diff --git a/devtools/client/shared/redux/middleware/debounce.js b/devtools/client/shared/redux/middleware/debounce.js index fc5625a0fe0e..c630398ffafa 100644 --- a/devtools/client/shared/redux/middleware/debounce.js +++ b/devtools/client/shared/redux/middleware/debounce.js @@ -24,7 +24,7 @@ function debounceActions(wait, maxWait) { let queuedActions = []; - return store => next => { + return () => next => { const debounced = debounce( () => { next(batchActions(queuedActions)); diff --git a/devtools/client/shared/redux/middleware/log.js b/devtools/client/shared/redux/middleware/log.js index 4ea09491ca1c..c9af48f1d346 100644 --- a/devtools/client/shared/redux/middleware/log.js +++ b/devtools/client/shared/redux/middleware/log.js @@ -7,7 +7,7 @@ * A middleware that logs all actions coming through the system * to the console. */ -function log({ dispatch, getState }) { +function log() { return next => action => { try { // Only print the action type, rather than printing the whole object diff --git a/devtools/client/shared/redux/middleware/promise.js b/devtools/client/shared/redux/middleware/promise.js index 7f88651a61cf..c640ec6a9909 100644 --- a/devtools/client/shared/redux/middleware/promise.js +++ b/devtools/client/shared/redux/middleware/promise.js @@ -18,7 +18,7 @@ loader.lazyRequireGetter( const PROMISE = (exports.PROMISE = "@@dispatch/promise"); -function promiseMiddleware({ dispatch, getState }) { +function promiseMiddleware({ dispatch }) { return next => action => { if (!(PROMISE in action)) { return next(action); diff --git a/devtools/client/shared/redux/middleware/xpcshell/test_middleware-task-02.js b/devtools/client/shared/redux/middleware/xpcshell/test_middleware-task-02.js index eaa573a8ae7b..a515acd2a4b9 100644 --- a/devtools/client/shared/redux/middleware/xpcshell/test_middleware-task-02.js +++ b/devtools/client/shared/redux/middleware/xpcshell/test_middleware-task-02.js @@ -56,7 +56,7 @@ add_task(async function () { }); function comboAction() { - return async function ({ dispatch, getState }) { + return async function ({ dispatch }) { const data = {}; data.async = await dispatch(fetchAsync("async")); data.sync = await dispatch(fetchSync("sync")); diff --git a/devtools/client/shared/redux/middleware/xpcshell/test_middleware-task-03.js b/devtools/client/shared/redux/middleware/xpcshell/test_middleware-task-03.js index 94087e31dea0..31c83a3122a5 100644 --- a/devtools/client/shared/redux/middleware/xpcshell/test_middleware-task-03.js +++ b/devtools/client/shared/redux/middleware/xpcshell/test_middleware-task-03.js @@ -35,7 +35,7 @@ add_task(async function () { }); function asyncError() { - return async ({ dispatch, getState }) => { + return async () => { const error = "task-middleware-error-generator"; throw error; }; diff --git a/devtools/client/shared/remote-debugging/adb/adb-process.js b/devtools/client/shared/remote-debugging/adb/adb-process.js index ade509125e38..f91638812481 100644 --- a/devtools/client/shared/remote-debugging/adb/adb-process.js +++ b/devtools/client/shared/remote-debugging/adb/adb-process.js @@ -68,7 +68,7 @@ class AdbProcess extends EventEmitter { params, params.length, { - observe(subject, topic, data) { + observe(subject, topic) { switch (topic) { case "process-finished": resolve(); diff --git a/devtools/client/shared/remote-debugging/adb/adb-running-checker.js b/devtools/client/shared/remote-debugging/adb/adb-running-checker.js index 7f952ca39bfa..5660e3ddc743 100644 --- a/devtools/client/shared/remote-debugging/adb/adb-running-checker.js +++ b/devtools/client/shared/remote-debugging/adb/adb-running-checker.js @@ -64,18 +64,18 @@ exports.check = async function check() { }; const setupSocket = function () { - socket.s.onerror = function (event) { + socket.s.onerror = function () { dumpn("running checker onerror"); finish(false); }; - socket.s.onopen = function (event) { + socket.s.onopen = function () { dumpn("running checker onopen"); state = "start"; runFSM(); }; - socket.s.onclose = function (event) { + socket.s.onclose = function () { dumpn("running checker onclose"); }; diff --git a/devtools/client/shared/remote-debugging/adb/commands/shell.js b/devtools/client/shared/remote-debugging/adb/commands/shell.js index 03f4bfcf7819..e891ab218d5d 100644 --- a/devtools/client/shared/remote-debugging/adb/commands/shell.js +++ b/devtools/client/shared/remote-debugging/adb/commands/shell.js @@ -81,18 +81,18 @@ const shell = async function (deviceId, command) { }; const socket = client.connect(); - socket.s.onerror = function (event) { + socket.s.onerror = function () { dumpn("shell onerror"); reject("SOCKET_ERROR"); }; - socket.s.onopen = function (event) { + socket.s.onopen = function () { dumpn("shell onopen"); state = "start"; runFSM(); }; - socket.s.onclose = function (event) { + socket.s.onclose = function () { resolve(stdout); dumpn("shell onclose"); }; diff --git a/devtools/client/shared/source-map-loader/wasm-dwarf/wasmAsset.js b/devtools/client/shared/source-map-loader/wasm-dwarf/wasmAsset.js index b4de822ffd93..9d02da0f54c7 100644 --- a/devtools/client/shared/source-map-loader/wasm-dwarf/wasmAsset.js +++ b/devtools/client/shared/source-map-loader/wasm-dwarf/wasmAsset.js @@ -4,7 +4,7 @@ "use strict"; -async function getDwarfToWasmData(name) { +async function getDwarfToWasmData() { const response = await fetch( "resource://devtools/client/shared/source-map-loader/wasm-dwarf/dwarf_to_json.wasm" ); diff --git a/devtools/client/shared/sourceeditor/test/browser_editor_autocomplete_basic.js b/devtools/client/shared/sourceeditor/test/browser_editor_autocomplete_basic.js index c7dc9c8a97ec..13ab5825c8b1 100644 --- a/devtools/client/shared/sourceeditor/test/browser_editor_autocomplete_basic.js +++ b/devtools/client/shared/sourceeditor/test/browser_editor_autocomplete_basic.js @@ -18,7 +18,7 @@ async function test() { teardown(ed, win); } -function testJS(ed, win) { +function testJS(ed) { ok(!ed.getOption("autocomplete"), "Autocompletion is not set"); ed.setMode(Editor.modes.js); @@ -27,7 +27,7 @@ function testJS(ed, win) { ok(ed.getOption("autocomplete"), "Autocompletion is set"); } -function testCSS(ed, win) { +function testCSS(ed) { ok(ed.getOption("autocomplete"), "Autocompletion is set"); ed.setMode(Editor.modes.css); @@ -36,7 +36,7 @@ function testCSS(ed, win) { ok(ed.getOption("autocomplete"), "Autocompletion is still set"); } -function testPref(ed, win) { +function testPref(ed) { ed.setMode(Editor.modes.js); ed.setOption("autocomplete", true); diff --git a/devtools/client/shared/stylesheet-utils.js b/devtools/client/shared/stylesheet-utils.js index 5a034debe1cc..187cf2898d51 100644 --- a/devtools/client/shared/stylesheet-utils.js +++ b/devtools/client/shared/stylesheet-utils.js @@ -5,7 +5,7 @@ /* eslint-env browser */ "use strict"; -function stylesheetLoadPromise(styleSheet, url) { +function stylesheetLoadPromise(styleSheet) { return new Promise((resolve, reject) => { styleSheet.addEventListener("load", resolve, { once: true }); styleSheet.addEventListener("error", reject, { once: true }); diff --git a/devtools/client/shared/test-helpers/jest-fixtures/Services.js b/devtools/client/shared/test-helpers/jest-fixtures/Services.js index 85d0bce5e0fc..d6198c8d2d9b 100644 --- a/devtools/client/shared/test-helpers/jest-fixtures/Services.js +++ b/devtools/client/shared/test-helpers/jest-fixtures/Services.js @@ -541,9 +541,9 @@ const Services = { appinfo: "", obs: { addObserver: () => {} }, strings: { - createBundle(bundle) { + createBundle() { return { - GetStringFromName(str) { + GetStringFromName() { return "NodeTest"; }, }; diff --git a/devtools/client/shared/test-helpers/shared-node-helpers.js b/devtools/client/shared/test-helpers/shared-node-helpers.js index ca6a728a8a4d..e9296d3b868b 100644 --- a/devtools/client/shared/test-helpers/shared-node-helpers.js +++ b/devtools/client/shared/test-helpers/shared-node-helpers.js @@ -13,7 +13,7 @@ function setMocksInGlobal() { global.Cc = new Proxy( {}, { - get(target, prop, receiver) { + get(target, prop) { if (prop.startsWith("@mozilla.org")) { return { getService: () => ({}) }; } diff --git a/devtools/client/shared/test/browser_cubic-bezier-02.js b/devtools/client/shared/test/browser_cubic-bezier-02.js index 3ce0af2f994a..55fcb39c8323 100644 --- a/devtools/client/shared/test/browser_cubic-bezier-02.js +++ b/devtools/client/shared/test/browser_cubic-bezier-02.js @@ -103,7 +103,7 @@ async function curveCanBeClicked(widget, win, doc, offsets) { is(bezier.P1[1], 0.75, "P1 progress coordinate remained unchanged"); } -async function pointsCanBeMovedWithKeyboard(widget, win, doc, offsets) { +async function pointsCanBeMovedWithKeyboard(widget) { info("Checking that points respond to keyboard events"); const singleStep = 3; diff --git a/devtools/client/shared/test/browser_cubic-bezier-06.js b/devtools/client/shared/test/browser_cubic-bezier-06.js index 9cb00e8bf7e9..269610b69f72 100644 --- a/devtools/client/shared/test/browser_cubic-bezier-06.js +++ b/devtools/client/shared/test/browser_cubic-bezier-06.js @@ -63,7 +63,7 @@ function adjustingBezierUpdatesPreset(widget, win, doc, rect) { is(widget.presets._activePreset, null, "There is no active preset"); } -async function selectingPresetUpdatesBezier(widget, win, doc, rect) { +async function selectingPresetUpdatesBezier(widget, win, doc) { info("Checking that selecting a preset updates bezier curve"); info("Listening for the new coordinates event"); diff --git a/devtools/client/shared/test/browser_dbg_listworkers.js b/devtools/client/shared/test/browser_dbg_listworkers.js index fcdcf8e5dd8d..fc5413913417 100644 --- a/devtools/client/shared/test/browser_dbg_listworkers.js +++ b/devtools/client/shared/test/browser_dbg_listworkers.js @@ -42,7 +42,7 @@ add_task(async function test() { is(workers[1].url, WORKER2_URL); onWorkerListChanged = waitForWorkerListChanged(target); - await SpecialPowers.spawn(tab.linkedBrowser, [WORKER2_URL], workerUrl => { + await SpecialPowers.spawn(tab.linkedBrowser, [WORKER2_URL], () => { content.worker1.terminate(); }); await onWorkerListChanged; @@ -52,7 +52,7 @@ add_task(async function test() { is(workers[0].url, WORKER2_URL); onWorkerListChanged = waitForWorkerListChanged(target); - await SpecialPowers.spawn(tab.linkedBrowser, [WORKER2_URL], workerUrl => { + await SpecialPowers.spawn(tab.linkedBrowser, [WORKER2_URL], () => { content.worker2.terminate(); }); await onWorkerListChanged; diff --git a/devtools/client/shared/test/browser_inplace-editor-01.js b/devtools/client/shared/test/browser_inplace-editor-01.js index b919fca94678..e6bc60439285 100644 --- a/devtools/client/shared/test/browser_inplace-editor-01.js +++ b/devtools/client/shared/test/browser_inplace-editor-01.js @@ -96,7 +96,7 @@ function testAdvanceCharCommit(doc) { createInplaceEditorAndClick( { advanceChars: ":", - start(editor) { + start() { EventUtils.sendString("Test:"); }, done: onDone("Test", true, resolve), @@ -114,7 +114,7 @@ function testAdvanceCharsFunction(doc) { createInplaceEditorAndClick( { initial: "", - advanceChars(charCode, text, insertionPoint) { + advanceChars(charCode, text) { if (charCode !== KeyboardEvent.DOM_VK_COLON) { return false; } @@ -126,7 +126,7 @@ function testAdvanceCharsFunction(doc) { // Just to make sure we check it somehow. return !!text.length; }, - start(editor) { + start() { for (const ch of ":Test:") { EventUtils.sendChar(ch); } diff --git a/devtools/client/shared/test/browser_key_shortcuts.js b/devtools/client/shared/test/browser_key_shortcuts.js index d48666ddcaac..6dafe3df2c76 100644 --- a/devtools/client/shared/test/browser_key_shortcuts.js +++ b/devtools/client/shared/test/browser_key_shortcuts.js @@ -438,7 +438,7 @@ async function testTabCharacterShortcut(shortcuts) { info("Test tab character shortcut"); - once(shortcuts, "CmdOrCtrl+Alt+I", event => { + once(shortcuts, "CmdOrCtrl+Alt+I", () => { ok(false, "This handler must not be executed"); }); diff --git a/devtools/client/shared/test/browser_spectrum.js b/devtools/client/shared/test/browser_spectrum.js index 6189b1f0af46..32ed6a79e0a8 100644 --- a/devtools/client/shared/test/browser_spectrum.js +++ b/devtools/client/shared/test/browser_spectrum.js @@ -245,12 +245,7 @@ function setSpectrumProps(spectrum, props, updateUI = true) { } } -function testAriaAttributesOnSpectrumElements( - spectrum, - colorName, - rgbString, - alpha -) { +function testAriaAttributesOnSpectrumElements(spectrum, colorName, rgbString) { for (const slider of [spectrum.dragger, spectrum.hueSlider]) { is( slider.getAttribute("aria-describedby"), diff --git a/devtools/client/shared/test/browser_telemetry_button_eyedropper.js b/devtools/client/shared/test/browser_telemetry_button_eyedropper.js index 88d019de9169..0606cec8867d 100644 --- a/devtools/client/shared/test/browser_telemetry_button_eyedropper.js +++ b/devtools/client/shared/test/browser_telemetry_button_eyedropper.js @@ -23,7 +23,7 @@ add_task(async function () { gBrowser.removeCurrentTab(); }); -async function testButton(toolbox, Telemetry) { +async function testButton(toolbox) { info("Calling the eyedropper button's callback"); // We call the button callback directly because we don't need to test the UI here, we're // only concerned about testing the telemetry probe. diff --git a/devtools/client/shared/test/browser_treeWidget_basic.js b/devtools/client/shared/test/browser_treeWidget_basic.js index 48702b9b8dd8..bc52a07c8e55 100644 --- a/devtools/client/shared/test/browser_treeWidget_basic.js +++ b/devtools/client/shared/test/browser_treeWidget_basic.js @@ -34,7 +34,7 @@ add_task(async function () { gBrowser.removeCurrentTab(); }); -function populateTree(tree, doc) { +function populateTree(tree) { tree.add([ { id: "level1", @@ -179,7 +179,7 @@ function testTreeItemInsertedCorrectly(tree, doc) { /** * Populate the unsorted tree. */ -function populateUnsortedTree(tree, doc) { +function populateUnsortedTree(tree) { tree.sorted = false; tree.add([{ id: "g-1", label: "g-1" }]); @@ -191,7 +191,7 @@ function populateUnsortedTree(tree, doc) { /** * Test if the nodes are inserted correctly in the unsorted tree. */ -function testUnsortedTreeItemInsertedCorrectly(tree, doc) { +function testUnsortedTreeItemInsertedCorrectly(tree) { ok(tree.root.items.has("g-1"), "g-1 top level element exists"); is( diff --git a/devtools/client/shared/test/doc_event-listeners-01.html b/devtools/client/shared/test/doc_event-listeners-01.html index 5a9c2d53b6b6..653676b623e0 100644 --- a/devtools/client/shared/test/doc_event-listeners-01.html +++ b/devtools/client/shared/test/doc_event-listeners-01.html @@ -15,19 +15,19 @@ "use strict"; window.addEventListener("load", function() { - function initialSetup(event) { + function initialSetup() { // eslint-disable-next-line no-debugger debugger; const button = document.querySelector("button"); button.onclick = clickHandler; } - function clickHandler(event) { + function clickHandler() { window.foobar = "clickHandler"; } - function changeHandler(event) { + function changeHandler() { window.foobar = "changeHandler"; } - function keyupHandler(event) { + function keyupHandler() { window.foobar = "keyupHandler"; } diff --git a/devtools/client/shared/test/doc_event-listeners-03.html b/devtools/client/shared/test/doc_event-listeners-03.html index 2660f9f14144..1d45b575e117 100644 --- a/devtools/client/shared/test/doc_event-listeners-03.html +++ b/devtools/client/shared/test/doc_event-listeners-03.html @@ -17,14 +17,14 @@ "use strict"; window.addEventListener("load", function() { - function initialSetup(event) { + function initialSetup() { const button = document.getElementById("initialSetup"); button.removeEventListener("click", initialSetup); // eslint-disable-next-line no-debugger debugger; } - function clicker(event) { + function clicker() { window.foobar = "clicker"; } diff --git a/devtools/client/shared/test/doc_layoutHelpers_getBoxQuads2-c-and-e.html b/devtools/client/shared/test/doc_layoutHelpers_getBoxQuads2-c-and-e.html index 7917c8241154..d31aa30e73a7 100644 --- a/devtools/client/shared/test/doc_layoutHelpers_getBoxQuads2-c-and-e.html +++ b/devtools/client/shared/test/doc_layoutHelpers_getBoxQuads2-c-and-e.html @@ -2,7 +2,7 @@