tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 89c0ffec7c0aabd832b2f925bdd75850ef53646b
parent 96729730be61b6c95fdb20564b42d93200244741
Author: Narcis Beleuzu <nbeleuzu@mozilla.com>
Date:   Fri, 17 Oct 2025 00:18:50 +0300

Revert "Bug 1994217 - Enable ESLint rule jsdoc/no-bad-blocks on the rest of the tree. r=frontend-codestyle-reviewers,Gijs" for causing Documentation opt failure

This reverts commit 987c3ad1309488780e8831a074b28cbdb8377e7b.

This reverts commit 1c5b20a293a72f13f5cca0214f9e5f7520c096f5.

This reverts commit 0a9a458465bab11be728333f99b5aa9b56793c0d.

Diffstat:
Maccessible/tests/browser/caching_granularity/head.js | 2+-
Mbrowser/actors/AboutProtectionsParent.sys.mjs | 21++++++++++-----------
Mbrowser/actors/FormValidationParent.sys.mjs | 2+-
Mbrowser/actors/SearchSERPTelemetryChild.sys.mjs | 3+--
Mbrowser/base/content/browser-siteProtections.js | 4++--
Mbrowser/components/asrouter/modules/ASRouterTargeting.sys.mjs | 9++++++---
Mbrowser/components/asrouter/modules/ASRouterTriggerListeners.sys.mjs | 3+--
Mbrowser/components/enterprisepolicies/helpers/BookmarksPolicies.sys.mjs | 8++++----
Mbrowser/components/extensions/ExtensionControlledPopup.sys.mjs | 17++++++++---------
Mbrowser/components/firefoxview/OpenTabs.sys.mjs | 14+++++++-------
Mbrowser/components/places/tests/browser/browser_forgetthissite.js | 15+++++++--------
Mbrowser/components/protocolhandler/WebProtocolHandlerRegistrar.sys.mjs | 68+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
Mbrowser/components/sessionstore/SessionStore.sys.mjs | 3+--
Mbrowser/components/shell/ShellService.sys.mjs | 18++++++++----------
Mbrowser/components/tabbrowser/SmartTabGrouping.sys.mjs | 4++--
Mbrowser/modules/FaviconLoader.sys.mjs | 6+++---
Mbrowser/modules/URILoadingHelper.sys.mjs | 5++---
Mbrowser/modules/WindowsPreviewPerTab.sys.mjs | 4++--
Mdevtools/client/debugger/src/actions/sources/blackbox.js | 2+-
Mdevtools/client/debugger/src/utils/memoizableAction.js | 2+-
Mdevtools/client/debugger/src/utils/source.js | 3+--
Mdevtools/client/debugger/src/utils/tabs.js | 2+-
Mdevtools/client/debugger/test/mochitest/browser_dbg-tabs-without-urls.js | 2+-
Mdevtools/client/debugger/test/mochitest/shared-head.js | 16++++++++--------
Mdevtools/client/framework/test/head.js | 3+--
Mdevtools/client/framework/toolbox-tabs-order-manager.js | 2+-
Mdevtools/client/fronts/root.js | 4++--
Mdevtools/client/inspector/animation/components/keyframes-graph/ComputedStylePath.js | 2+-
Mdevtools/client/inspector/computed/computed.js | 4++--
Mdevtools/client/inspector/markup/views/markup-container.js | 2+-
Mdevtools/client/inspector/rules/test/browser_rules_edit-size-property-dragging.js | 8++++++--
Mdevtools/client/inspector/rules/views/class-list-previewer.js | 2+-
Mdevtools/client/shared/key-shortcuts.js | 4++--
Mdevtools/client/shared/stylesheet-utils.js | 2+-
Mdevtools/client/shared/test/shared-head.js | 4++--
Mdevtools/client/shared/widgets/tooltip/ImageTooltipHelper.js | 2+-
Mdevtools/client/styleeditor/test/browser_styleeditor_media_sidebar_links.js | 6++----
Mdevtools/client/webconsole/browser-console.js | 2+-
Mdevtools/client/webconsole/webconsole.js | 2+-
Mdevtools/server/actors/source.js | 2+-
Mdevtools/server/actors/watcher.js | 2+-
Mdevtools/server/actors/webbrowser.js | 2+-
Mdevtools/server/actors/webconsole/commands/manager.js | 4++--
Mdevtools/server/devtools-server-connection.js | 2+-
Mdevtools/shared/commands/network/network-command.js | 2+-
Mdevtools/shared/layout/utils.js | 2+-
Mdevtools/shared/loader/browser-loader.sys.mjs | 2+-
Mdevtools/shared/protocol/Front.js | 2+-
Mdocshell/test/navigation/test_load_history_entry.html | 30++++++++++++++----------------
Mdom/animation/test/testcommon.js | 2+-
Mdom/media/webrtc/tests/mochitests/parser_rtp.js | 2+-
Mdom/push/PushDB.sys.mjs | 4++--
Mdom/smil/test/smilTestUtils.js | 8++++----
Meslint-rollouts.config.mjs | 14+-------------
Mlayout/style/test/test_flexbox_child_display_values.xhtml | 4++--
Mremote/shared/NavigableManager.sys.mjs | 3+--
Mremote/shared/messagehandler/MessageHandlerRegistry.sys.mjs | 6+++---
Mremote/shared/messagehandler/ModuleCache.sys.mjs | 2+-
Mservices/common/hawkclient.sys.mjs | 9++++-----
Mservices/fxaccounts/FxAccounts.sys.mjs | 9+++------
Mservices/fxaccounts/FxAccountsOAuth.sys.mjs | 7+++----
Mservices/sync/modules/bridged_engine.sys.mjs | 2+-
Mservices/sync/modules/engines.sys.mjs | 2+-
Mtesting/mochitest/tests/SimpleTest/EventUtils.js | 4++--
Mtesting/mochitest/tests/SimpleTest/SimpleTest.js | 2+-
Mtoolkit/actors/ContentMetaChild.sys.mjs | 4++--
Mtoolkit/components/aboutmemory/content/aboutMemory.js | 2+-
Mtoolkit/components/doh/TRRPerformance.sys.mjs | 13+++++--------
Mtoolkit/components/downloads/DownloadCore.sys.mjs | 4++--
Mtoolkit/components/extensions/ExtensionCommon.sys.mjs | 4++--
Mtoolkit/components/formautofill/FormAutofillParent.sys.mjs | 4++--
Mtoolkit/components/formautofill/default/FormAutofillPrompter.sys.mjs | 2+-
Mtoolkit/components/formautofill/shared/FormAutofillSection.sys.mjs | 11+++++++----
Mtoolkit/components/nimbus/test/unit/test_ExperimentManager_prefs.js | 2+-
Mtoolkit/components/passwordmgr/test/mochitest/pwmgr_common.js | 16++++++----------
Mtoolkit/components/places/TaggingService.sys.mjs | 14+++++---------
Mtoolkit/components/places/tests/PlacesTestUtils.sys.mjs | 15+++++++--------
Mtoolkit/components/places/tests/unit/test_bookmarks_html_corrupt.js | 6++++--
Mtoolkit/components/search/SearchSettings.sys.mjs | 41+++++++++++++++++------------------------
Mtoolkit/components/telemetry/dap/DAPTelemetrySender.sys.mjs | 2+-
Mtoolkit/components/telemetry/pings/TelemetrySession.sys.mjs | 3+--
Mtoolkit/content/aboutTelemetry.js | 2+-
Mtoolkit/content/customElements.js | 4++--
Mtoolkit/crashreporter/test/unit/head_crashreporter.js | 4++--
Mtoolkit/modules/NewTabUtils.sys.mjs | 2+-
Mtoolkit/modules/subprocess/subprocess_unix.worker.js | 4++--
Mtoolkit/modules/tests/xpcshell/test_GMPInstallManager.js | 6+++---
Mtoolkit/mozapps/downloads/HelperAppDlg.sys.mjs | 10+++++-----
Mtoolkit/mozapps/extensions/internal/AddonRepository.sys.mjs | 8++++----
Mtoolkit/mozapps/extensions/internal/XPIInstall.sys.mjs | 8++++----
Mtoolkit/mozapps/extensions/internal/XPIProvider.sys.mjs | 2+-
Mtoolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_cache.js | 6+++---
Mtoolkit/mozapps/extensions/test/xpcshell/test_XPIStates.js | 2+-
Mtoolkit/mozapps/update/UpdateService.sys.mjs | 2+-
Mtoolkit/mozapps/update/tests/browser/head.js | 2+-
Mtools/lint/eslint/eslint-plugin-mozilla/lib/configs/require-jsdoc.mjs | 9+++++++++
Mtools/lint/eslint/eslint-plugin-mozilla/lib/configs/valid-jsdoc.mjs | 10+++++++++-
97 files changed, 335 insertions(+), 301 deletions(-)

diff --git a/accessible/tests/browser/caching_granularity/head.js b/accessible/tests/browser/caching_granularity/head.js @@ -56,7 +56,7 @@ function verifyAttributeCachedNoRetry(accessible, attribute) { } } -/** +/* * @callback QueryCallback A function taking no arguments that queries an * attribute that may be cached, e.g., bounds, state */ diff --git a/browser/actors/AboutProtectionsParent.sys.mjs b/browser/actors/AboutProtectionsParent.sys.mjs @@ -161,7 +161,10 @@ export class AboutProtectionsParent extends JSWindowActorParent { /** * Retrieves login data for the user. * - * @return {{numLogins: number, potentiallyBreachedLogins: number, mobileDeviceConnected: boolean }} + * @return {{ + * numLogins: Number, + * potentiallyBreachedLogins: Number, + * mobileDeviceConnected: Boolean }} */ async getLoginData() { if (gTestOverride && "getLoginData" in gTestOverride) { @@ -209,18 +212,14 @@ export class AboutProtectionsParent extends JSWindowActorParent { } /** - * @typedef {object} ProtectionsMonitorData - * @property {number} monitoredEmails - * @property {number} numBreaches - * @property {number} passwords - * @property {?string} userEmail - * @property {boolean} error - */ - - /** * Retrieves monitor data for the user. * - * @return {ProtectionsMonitorData} + * @return {{ monitoredEmails: Number, + * numBreaches: Number, + * passwords: Number, + * userEmail: String|null, + * error: Boolean }} + * Monitor data. */ async getMonitorData() { if (gTestOverride && "getMonitorData" in gTestOverride) { diff --git a/browser/actors/FormValidationParent.sys.mjs b/browser/actors/FormValidationParent.sys.mjs @@ -139,7 +139,7 @@ export class FormValidationParent extends JSWindowActorParent { this._panel = null; } - /** + /* * Shows the form validation popup at a specified position or updates the * messaging and position if the popup is already displayed. * diff --git a/browser/actors/SearchSERPTelemetryChild.sys.mjs b/browser/actors/SearchSERPTelemetryChild.sys.mjs @@ -1285,8 +1285,7 @@ class DomainExtractor { } } - /** - * Given a list of elements, examine the text content for each element, which + /* Given a list of elements, examine the text content for each element, which * may be 1) a URL from which we can extract a domain or 2) text we can fix * up to create a best guess as to a URL. If either condition is met, we add * the domain to the result set. diff --git a/browser/base/content/browser-siteProtections.js b/browser/base/content/browser-siteProtections.js @@ -215,7 +215,7 @@ class ProtectionCategory { }; } - /** + /* * Return the number items blocked by this blocker. * @returns {Integer} count - The number of items blocked. */ @@ -1360,7 +1360,7 @@ let cookieBannerHandling = new (class { ); } - /** + /* * @returns {string} - Base domain (eTLD + 1) used for clearing site data. */ get #currentBaseDomain() { diff --git a/browser/components/asrouter/modules/ASRouterTargeting.sys.mjs b/browser/components/asrouter/modules/ASRouterTargeting.sys.mjs @@ -524,7 +524,11 @@ export function getSortedMessages(messages, options = {}) { * its type (web extenstion or custom url) and the parsed url(s) * * @param {string} url - A URL string for home page or newtab page - * @returns {{isWebExt: boolean, isCustomUrl: boolean, urls: {url: string, host: string}[]}} + * @returns {Object} { + * isWebExt: boolean, + * isCustomUrl: boolean, + * urls: Array<{url: string, host: string}> + * } */ function parseAboutPageURL(url) { let ret = { @@ -1110,8 +1114,7 @@ const TargetingGetters = { .getCharPref("distribution.id", ""); }, - /** - * Where the Firefox View button is shown, if at all. + /** Where the Firefox View button is shown, if at all. * @return {string} container of the button if it is shown in the toolbar/overflow menu * @return {string} `null` if the button has been removed */ diff --git a/browser/components/asrouter/modules/ASRouterTriggerListeners.sys.mjs b/browser/components/asrouter/modules/ASRouterTriggerListeners.sys.mjs @@ -319,8 +319,7 @@ export const ASRouterTriggerListeners = new Map([ } }, - /** - * _updateVisits - Record visit timestamps for websites that match `this._hosts` and only + /* _updateVisits - Record visit timestamps for websites that match `this._hosts` and only * if it's been more than FEW_MINUTES since the last visit. * @param {string} host - Location host of current selected tab * @returns {boolean} - If the new visit has been recorded diff --git a/browser/components/enterprisepolicies/helpers/BookmarksPolicies.sys.mjs b/browser/components/enterprisepolicies/helpers/BookmarksPolicies.sys.mjs @@ -64,10 +64,10 @@ export const BookmarksPolicies = { BOOKMARK_GUID_PREFIX: "PolB-", FOLDER_GUID_PREFIX: "PolF-", - /** + /* * Process the bookmarks specified by the policy engine. * - * @param {object[]} param + * @param param * This will be an array of bookmarks objects, as * described on the top of this file. */ @@ -88,13 +88,13 @@ export const BookmarksPolicies = { }, }; -/** +/* * This function calculates the differences between the existing bookmarks * that are managed by the policy engine (which are known through a guid * prefix) and the specified bookmarks in the policy file. * They can differ if the policy file has changed. * - * @param {object[]} specifiedBookmarks + * @param specifiedBookmarks * This will be an array of bookmarks objects, as * described on the top of this file. */ diff --git a/browser/components/extensions/ExtensionControlledPopup.sys.mjs b/browser/components/extensions/ExtensionControlledPopup.sys.mjs @@ -2,8 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/** - * @file +/* + * @fileOverview * This module exports a class that can be used to handle displaying a popup * doorhanger with a primary action to not show a popup for this extension again * and a secondary action disables the addon, or brings the user to their settings. @@ -46,8 +46,7 @@ ChromeUtils.defineLazyGetter(lazy, "distributionAddonsList", function () { }); export class ExtensionControlledPopup { - /** - * Provide necessary options for the popup. + /* Provide necessary options for the popup. * * @param {object} opts Options for configuring popup. * @param {string} opts.confirmedType @@ -79,20 +78,20 @@ export class ExtensionControlledPopup { * @param {string} opts.learnMoreLink * The name of the SUMO page to link to, this is added to * app.support.baseURL. - * @param {string} [opts.preferencesLocation] + * @param optional {string} opts.preferencesLocation * If included, the name of the preferences tab that will be opened * by the secondary action. If not included, the secondary option will * disable the addon. - * @param {string} [opts.preferencesEntrypoint] + * @param optional {string} opts.preferencesEntrypoint * The entrypoint to pass to preferences telemetry. - * @param {Function} opts.onObserverAdded + * @param {function} opts.onObserverAdded * A callback that is triggered when an observer is registered to * trigger the popup on the next observerTopic. - * @param {Function} opts.onObserverRemoved + * @param {function} opts.onObserverRemoved * A callback that is triggered when the observer is removed, * either because the popup is opening or it was explicitly * cancelled by calling removeObserver. - * @param {Function} opts.beforeDisableAddon + * @param {function} opts.beforeDisableAddon * A function that is called before disabling an extension when the * user decides to disable the extension. If this function is async * then the extension won't be disabled until it is fulfilled. diff --git a/browser/components/firefoxview/OpenTabs.sys.mjs b/browser/components/firefoxview/OpenTabs.sys.mjs @@ -170,11 +170,11 @@ class OpenTabsTarget extends EventTarget { ); } - /** + /* * @param {string} type * Either "TabChange" or "TabRecencyChange" - * @param {object | Function} listener - * @param {object} [options] + * @param {Object|Function} listener + * @param {Object} [options] */ addEventListener(type, listener, options) { let hadListeners = this.haveAnyListeners; @@ -186,10 +186,10 @@ class OpenTabsTarget extends EventTarget { } } - /** + /* * @param {string} type * Either "TabChange" or "TabRecencyChange" - * @param {object | Function} listener + * @param {Object|Function} listener */ removeEventListener(type, listener) { let hadListeners = this.haveAnyListeners; @@ -340,7 +340,7 @@ class OpenTabsTarget extends EventTarget { } } - /** + /* * @param {Window} win * @param {boolean} sortByRecency * @returns {Array<Tab>} @@ -363,7 +363,7 @@ class OpenTabsTarget extends EventTarget { return this.currentWindows.flatMap(win => this.getTabsForWindow(win)); } - /** + /* * @returns {Array<Tab>} * A by-recency-sorted, aggregated list of tabs from all the same-privateness browser windows. */ diff --git a/browser/components/places/tests/browser/browser_forgetthissite.js b/browser/components/places/tests/browser/browser_forgetthissite.js @@ -189,10 +189,10 @@ async function testForgetAboutThisSite( await teardown(organizer); } -/** - * Opens the history view in the Library window - * - * @returns {Promise<PlacesOrganizer>} +/* + * Opens the history view in the PlacesOrganziner window + * @returns {Promise} + * @resolves The PlacesOrganizer */ async function promiseHistoryView() { let organizer = await promiseLibrary(); @@ -209,10 +209,9 @@ async function promiseHistoryView() { return organizer; } -/** - * @param {XULElement} popup - * @returns {Promise<void>} - * Resolves once the popup is shown +/* + * @returns {Promise} + * @resolves once the popup is shown */ function promisePopupShown(popup) { return new Promise(resolve => { diff --git a/browser/components/protocolhandler/WebProtocolHandlerRegistrar.sys.mjs b/browser/components/protocolhandler/WebProtocolHandlerRegistrar.sys.mjs @@ -90,12 +90,12 @@ WebProtocolHandlerRegistrar.prototype = { } }, - /** - * This function can be called multiple times and (re-)initializes the cache + /* This function can be called multiple times and (re-)initializes the cache * if the feature is toggled on. If called with the feature off it will also * unregister the observers. * * @param {boolean} firstInit + * */ init(firstInit = false) { if (firstInit) { @@ -285,8 +285,7 @@ WebProtocolHandlerRegistrar.prototype = { return xreDirProvider.getInstallHash(); }, - /** - * Private method to check if we are already the default protocolhandler + /* Private method to check if we are already the default protocolhandler * for `protocol`. * * @param {string} protocol name, e.g. mailto (without ://) @@ -416,6 +415,65 @@ WebProtocolHandlerRegistrar.prototype = { return handler; }, + /* + * Function to store a value associated to a domain using the content pref + * service. + * + * @param {string} domain: the domain for this setting + * @param {string} setting: the name of the setting + * @param {string} value: the actual setting to be stored + * @param {string} context (optional): private window or not + * @returns {string} the stored preference (see: nsIContentPrefService2.idl) + */ + async _saveSiteSpecificSetting(domain, setting, value, context = null) { + const gContentPrefs = Cc["@mozilla.org/content-pref/service;1"].getService( + Ci.nsIContentPrefService2 + ); + + return new Promise((resolve, reject) => { + gContentPrefs.set(domain, setting, value, context, { + handleResult(pref) { + resolve(pref); + }, + handleCompletion() {}, + handleError(err) { + reject(err); + }, + }); + }); + }, + + /* + * Function to return a stored value from the content pref service. Returns + * a promise, so await can be used to synchonize the retrieval. + * + * @param {string} domain: the domain for this setting + * @param {string} setting: the name of the setting + * @param {string} context (optional): private window or not + * @param {string} def (optional): the default value to return + * @returns {string} either stored value or "" + */ + async _getSiteSpecificSetting(domain, setting, context = null, def = null) { + const gContentPrefs = Cc["@mozilla.org/content-pref/service;1"].getService( + Ci.nsIContentPrefService2 + ); + + return await new Promise((resolve, reject) => { + gContentPrefs.getByDomainAndName(domain, setting, context, { + _result: def, + handleResult(pref) { + this._result = pref.value; + }, + handleCompletion(_) { + resolve(this._result); + }, + handleError(err) { + reject(err); + }, + }); + }); + }, + /** * See nsIWebProtocolHandlerRegistrar */ @@ -522,7 +580,7 @@ WebProtocolHandlerRegistrar.prototype = { ); }, - /** + /* * Special implementation for mailto: A prompt (notificationbox.js) is only * shown if there is a realistic chance that we can really set the OS default, * e.g. if we have been properly installed and the current page is not already diff --git a/browser/components/sessionstore/SessionStore.sys.mjs b/browser/components/sessionstore/SessionStore.sys.mjs @@ -5691,8 +5691,7 @@ var SessionStoreInternal = { return Promise.all(windowOpenedPromises); }, - /** - * Reset closedId's from previous sessions to ensure these IDs are unique + /** reset closedId's from previous sessions to ensure these IDs are unique * @param tabData * an array of data to be restored * @param {String} windowId diff --git a/browser/components/shell/ShellService.sys.mjs b/browser/components/shell/ShellService.sys.mjs @@ -134,13 +134,13 @@ let ShellServiceInternal = { return false; }, - /** + /* * Check if UserChoice is impossible. * * Separated for easy stubbing in tests. * - * @returns {string} - * Telemetry result like "Err*", or null if UserChoice is possible. + * @return string telemetry result like "Err*", or null if UserChoice + * is possible. */ _userChoiceImpossibleTelemetryResult() { let winShellService = this.shellService.QueryInterface( @@ -155,11 +155,10 @@ let ShellServiceInternal = { return null; }, - /** + /* * Accommodate `setDefaultPDFHandlerOnlyReplaceBrowsers` feature. - * - * @returns {boolean} - * True if Firefox should set itself as default PDF handler, false otherwise. + * @return true if Firefox should set itself as default PDF handler, false + * otherwise. */ _shouldSetDefaultPDFHandler() { if ( @@ -248,15 +247,14 @@ let ShellServiceInternal = { }; }, - /** + /* * Set the default browser through the UserChoice registry keys on Windows. * * NOTE: This does NOT open the System Settings app for manual selection * in case of failure. If that is desired, catch the exception and call * setDefaultBrowser(). * - * @returns {Promise<void>} - * Resolves when successful, rejects with Error on failure. + * @return Promise, resolves when successful, rejects with Error on failure. */ async setAsDefaultUserChoice() { if (AppConstants.platform != "win") { diff --git a/browser/components/tabbrowser/SmartTabGrouping.sys.mjs b/browser/components/tabbrowser/SmartTabGrouping.sys.mjs @@ -350,7 +350,7 @@ export class SmartTabGroupingManager { .filter(i => !excludedTabIndices.includes(i)); } - /** + /* * Generates similar tabs a grouped list of tabs * @param {array} allTabs all tabs that are part of the window * @param {array} groupedIndices indices of tabs that are already part of the group @@ -990,7 +990,7 @@ export class SmartTabGroupingManager { }); } - /** + /*** * Utility function that loads all required engines for Smart Tab Grouping and any dependent models * @param {(progress: { percentage: number }) => void} progressCallback callback function to call. * Callback passes a dict with percentage indicating best effort 0.0-100.0 progress in model download. diff --git a/browser/modules/FaviconLoader.sys.mjs b/browser/modules/FaviconLoader.sys.mjs @@ -339,7 +339,7 @@ class FaviconLoad { } } -/** +/* * Extract the icon width from the size attribute. It also sends the telemetry * about the size type and size dimension info. * @@ -382,7 +382,7 @@ function extractIconSize(aSizes) { return width; } -/** +/* * Get link icon URI from a link dom node. * * @param {DOMNode} aLink A link dom node. @@ -423,7 +423,7 @@ function guessType(icon) { return icon.type == "image/vnd.microsoft.icon" ? TYPE_ICO : icon.type || ""; } -/** +/* * Selects the best rich icon and tab icon from a list of IconInfo objects. * * @param {Array} iconInfos A list of IconInfo objects. diff --git a/browser/modules/URILoadingHelper.sys.mjs b/browser/modules/URILoadingHelper.sys.mjs @@ -345,8 +345,7 @@ function _createNullPrincipalFromTabUserContextId(tab = null) { } export const URILoadingHelper = { - /** - * openLinkIn opens a URL in a place specified by the parameter |where|. + /* openLinkIn opens a URL in a place specified by the parameter |where|. * * The params object is the same as for `openLinkIn` and documented below. * @@ -667,7 +666,7 @@ export const URILoadingHelper = { targetBrowser.focus(); } }, - /** + /* * Resolve the initial browser window to use for a load, based on `where`. * * @param {string} where diff --git a/browser/modules/WindowsPreviewPerTab.sys.mjs b/browser/modules/WindowsPreviewPerTab.sys.mjs @@ -133,7 +133,7 @@ function getFaviconAsImage(iconurl, privateMode, callback) { // PreviewController -/** +/* * This class manages the behavior of thumbnails and previews. It has the following * responsibilities: * 1) responding to requests from Windows taskbar for a thumbnail or window @@ -349,7 +349,7 @@ PreviewController.prototype = { // TabWindow -/** +/* * This class monitors a browser window for changes to its tabs * * @param win diff --git a/devtools/client/debugger/src/actions/sources/blackbox.js b/devtools/client/debugger/src/actions/sources/blackbox.js @@ -168,7 +168,7 @@ async function toggleBreakpointsInBlackboxedSources({ } } -/** +/* * Blackboxes a group of sources together * * @param {Array} sourcesToBlackBox - The list of sources to blackbox diff --git a/devtools/client/debugger/src/utils/memoizableAction.js b/devtools/client/debugger/src/utils/memoizableAction.js @@ -5,7 +5,7 @@ import { asSettled } from "./async-value"; import { validateContext } from "./context"; -/** +/* * memoizableActon is a utility for actions that should only be performed * once per key. It is useful for loading sources * diff --git a/devtools/client/debugger/src/utils/source.js b/devtools/client/debugger/src/utils/source.js @@ -219,8 +219,7 @@ export function getTruncatedFileName(source) { return truncateMiddleText(source.longName, 30); } -/** - * Gets path for files with same filename for editor tabs, breakpoints, etc. +/* Gets path for files with same filename for editor tabs, breakpoints, etc. * Pass the source, and list of other sources * * @memberof utils/source diff --git a/devtools/client/debugger/src/utils/tabs.js b/devtools/client/debugger/src/utils/tabs.js @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ -/** +/* * Finds the hidden tabs by comparing the tabs' top offset. * hidden tabs will have a great top offset. * diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-tabs-without-urls.js b/devtools/client/debugger/test/mochitest/browser_dbg-tabs-without-urls.js @@ -35,7 +35,7 @@ add_task(async function () { is(countTabs(dbg), 1, "The eval source tab is no longer available"); }); -/** +/* * Get the tab content for the specific tab * * @param {Number} index - index of the tab to get the source content diff --git a/devtools/client/debugger/test/mochitest/shared-head.js b/devtools/client/debugger/test/mochitest/shared-head.js @@ -857,7 +857,7 @@ function waitForLoadedSource(dbg, url) { ); } -/** +/* * Selects the source node for a specific source * from the source tree. * @@ -896,7 +896,7 @@ async function selectSourceFromSourceTreeWithIndex( ); } -/** +/* * Trigger a context menu in the debugger source tree * * @param {Object} dbg @@ -1548,7 +1548,7 @@ function type(dbg, string) { string.split("").forEach(char => EventUtils.synthesizeKey(char, {}, dbg.win)); } -/** +/* * Checks to see if the inner element is visible inside the editor. * * @memberof mochitest/helpers @@ -1562,7 +1562,7 @@ function isVisibleInEditor(dbg, element) { return isVisible(findElement(dbg, "codeMirror"), element); } -/** +/* * Checks to see if the inner element is visible inside the * outer element. * @@ -1739,7 +1739,7 @@ function assertTextContentOnLine(dbg, line, expectedTextContent) { is(textContent, expectedTextContent, `Expected text content on line ${line}`); } -/** +/* * Assert that no breakpoint is set on a given line of * the currently selected source in the editor. * @@ -1755,7 +1755,7 @@ async function assertNoBreakpoint(dbg, line) { ok(!exists, `Breakpoint doesn't exists on line ${line}`); } -/** +/* * Assert that a regular breakpoint is set in the currently * selected source in the editor. (no conditional, nor log breakpoint) * @@ -1781,7 +1781,7 @@ async function assertBreakpoint(dbg, line) { ok(!hasLogClass, `Regular breakpoint doesn't have log on line ${line}`); } -/** +/* * Assert that a conditionnal breakpoint is set. * * @memberof mochitest/helpers @@ -1807,7 +1807,7 @@ async function assertConditionBreakpoint(dbg, line) { ); } -/** +/* * Assert that a log breakpoint is set. * * @memberof mochitest/helpers diff --git a/devtools/client/framework/test/head.js b/devtools/client/framework/test/head.js @@ -85,8 +85,7 @@ function synthesizeKeyElement(el) { EventUtils.synthesizeKey(key, mod, el.ownerDocument.defaultView); } -/** - * Check the toolbox host type and prefs to make sure they match the +/* Check the toolbox host type and prefs to make sure they match the * expected values * @param {Toolbox} * @param {HostType} hostType diff --git a/devtools/client/framework/toolbox-tabs-order-manager.js b/devtools/client/framework/toolbox-tabs-order-manager.js @@ -224,7 +224,7 @@ function sortPanelDefinitions(definitions) { }); } -/** +/* * This function returns absolute tab ids that were merged the both ids that are in * preference and tabs. * Some tabs added with add-ons etc show/hide depending on conditions. diff --git a/devtools/client/fronts/root.js b/devtools/client/fronts/root.js @@ -299,7 +299,7 @@ class RootFront extends FrontClassWithSpec(rootSpec) { return this.request(packet); } - /** + /* * This function returns a protocol.js Front for any root actor. * i.e. the one directly served from RootActor.listTabs or getRoot. * @@ -317,7 +317,7 @@ class RootFront extends FrontClassWithSpec(rootSpec) { return front; } - /** + /* * This function returns true if the root actor has a registered global actor * with a given name. * @param {String} actorName diff --git a/devtools/client/inspector/animation/components/keyframes-graph/ComputedStylePath.js b/devtools/client/inspector/animation/components/keyframes-graph/ComputedStylePath.js @@ -17,7 +17,7 @@ const { toPathString, } = require("resource://devtools/client/inspector/animation/utils/graph-helper.js"); -/** +/* * This class is an abstraction for computed style path of keyframes. * Subclass of this should implement the following methods: * diff --git a/devtools/client/inspector/computed/computed.js b/devtools/client/inspector/computed/computed.js @@ -989,7 +989,7 @@ class CssComputedView { } class PropertyInfo { - /** + /* * @param {CssComputedView} tree * The CssComputedView instance we are working with. * @param {String} name @@ -1023,7 +1023,7 @@ class PropertyInfo { * A container to give easy access to property data from the template engine. */ class PropertyView { - /** + /* * @param {CssComputedView} tree * The CssComputedView instance we are working with. * @param {String} name diff --git a/devtools/client/inspector/markup/views/markup-container.js b/devtools/client/inspector/markup/views/markup-container.js @@ -48,7 +48,7 @@ MarkupContainer.prototype = { return this.markup.undo; }, - /** + /* * Initialize the MarkupContainer. Should be called while one * of the other contain classes is instantiated. * 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 @@ -297,8 +297,12 @@ async function testDraggingClassIsAddedOnValueUpdate(view) { /** * Runs each test and check whether or not the property is draggable * - * @param {CSSRuleView} view - * @param {{name: string, value: string, shouldBeDraggable: boolean}[]} tests + * @param {CSSRuleView} view + * @param {Array.<{ + * name: String, + * value: String, + * shouldBeDraggable: Boolean, + * }>} tests */ function runIsDraggableTest(view, tests) { for (const test of tests) { diff --git a/devtools/client/inspector/rules/views/class-list-previewer.js b/devtools/client/inspector/rules/views/class-list-previewer.js @@ -18,7 +18,7 @@ const { debounce } = require("resource://devtools/shared/debounce.js"); * used to toggle classes on the current node selection, and add new classes. */ class ClassListPreviewer { - /** + /* * @param {Inspector} inspector * The current inspector instance. * @param {DomNode} containerEl diff --git a/devtools/client/shared/key-shortcuts.js b/devtools/client/shared/key-shortcuts.js @@ -81,7 +81,7 @@ function KeyShortcuts({ window, target }) { this.target.addEventListener("keydown", this); } -/** +/* * Parse an electron-like key string and return a normalized object which * allow efficient match on DOM key event. The normalized object matches DOM * API. @@ -195,7 +195,7 @@ KeyShortcuts.stringifyShortcut = function (shortcut) { return list.join("+"); }; -/** +/* * Converts an Electron accelerator string into * a pretty Unicode-based hotkey string * diff --git a/devtools/client/shared/stylesheet-utils.js b/devtools/client/shared/stylesheet-utils.js @@ -11,7 +11,7 @@ function stylesheetLoadPromise(styleSheet) { }); } -/** +/* * Put the DevTools theme stylesheet into the provided chrome document. * * @param {Document} doc diff --git a/devtools/client/shared/test/shared-head.js b/devtools/client/shared/test/shared-head.js @@ -1523,7 +1523,7 @@ function createTestHTTPServer() { return server; } -/** +/* * Register an actor in the content process of the current tab. * * Calling ActorRegistry.registerModule only registers the actor in the current process. @@ -2533,7 +2533,7 @@ function getNetmonitorContextMenuItem(monitor, id) { return Menu.getMenuElementById(id, monitor.panelWin.document); } -/** +/* * Selects and clicks the context menu item of the netmonitor, it should * also wait for the popup to close. * @param {Object} monitor diff --git a/devtools/client/shared/widgets/tooltip/ImageTooltipHelper.js b/devtools/client/shared/widgets/tooltip/ImageTooltipHelper.js @@ -123,7 +123,7 @@ function setImageTooltip(tooltip, doc, imageUrl, options) { tooltip.setContentSize({ width, height }); } -/** +/* * Set the tooltip content of a provided HTMLTooltip instance to display a * fallback error message when an image preview tooltip can not be displayed. * diff --git a/devtools/client/styleeditor/test/browser_styleeditor_media_sidebar_links.js b/devtools/client/styleeditor/test/browser_styleeditor_media_sidebar_links.js @@ -3,10 +3,8 @@ "use strict"; -/** - * Tests responsive mode links for `@media` sidebar width and height related - * conditions. - */ +/* Tests responsive mode links for + * @media sidebar width and height related conditions */ loader.lazyRequireGetter( this, diff --git a/devtools/client/webconsole/browser-console.js b/devtools/client/webconsole/browser-console.js @@ -35,7 +35,7 @@ class BrowserConsole extends WebConsole { #bcInitializer = null; #bcDestroyer = null; #telemetry; - /** + /* * @constructor * @param object commands * The commands object with all interfaces defined from devtools/shared/commands/ diff --git a/devtools/client/webconsole/webconsole.js b/devtools/client/webconsole/webconsole.js @@ -49,7 +49,7 @@ const isMacOS = Services.appinfo.OS === "Darwin"; * UI and features. */ class WebConsole { - /** + /* * @constructor * @param object toolbox * The toolbox where the web console is displayed. diff --git a/devtools/server/actors/source.js b/devtools/server/actors/source.js @@ -611,7 +611,7 @@ class SourceActor extends Actor { this.pausePoints = uncompressed; } - /** + /* * Ensure the given BreakpointActor is set as a breakpoint handler on all * scripts that match its location in the generated source. * diff --git a/devtools/server/actors/watcher.js b/devtools/server/actors/watcher.js @@ -218,7 +218,7 @@ exports.WatcherActor = class WatcherActor extends Actor { super.destroy(); } - /** + /* * Get the list of the currently watched resources for this watcher. * * @return Array<String> diff --git a/devtools/server/actors/webbrowser.js b/devtools/server/actors/webbrowser.js @@ -469,7 +469,7 @@ BrowserTabList.prototype._checkListening = function () { ); }; -/** +/* * Add or remove event listeners for all XUL windows. * * @param shouldListen boolean diff --git a/devtools/server/actors/webconsole/commands/manager.js b/devtools/server/actors/webconsole/commands/manager.js @@ -890,7 +890,7 @@ WebConsoleCommandsManager.register({ validArguments: ["url"], }); -/** +/* * Unblock a blocked a resource * * @param object filter @@ -920,7 +920,7 @@ WebConsoleCommandsManager.register({ validArguments: ["url"], }); -/** +/* * Toggle JavaScript tracing * * @param object args diff --git a/devtools/server/devtools-server-connection.js b/devtools/server/devtools-server-connection.js @@ -280,7 +280,7 @@ DevToolsServerConnection.prototype = { /* Forwarding packets to other transports based on actor name prefixes. */ - /** + /* * Arrange to forward packets to another server. This is how we * forward debugging connections to child processes. * diff --git a/devtools/shared/commands/network/network-command.js b/devtools/shared/commands/network/network-command.js @@ -42,7 +42,7 @@ class NetworkCommand { return { channelId }; } - /** + /* * Get the list of blocked URL filters. * * A URL filter is a RegExp string so that one filter can match many URLs. diff --git a/devtools/shared/layout/utils.js b/devtools/shared/layout/utils.js @@ -454,7 +454,7 @@ exports.isTemplateElement = isTemplateElement; const isShadowRoot = node => node.containingShadowRoot == node; exports.isShadowRoot = isShadowRoot; -/** +/* * Gets the shadow root mode (open or closed). * * @param {DOMNode} node diff --git a/devtools/shared/loader/browser-loader.sys.mjs b/devtools/shared/loader/browser-loader.sys.mjs @@ -68,7 +68,7 @@ const REACT_ESM_MODULES = new Set([ const browserBasedDirsRegExp = /^resource\:\/\/devtools\/client\/\S*\/components\//; -/** +/* * Create a loader to be used in a browser environment. This evaluates * modules in their own environment, but sets window (the normal * global object) as the sandbox prototype, so when a variable is not diff --git a/devtools/shared/protocol/Front.js b/devtools/shared/protocol/Front.js @@ -171,7 +171,7 @@ class Front extends Pool { } } - /** + /* * Listen for the creation and/or destruction of fronts matching one of the provided types. * * @param {String} typeName diff --git a/docshell/test/navigation/test_load_history_entry.html b/docshell/test/navigation/test_load_history_entry.html @@ -77,22 +77,20 @@ SimpleTest.finish(); } - /** - * @param {Window} testWin - * @param {object} shistory - * @param {number} expectedNumSHEntries - * @param {?string} prevLocation - * If undefined, it is because there is no page to go back to. - * @param {boolean} [isCrossDocumentLoad] - * Did we just open a different document? - * @param {boolean} [hashChangeExpected] - * Would we get a hash change event if we navigated backwards and forwards in history? - * This is framed with respect to the previous step, e.g. in the previous step was the - * hash different from the location we have navigated to just before calling this function? - * When we navigate forwards or backwards, we need to wait for this event - * because clickLink() also waits for hashchange event and - * if this function gets called before clickLink(), sometimes hashchange - * events from this function will leak to clickLink. + /* + * @prevLocation + * if undefined, it is because there is no page to go back to + * + * @isCrossDocumentLoad + * did we just open a different document + * @hashChangeExpected + * Would we get a hash change event if we navigated backwards and forwards in history? + * This is framed with respect to the previous step, e.g. in the previous step was the + * hash different from the location we have navigated to just before calling this function? + * When we navigate forwards or backwards, we need to wait for this event + * because clickLink() also waits for hashchange event and + * if this function gets called before clickLink(), sometimes hashchange + * events from this function will leak to clickLink. */ async function doAfterEachTest(testWin, shistory, expectedNumSHEntries, prevLocation, isCrossDocumentLoad = false, hashChangeExpected = true) { diff --git a/dom/animation/test/testcommon.js b/dom/animation/test/testcommon.js @@ -427,7 +427,7 @@ function addSVGElement(target, tag, attrs) { return element; } -/** +/* * Get Animation distance between two specified values for a specific property. * * @param target The target element. diff --git a/dom/media/webrtc/tests/mochitests/parser_rtp.js b/dom/media/webrtc/tests/mochitests/parser_rtp.js @@ -4,7 +4,7 @@ "use strict"; -/** +/* * Parses an RTP packet * @param buffer an ArrayBuffer that contains the packet * @return { type: "rtp", header: {...}, payload: a DataView } diff --git a/dom/push/PushDB.sys.mjs b/dom/push/PushDB.sys.mjs @@ -79,7 +79,7 @@ PushDB.prototype = { } }, - /** + /* * @param aRecord * The record to be added. */ @@ -116,7 +116,7 @@ PushDB.prototype = { ); }, - /** + /* * @param aKeyID * The ID of record to be deleted. */ diff --git a/dom/smil/test/smilTestUtils.js b/dom/smil/test/smilTestUtils.js @@ -587,7 +587,7 @@ AnimTestcaseFrom.prototype = { }; extend(AnimTestcaseFrom, AnimTestcase); -/** +/* * A testcase for a simple "from-to" animation * @param aFrom The 'from' value * @param aTo The 'to' value @@ -628,7 +628,7 @@ AnimTestcaseFromTo.prototype = { }; extend(AnimTestcaseFromTo, AnimTestcaseFrom); -/** +/* * A testcase for a simple "from-by" animation. * * @param aFrom The 'from' value @@ -695,7 +695,7 @@ AnimTestcaseFromBy.prototype = { }; extend(AnimTestcaseFromBy, AnimTestcaseFrom); -/** +/* * A testcase for a "paced-mode" animation * @param aValues An array of values, to be used as the "Values" list * @param aComputedValMap A hash-map that contains some computed values, @@ -838,7 +838,7 @@ AnimTestcasePaced.prototype = { }; extend(AnimTestcasePaced, AnimTestcase); -/** +/* * A testcase for an <animateMotion> animation. * * @param aAttrValueHash A hash-map mapping attribute names to values. diff --git a/eslint-rollouts.config.mjs b/eslint-rollouts.config.mjs @@ -304,19 +304,7 @@ export default [ "widget/tests/window_composition_text_querycontent.xhtml", ], ignores: ["devtools/startup/**"], - rules: { - "jsdoc/check-access": "off", - "jsdoc/check-param-names": "off", - "jsdoc/check-property-names": "off", - "jsdoc/check-tag-names": "off", - "jsdoc/check-types": "off", - "jsdoc/empty-tags": "off", - "jsdoc/no-multi-asterisks": "off", - "jsdoc/require-param-type": "off", - "jsdoc/require-returns-type": "off", - "jsdoc/tag-lines": ["off", "any", { startLines: 1 }], - "jsdoc/valid-types": "off", - }, + rules: mozilla.turnOff(mozilla.configs["flat/valid-jsdoc"].rules), }, { name: "rollout-require-jsdoc", diff --git a/layout/style/test/test_flexbox_child_display_values.xhtml b/layout/style/test/test_flexbox_child_display_values.xhtml @@ -28,7 +28,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=783415 * specified display-value.) */ -/** +/* * Utility function for getting computed style of "display". * * @arg aElem The element to query for its computed "display" value. @@ -38,7 +38,7 @@ function getComputedDisplay(aElem) { return window.getComputedStyle(aElem).display; } -/** +/* * Function used for testing a given specified "display" value and checking * its computed value against expectations. * diff --git a/remote/shared/NavigableManager.sys.mjs b/remote/shared/NavigableManager.sys.mjs @@ -71,8 +71,7 @@ class NavigableManagerClass { return null; } - /** - * Retrieve the browsing context corresponding to the provided navigabl id. + /* Retrieve the browsing context corresponding to the provided navigabl id. * * @param {string} id * A browsing context unique id (created by getIdForBrowsingContext). diff --git a/remote/shared/messagehandler/MessageHandlerRegistry.sys.mjs b/remote/shared/messagehandler/MessageHandlerRegistry.sys.mjs @@ -61,10 +61,10 @@ export function getMessageHandlerClass(type) { * after crossing a technical boundary (eg process, thread...). */ export class MessageHandlerRegistry extends EventEmitter { - /** - * @param {string} type + /* + * @param {String} type * MessageHandler type, one of MessageHandler.type. - * @param {object} context + * @param {Object} context * The context object, which depends on the type. */ constructor(type, context) { diff --git a/remote/shared/messagehandler/ModuleCache.sys.mjs b/remote/shared/messagehandler/ModuleCache.sys.mjs @@ -90,7 +90,7 @@ export class ModuleCache { #modules; #protocol; - /** + /* * @param {MessageHandler} messageHandler * The MessageHandler instance which owns this ModuleCache instance. */ diff --git a/services/common/hawkclient.sys.mjs b/services/common/hawkclient.sys.mjs @@ -73,7 +73,7 @@ ChromeUtils.defineLazyGetter(lazy, "logPII", function () { } }); -/** +/* * A general purpose client for making HAWK authenticated requests to a single * host. Keeps track of the clock offset between the client and the host for * computation of the timestamp in the HAWK Authorization header. @@ -93,7 +93,7 @@ export var HawkClient = function (host) { }; HawkClient.prototype = { - /** + /* * Construct an error message for a response. Private. * * @param restResponse @@ -130,7 +130,7 @@ HawkClient.prototype = { return errorObj; }, - /** + /* * * Update clock offset by determining difference from date gives in the (RFC * 1123) Date header of a server response. Because HAWK tolerates a window @@ -175,8 +175,7 @@ HawkClient.prototype = { return Date.now(); }, - /** - * A general method for sending raw RESTRequest calls authorized using HAWK. + /* A general method for sending raw RESTRequest calls authorized using HAWK * * @param path * API endpoint path diff --git a/services/fxaccounts/FxAccounts.sys.mjs b/services/fxaccounts/FxAccounts.sys.mjs @@ -1150,12 +1150,9 @@ FxAccountsInternal.prototype = { return this.startPollEmailStatus(state, data.sessionToken, "push"); }, - /** - * Destroyes an OAuth Token by sending a request to the FxA server - * - * @param {object} tokenData - * The token's data, with `tokenData.token` being the token itself - */ + /** Destroyes an OAuth Token by sending a request to the FxA server + * @param { Object } tokenData: The token's data, with `tokenData.token` being the token itself + **/ destroyOAuthToken(tokenData) { return this.fxAccountsClient.oauthDestroy(OAUTH_CLIENT_ID, tokenData.token); }, diff --git a/services/fxaccounts/FxAccountsOAuth.sys.mjs b/services/fxaccounts/FxAccountsOAuth.sys.mjs @@ -65,7 +65,7 @@ export class FxAccountsOAuth { this.#flow = {}; } - /** + /* * Gets a stored flow * @param { string } state: The base-64 URL-safe state string that was created at the start of the flow * @returns { Object }: The values initially stored when startign th eoauth flow @@ -172,8 +172,7 @@ export class FxAccountsOAuth { return queryParams; } - /** - * Completes an OAuth flow and invalidates any other ongoing flows + /** Completes an OAuth flow and invalidates any other ongoing flows * @param { string } sessionTokenHex: The session token encoded in hexadecimal * @param { string } code: OAuth authorization code provided by running an OAuth flow * @param { string } state: The state first provided by `beginOAuthFlow`, then roundtripped through the server @@ -183,7 +182,7 @@ export class FxAccountsOAuth { * - 'scopedKeys': The encryption keys provided by the server, already decrypted * - 'refreshToken': The refresh token provided by the server * - 'accessToken': The access token provided by the server - */ + * */ async completeOAuthFlow(sessionTokenHex, code, state) { const flow = this.getFlow(state); if (!flow) { diff --git a/services/sync/modules/bridged_engine.sys.mjs b/services/sync/modules/bridged_engine.sys.mjs @@ -108,7 +108,7 @@ class BridgedRecord extends RawCryptoWrapper { return cleartext; } - /** + /* * Converts this incoming record into an envelope to pass to a bridged engine. * This object must be kept in sync with `sync15::IncomingBso`. * diff --git a/services/sync/modules/engines.sys.mjs b/services/sync/modules/engines.sys.mjs @@ -2120,7 +2120,7 @@ SyncEngine.prototype = { return changes; }, - /** + /* * Returns a changeset containing entries for all currently tracked items. * The default implementation returns a changeset with timestamps indicating * when the item was added to the tracker. diff --git a/testing/mochitest/tests/SimpleTest/EventUtils.js b/testing/mochitest/tests/SimpleTest/EventUtils.js @@ -694,7 +694,7 @@ function synthesizeMouse( ); } -/** +/* * Synthesize a mouse event in `aWindow` at a point. * * `nsIDOMWindowUtils.sendMouseEvent` takes floats for the coordinates. @@ -898,7 +898,7 @@ function synthesizeMouseAtPoint( return defaultPrevented; } -/** +/* * Synthesize a mouse event at the center of `aTarget`. * * Note that additional events may be fired as a result of this call. For diff --git a/testing/mochitest/tests/SimpleTest/SimpleTest.js b/testing/mochitest/tests/SimpleTest/SimpleTest.js @@ -1081,7 +1081,7 @@ const kTextHtmlPrefixClipboardDataWindows = const kTextHtmlSuffixClipboardDataWindows = "<!--EndFragment-->\n</body>\n</html>"; -/** +/* * Polls the clipboard waiting for the expected value. A known value different than * the expected value is put on the clipboard first (and also polled for) so we * can be sure the value we get isn't just the expected value because it was already diff --git a/toolkit/actors/ContentMetaChild.sys.mjs b/toolkit/actors/ContentMetaChild.sys.mjs @@ -24,7 +24,7 @@ const PREVIEW_IMAGE_RULES = [ "og:image:secure_url", ]; -/** +/* * Checks if the incoming meta tag has a greater score than the current best * score by checking the index of the meta tag in the list of rules provided. * @@ -42,7 +42,7 @@ function shouldExtractMetadata(aRules, aTag, aEntry) { return aRules.indexOf(aTag) > aEntry.currMaxScore; } -/** +/* * Ensure that the preview image URL is safe and valid before storing * * @param {URL} aURL diff --git a/toolkit/components/aboutmemory/content/aboutMemory.js b/toolkit/components/aboutmemory/content/aboutMemory.js @@ -2276,7 +2276,7 @@ function formatPercentage(aPerc100x) { return formatNum(aPerc100x / 10000, kPercFormatter); } -/** +/* * Converts a tree fraction to an appropriate string representation. * * @param aNum diff --git a/toolkit/components/doh/TRRPerformance.sys.mjs b/toolkit/components/doh/TRRPerformance.sys.mjs @@ -280,17 +280,14 @@ export class TRRRacer { ); } - /** + /* * Given an array of { trr, time }, returns the trr with smallest mean time. * Separate from _getFastestTRR for easy unit-testing. * - * @param {{trr: string[], time: number}[]} results - * @param {boolean} returnRandomDefault - * @returns {string} - * The TRR with the fastest average time. - * If returnRandomDefault is false-y, returns undefined if no valid - * times were present in the results. Otherwise, returns one of the - * present TRRs at random. + * @returns The TRR with the fastest average time. + * If returnRandomDefault is false-y, returns undefined if no valid + * times were present in the results. Otherwise, returns one of the + * present TRRs at random. */ _getFastestTRRFromResults(results, returnRandomDefault = false) { // First, organize the results into a map of TRR -> array of times diff --git a/toolkit/components/downloads/DownloadCore.sys.mjs b/toolkit/components/downloads/DownloadCore.sys.mjs @@ -887,7 +887,7 @@ Download.prototype = { return this._promiseConfirmBlock; }, - /** + /* * Launches the file after download has completed. This can open * the file with the default application for the target MIME type * or file extension, or with a custom application if launcherPath @@ -921,7 +921,7 @@ Download.prototype = { return lazy.DownloadIntegration.launchDownload(this, options); }, - /** + /* * Shows the folder containing the target file, or where the target file * will be saved. This may be called at any time, even if the download * failed or is currently in progress. diff --git a/toolkit/components/extensions/ExtensionCommon.sys.mjs b/toolkit/components/extensions/ExtensionCommon.sys.mjs @@ -2248,7 +2248,7 @@ LocaleData.prototype = { * content process). */ class EventManager { - /** + /* * A persistent event must provide module and name. Additionally the * module must implement primeListeners in the ExtensionAPI class. * @@ -2366,7 +2366,7 @@ class EventManager { this.remove = new Map(); } - /** + /* * Information about listeners to persistent events is associated with * the extension to which they belong. Any extension thas has such * listeners has a property called `persistentListeners` that is a diff --git a/toolkit/components/formautofill/FormAutofillParent.sys.mjs b/toolkit/components/formautofill/FormAutofillParent.sys.mjs @@ -2,12 +2,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/** +/* * Implements a service used to access storage and communicate with content. * * A "fields" array is used to communicate with FormAutofillChild. Each item * represents a single input field in the content page as well as its - * `@autocomplete` properties. The schema is as below. Please refer to + * @autocomplete properties. The schema is as below. Please refer to * FormAutofillChild.js for more details. * * [ diff --git a/toolkit/components/formautofill/default/FormAutofillPrompter.sys.mjs b/toolkit/components/formautofill/default/FormAutofillPrompter.sys.mjs @@ -826,7 +826,7 @@ export class AddressEditDoorhanger extends AutofillDoorhanger { return div; } - /** + /* * This method generates a unique input ID using the field name of the address field. * * @param {string} fieldName The name of the address field diff --git a/toolkit/components/formautofill/shared/FormAutofillSection.sys.mjs b/toolkit/components/formautofill/shared/FormAutofillSection.sys.mjs @@ -83,32 +83,35 @@ export class FormAutofillSection { return this.fieldDetails.map(field => field.fieldName); } - /** + /* * Examine the section is a valid section or not based on its fieldDetails or * other information. This method must be overrided. * * @returns {boolean} True for a valid section, otherwise false + * */ isValidSection() { throw new TypeError("isValidSection method must be overrided"); } - /** + /* * Examine the section is an enabled section type or not based on its * preferences. This method must be overrided. * * @returns {boolean} True for an enabled section type, otherwise false + * */ isEnabled() { throw new TypeError("isEnabled method must be overrided"); } - /** + /* * Examine the section is createable for storing the profile. This method * must be overrided. * - * @param {object} _record The record for examining createable + * @param {Object} _record The record for examining createable * @returns {boolean} True for the record is createable, otherwise false + * */ isRecordCreatable(_record) { throw new TypeError("isRecordCreatable method must be overridden"); diff --git a/toolkit/components/nimbus/test/unit/test_ExperimentManager_prefs.js b/toolkit/components/nimbus/test/unit/test_ExperimentManager_prefs.js @@ -2772,7 +2772,7 @@ async function test_restorePrefs_manifestChanged() { }); } - /** + /* * Test that enrollments end when the manifest is sufficiently changed and * that the appropriate telemetry is submitted. * diff --git a/toolkit/components/passwordmgr/test/mochitest/pwmgr_common.js b/toolkit/components/passwordmgr/test/mochitest/pwmgr_common.js @@ -834,9 +834,8 @@ function runInParent(aFunctionOrURL) { return chromeScript; } -/** - * Manage logins in parent chrome process. - */ +/** Manage logins in parent chrome process. + * */ function manageLoginsInParent() { return runInParent(function addLoginsInParentInner() { /* eslint-env mozilla/chrome-script */ @@ -886,8 +885,7 @@ function manageLoginsInParent() { }); } -/** - * Initialize with a list of logins. The logins are added within the parent chrome process. +/** Initialize with a list of logins. The logins are added within the parent chrome process. * @param {array} aLogins - a list of logins to add. Each login is an array of the arguments * that would be passed to nsLoginInfo.init(). */ @@ -897,8 +895,7 @@ async function addLoginsInParent(...aLogins) { return script; } -/** - * Initialize with a list of logins, after removing all user facing logins. +/** Initialize with a list of logins, after removing all user facing logins. * The logins are added within the parent chrome process. * @param {array} aLogins - a list of logins to add. Each login is an array of the arguments * that would be passed to nsLoginInfo.init(). @@ -945,8 +942,7 @@ async function setStoredLoginsDuringTask(...logins) { }); } -/** - * Returns a promise which resolves to a list of logins +/** Returns a promise which resolves to a list of logins */ function getLogins() { const script = manageLoginsInParent(); @@ -1126,7 +1122,7 @@ function setContentForTask(html) { return content.firstElementChild; } -/** +/* * Set preferences via SpecialPowers.pushPrefEnv and reset them after current * task has finished. * diff --git a/toolkit/components/places/TaggingService.sys.mjs b/toolkit/components/places/TaggingService.sys.mjs @@ -541,17 +541,13 @@ class TagSearch { export function TagAutoCompleteSearch() {} TagAutoCompleteSearch.prototype = { - /** + /* * Search for a given string and notify a listener of the result. * - * @param {string} searchString - * The string to search for. - * @param {string} searchParam - * An extra parameter. - * @param {nsIAutoCompleteResult} previousResult - * A previous result to use for faster searching. - * @param {nsIAutoCompleteObserver} listener - * A listener to notify when the search is complete. + * @param searchString - The string to search for + * @param searchParam - An extra parameter + * @param previousResult - A previous result to use for faster searching + * @param listener - A listener to notify when the search is complete */ startSearch(searchString, searchParam, previousResult, listener) { if (this._search) { diff --git a/toolkit/components/places/tests/PlacesTestUtils.sys.mjs b/toolkit/components/places/tests/PlacesTestUtils.sys.mjs @@ -121,7 +121,7 @@ export var PlacesTestUtils = Object.freeze({ } }, - /** + /* * Add Favicons * * @param {Map} faviconURLs keys are page URLs, values are their @@ -153,17 +153,16 @@ export var PlacesTestUtils = Object.freeze({ await Promise.all(faviconPromises); }, - /** + /* * Helper function to call PlacesUtils.favicons.setFaviconForPage() and waits * finishing setting. This function throws an error if the status of * PlacesUtils.favicons.setFaviconForPage() is not success. * - * @param {string|nsIURI} pageURI - * @param {string|nsIURI} faviconURI - * @param {string|nsIURI} faviconDataURL - * @param {number} [expiration] - * @param {boolean} [isRichIcon] - * @returns {Promise<void>} waits for finishing setting + * @param {string or nsIURI} pageURI + * @param {string or nsIURI} faviconURI + * @param {string or nsIURI} faviconDataURL + * @param {Number} [optional] expiration + * @return {Promise} waits for finishing setting */ setFaviconForPage( pageURI, diff --git a/toolkit/components/places/tests/unit/test_bookmarks_html_corrupt.js b/toolkit/components/places/tests/unit/test_bookmarks_html_corrupt.js @@ -44,10 +44,12 @@ add_task(async function test_corrupt_database() { await database_check(); }); -/** +/* * Check for imported bookmarks correctness * - * @returns {Promise<void>} + * @return {Promise} + * @resolves When the checks are finished. + * @rejects Never. */ var database_check = async function () { // BOOKMARKS MENU diff --git a/toolkit/components/search/SearchSettings.sys.mjs b/toolkit/components/search/SearchSettings.sys.mjs @@ -75,7 +75,7 @@ export class SearchSettings { */ #searchService = null; - /** + /* * The user's settings file read from disk so we can persist metadata for * engines that are default or hidden, the user's locale and region, hashes * for the loadPath, and hashes for default and private default engines. @@ -83,44 +83,37 @@ export class SearchSettings { * to the settings. * * Structure of settings: - * - * ``` - * Object { - * version: <number>, - * engines: [...], - * metaData: {...}, - * } - * ``` + * Object { version: <number>, + * engines: [...], + * metaData: {...}, + * } * * Settings metaData is the active metadata for setting and getting attributes. * When a new metadata attribute is set, we save it to #settings.metaData and * write #settings to disk. * * #settings.metaData attributes: - * * @property {string} current - * The current user-set default engine. The associated hash is called - * 'hash'. + * The current user-set default engine. The associated hash is called + * 'hash'. * @property {string} private - * The current user-set private engine. The associated hash is called - * 'privateHash'. - * The current and prviate objects have associated hash fields to validate - * the value is set by the application. + * The current user-set private engine. The associated hash is called + * 'privateHash'. + * The current and prviate objects have associated hash fields to validate + * the value is set by the application. * @property {string} appDefaultEngine - * The identifier of the current application default engine. * @property {string} channel - * Configuration is restricted to the specified channel. ESR is an example - * of a channel. + * Configuration is restricted to the specified channel. ESR is an example + * of a channel. * @property {string} distroID - * Specifies which distribution the default engine is included in. + * Specifies which distribution the default engine is included in. * @property {string} experiment - * Specifies if the application is running on an experiment. + * Specifies if the application is running on an experiment. * @property {string} locale - * The current locale. * @property {string} region - * The current region. * @property {boolean} useSavedOrder - * True if the user's order information stored in settings is used. + * True if the user's order information stored in settings is used. + * */ #settings = null; diff --git a/toolkit/components/telemetry/dap/DAPTelemetrySender.sys.mjs b/toolkit/components/telemetry/dap/DAPTelemetrySender.sys.mjs @@ -239,7 +239,7 @@ export const DAPTelemetrySender = new (class { } } - /** + /* * @typedef {object} AggregatorKeys * @property {Uint8Array} leader_hpke - The leader's DAP HPKE key. * @property {Uint8Array} helper_hpke - The helper's DAP HPKE key. diff --git a/toolkit/components/telemetry/pings/TelemetrySession.sys.mjs b/toolkit/components/telemetry/pings/TelemetrySession.sys.mjs @@ -1291,8 +1291,7 @@ var Impl = { return promise; }, - /** - * Loads session data from the session data file. + /** Loads session data from the session data file. * @return {Promise<object>} A promise which is resolved with an object when * loading has completed, with null otherwise. */ diff --git a/toolkit/content/aboutTelemetry.js b/toolkit/content/aboutTelemetry.js @@ -1442,7 +1442,7 @@ var Search = { }, }; -/** +/* * Helper function to render JS objects with white space between top level elements * so that they look better in the browser * @param aObject JavaScript object or array to render diff --git a/toolkit/content/customElements.js b/toolkit/content/customElements.js @@ -236,7 +236,7 @@ } } } - /** + /* * A declarative way to wire up attribute inheritance and automatically generate * the `observedAttributes` getter. For example, if you returned: * { @@ -346,7 +346,7 @@ } } - /** + /* * Implements attribute value inheritance by child elements. * * @param {array} list diff --git a/toolkit/crashreporter/test/unit/head_crashreporter.js b/toolkit/crashreporter/test/unit/head_crashreporter.js @@ -15,7 +15,7 @@ function sendCommandAsync(command) { }); } -/** +/* * Run an xpcshell subprocess and crash it. * * @param setup @@ -254,7 +254,7 @@ async function do_triggered_content_crash(trigger, callback) { } } -/** +/* * Run the `crash` backgroundtask subprocess, crashing it in the * specified manner. * diff --git a/toolkit/modules/NewTabUtils.sys.mjs b/toolkit/modules/NewTabUtils.sys.mjs @@ -956,7 +956,7 @@ var ActivityStreamProvider = { ); }, - /** + /* * Gets the top frecent sites for Activity Stream. * * @param {Object} aOptions diff --git a/toolkit/modules/subprocess/subprocess_unix.worker.js b/toolkit/modules/subprocess/subprocess_unix.worker.js @@ -481,7 +481,7 @@ class Process extends BaseProcess { * process termination. * */ class ManagedProcess extends BaseProcess { - /** + /* * Connect to an already running process that was spawned externally, * through numeric stdin/stdout/stderr file descriptors. * @@ -542,7 +542,7 @@ class ManagedProcess extends BaseProcess { } } - /** + /* * A ManagedProcess is already running, so here the spawn just performs the * connection of the file descriptors received. * diff --git a/toolkit/modules/tests/xpcshell/test_GMPInstallManager.js b/toolkit/modules/tests/xpcshell/test_GMPInstallManager.js @@ -1893,7 +1893,7 @@ function setupContentSigTestPrefs() { return Preferences.get(GMPPrefs.KEY_URL_OVERRIDE, ""); } -/** +/*** * Revert prefs used for content signature tests. * * @param previousUrlOverride - The GMP URL override value prior to test being @@ -1909,7 +1909,7 @@ function revertContentSigTestPrefs(previousUrlOverride) { Preferences.set("media.gmp-manager.checkContentSignature", false); } -/** +/*** * A helper to check that glean metrics have expected counts. * @param expectedGleanValues a object that has properties with names set to glean metrics to be checked * and the values are the expected count. Eg { cert_pin_success: 1 }. @@ -1932,7 +1932,7 @@ function checkGleanMetricCounts(expectedGleanValues) { } } -/** +/*** * Sets up a `HttpServer` for use in content singature checking tests. This * server will expose different endpoints that can be used to simulate different * pass and failure scenarios when fetching an update.xml file. diff --git a/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs b/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs @@ -115,20 +115,20 @@ import { FileUtils } from "resource://gre/modules/FileUtils.sys.mjs"; export class nsUnknownContentTypeDialog { // Todo (bug 1986787): these should be private, but some are used from tests. - /** @type {?nsIHelperAppLauncher} */ + /* @type {?nsIHelperAppLauncher} */ mLauncher = null; - /** @type {?nsIInterfaceRequestor} */ + /* @type {?nsIInterfaceRequestor} */ mContext = null; // This should be one of the 3 reason constants on nsIHelperAppDialog. // Right now our automated XPIDL ts generation does not generate the // correct enum for this. Bug 1986020 covers fixing this. - /** @type {number} */ + /* @type {number} */ mReason = null; - /** @type {?nsIDOMWindow} */ + /* @type {?nsIDOMWindow} */ mDialog = null; - /** @type {nsILocalHandlerApp | nsIGIOHandlerApp | null } */ + /* @type {nsILocalHandlerApp | nsIGIOHandlerApp | null } */ chosenApp = null; givenDefaultApp = false; updateSelf = true; diff --git a/toolkit/mozapps/extensions/internal/AddonRepository.sys.mjs b/toolkit/mozapps/extensions/internal/AddonRepository.sys.mjs @@ -406,7 +406,7 @@ export var AddonRepository = { return addon; }, - /** + /* * Clear and delete the AddonRepository database * @return Promise{null} resolves when the database is deleted */ @@ -416,7 +416,7 @@ export var AddonRepository = { ); }, - /** + /* * Create a ServiceRequest instance. * @return ServiceRequest returns a ServiceRequest instance. */ @@ -700,7 +700,7 @@ export var AddonRepository = { lazy.AddonManager.beforeShutdown.removeBlocker(shutter); }, - /** + /* * Creates an AddonSearchResult by parsing an entry from the AMO API. * * @param aEntry @@ -1099,7 +1099,7 @@ var AddonDatabase = { this.save(); }, - /** + /* * Creates an AddonSearchResult by parsing an object structure * retrieved from the DB JSON representation. * diff --git a/toolkit/mozapps/extensions/internal/XPIInstall.sys.mjs b/toolkit/mozapps/extensions/internal/XPIInstall.sys.mjs @@ -2533,7 +2533,7 @@ var DownloadAddonInstall = class extends AddonInstall { } } - /** + /* * Update the crypto hasher with the new data and call the progress listeners. * * @see nsIStreamListener @@ -2546,7 +2546,7 @@ var DownloadAddonInstall = class extends AddonInstall { } } - /** + /* * Check the redirect response for a hash of the target XPI and verify that * we don't end up on an insecure channel. * @@ -2584,7 +2584,7 @@ var DownloadAddonInstall = class extends AddonInstall { this.channel = aNewChannel; } - /** + /* * This is the first chance to get at real headers on the channel. * * @see nsIStreamListener @@ -2628,7 +2628,7 @@ var DownloadAddonInstall = class extends AddonInstall { } } - /** + /* * The download is complete. * * @see nsIStreamListener diff --git a/toolkit/mozapps/extensions/internal/XPIProvider.sys.mjs b/toolkit/mozapps/extensions/internal/XPIProvider.sys.mjs @@ -3582,7 +3582,7 @@ export var XPIProvider = { return XPIExports.XPIDatabase.getBlocklistAttentionInfo(); }, - /** + /* * Notified when a preference we're interested in has changed. * * @see nsIObserver diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_cache.js b/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_cache.js @@ -418,7 +418,7 @@ const WITH_EXTENSION_CACHE = [ var gDBFile = gProfD.clone(); gDBFile.append(FILE_DATABASE); -/** +/* * Check the actual add-on results against the expected add-on results * * @param aActualAddons @@ -444,7 +444,7 @@ function check_results(aActualAddons, aExpectedAddons, aFromRepository) { }); } -/** +/* * Check the add-ons in the cache. This function also tests * AddonRepository.getCachedAddonByID() * @@ -489,7 +489,7 @@ function check_cache(aExpectedToFind, aExpectedImmediately) { return Promise.all(lookups); } -/** +/* * Task to check an initialized cache by checking the cache, then restarting the * manager, and checking the cache. This checks that the cache is consistent * across manager restarts. diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_XPIStates.js b/toolkit/mozapps/extensions/test/xpcshell/test_XPIStates.js @@ -36,7 +36,7 @@ add_task(async function setup() { // timestamp we may not consider the change significant) var lastTimestamp = Date.now(); -/** +/* * Helper function to touch a file and then test whether we detect the change. * @param XS The XPIState object. * @param aPath File path to touch. diff --git a/toolkit/mozapps/update/UpdateService.sys.mjs b/toolkit/mozapps/update/UpdateService.sys.mjs @@ -826,7 +826,7 @@ function getCanStageUpdates(transient = true) { return lazy.gCanStageUpdatesSession; } -/** +/* * Whether or not the application can use BITS to download updates. * * @param {boolean} [transient] Whether transient factors such as the update diff --git a/toolkit/mozapps/update/tests/browser/head.js b/toolkit/mozapps/update/tests/browser/head.js @@ -246,7 +246,7 @@ function setUpdateTimerPrefs() { Services.prefs.setIntPref(PREF_APP_UPDATE_INTERVAL, 43200); } -/** +/* * Sets the value of the App Auto Update setting and sets it back to the * original value at the start of the test when the test finishes. * diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/require-jsdoc.mjs b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/require-jsdoc.mjs @@ -27,4 +27,13 @@ export default { "jsdoc/require-yields": "error", "jsdoc/require-yields-check": "error", }, + settings: { + jsdoc: { + // This changes what's allowed in JSDocs, enabling more type-inference + // friendly types. This is the default in eslint-plugin-jsdoc versions + // since May 2023, but we're still on 39.9 and need opt-in for now. + // https://github.com/gajus/eslint-plugin-jsdoc/issues/834 + mode: "typescript", + }, + }, }; diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/valid-jsdoc.mjs b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/valid-jsdoc.mjs @@ -15,11 +15,19 @@ export default { "jsdoc/check-tag-names": "error", "jsdoc/check-types": "error", "jsdoc/empty-tags": "error", - "jsdoc/no-bad-blocks": "error", "jsdoc/no-multi-asterisks": "error", "jsdoc/require-param-type": "error", "jsdoc/require-returns-type": "error", "jsdoc/tag-lines": ["error", "any", { startLines: 1 }], "jsdoc/valid-types": "error", }, + settings: { + jsdoc: { + // This changes what's allowed in JSDocs, enabling more type-inference + // friendly types. This is the default in eslint-plugin-jsdoc versions + // since May 2023, but we're still on 39.9 and need opt-in for now. + // https://github.com/gajus/eslint-plugin-jsdoc/issues/834 + mode: "typescript", + }, + }, };