commit e32b23df8ba55501432f5e560dd2a8820b206f87 parent e68a368611f58c25790811179d617cf14b0ef46a Author: Mark Banner <standard8@mozilla.com> Date: Fri, 3 Oct 2025 14:09:08 +0000 Bug 1991124 - Fix remaining ESlint require-jsdoc issues that had been recently introduced. r=frontend-codestyle-reviewers,Gijs,mconley Differential Revision: https://phabricator.services.mozilla.com/D266634 Diffstat:
7 files changed, 27 insertions(+), 12 deletions(-)
diff --git a/browser/components/backup/tests/xpcshell/test_PreferencesBackupResource.js b/browser/components/backup/tests/xpcshell/test_PreferencesBackupResource.js @@ -275,6 +275,8 @@ add_task(async function test_backup_private_browsing() { * concerns over potential time skips in automation, we only check that the * timestamp is not more than a week before/after now (we would expect the * difference to be more like a few milliseconds). + * + * @param {string} prefsJsPath */ async function checkPrefsJsHasValidRecoveryTime(prefsJsPath) { Assert.equal( diff --git a/browser/components/mozcachedohttp/MozCachedOHTTPProtocolHandler.sys.mjs b/browser/components/mozcachedohttp/MozCachedOHTTPProtocolHandler.sys.mjs @@ -547,8 +547,8 @@ export class MozCachedOHTTPChannel { * Object containing extracted data, or null if invalid. * Returns null if URL parsing fails, no 'url' parameter found, * target URL is not HTTPS, or target URL is malformed. - * @returns {nsIURI} returns.resourceURI - The decoded target image URI (HTTPS only) - * @returns {string} returns.host - The moz-cached-ohttp host (e.g., "newtab-image") + * `resourceURI` is the decoded target image URI (HTTPS only). + * `host` is the moz-cached-ohttp host (e.g., "newtab-image"). */ #extractHostAndResourceURI() { try { @@ -1007,6 +1007,7 @@ export class MozCachedOHTTPChannel { * @param {MessageChannelPort} cacheStreamUpdatePort * MessagePort for sending error cleanup messages to the parent actor. * Used to doom the cache entry when an error occurs during the request. + * @param {boolean} cacheOutputStream */ #cleanupCacheOnError(cacheStreamUpdatePort, cacheOutputStream) { try { diff --git a/browser/components/security/unexpectedScriptLoad.js b/browser/components/security/unexpectedScriptLoad.js @@ -178,6 +178,8 @@ var UnexpectedScriptLoadPanel = new (class { /** * Hide the pop up (for event handlers). + * + * @param {boolean} userDismissed */ close(userDismissed) { this.console?.log("UnexpectedScriptLoadPanel is closing"); diff --git a/browser/components/webrtc/content/webrtc-preview/webrtc-preview.mjs b/browser/components/webrtc/content/webrtc-preview/webrtc-preview.mjs @@ -7,6 +7,9 @@ import { MozLitElement } from "chrome://global/content/lit-utils.mjs"; window.MozXULElement?.insertFTLIfNeeded("browser/webrtc-preview.ftl"); +/** + * A class to handle a preview of a WebRTC stream. + */ export class WebRTCPreview extends MozLitElement { static properties = { // The ID of the device to preview. diff --git a/eslint-rollouts.config.mjs b/eslint-rollouts.config.mjs @@ -466,15 +466,6 @@ export default [ "uriloader/**", "widget/tests/file*.js", "widget/tests/window_composition_text_querycontent.xhtml", - - // Bug 1991124 - Re-enable for these files which regressed whilst - // require-jsdoc was accidentally not enabled. - "browser/components/backup/tests/xpcshell/test_PreferencesBackupResource.js", - "browser/components/mozcachedohttp/MozCachedOHTTPProtocolHandler.sys.mjs", - "browser/components/security/unexpectedScriptLoad.js", - "browser/components/webrtc/content/webrtc-preview/webrtc-preview.mjs", - "toolkit/components/promiseworker/PromiseWorker.sys.mjs", - "toolkit/modules/AppServicesTracing.sys.mjs", ], rules: mozilla.turnOff(mozilla.configs["flat/require-jsdoc"].rules), }, diff --git a/toolkit/components/promiseworker/PromiseWorker.sys.mjs b/toolkit/components/promiseworker/PromiseWorker.sys.mjs @@ -458,6 +458,7 @@ BasePromiseWorker.prototype = { * An error that has been serialized by the worker. * * @class + * @param {object} data */ function WorkerError(data) { this.data = data; diff --git a/toolkit/modules/AppServicesTracing.sys.mjs b/toolkit/modules/AppServicesTracing.sys.mjs @@ -54,6 +54,9 @@ class CallbackList { * * If this changes the max level for the list, this returns the new max level otherwise it returns * undefined; + * + * @param {number} level + * @param {(event: object) => void} callback */ add(level, callback) { const oldMaxLevel = this.maxLevel(); @@ -75,6 +78,8 @@ class CallbackList { * * If this changes the max level for the list, this returns the new max level otherwise it returns * undefined; + * + * @param {(event: object) => void} callback */ remove(callback) { const index = this.items.find(i => i.callback === callback); @@ -97,6 +102,8 @@ class CallbackList { * Process an event using all items in this CallbackList. * * The callbacks for item >= `event.level` will be called. + * + * @param {object} event */ processEvent(event) { for (const item of this.items) { @@ -271,6 +278,9 @@ function loggerEventHandler(event) { /** * send output from a target to a Log.sys.jsm logger. + * + * @param {string} target + * @param {any} log */ export function setupLoggerForTarget(target, log) { if (typeof log == "string") { @@ -293,6 +303,9 @@ export function setupLoggerForTarget(target, log) { tracingEventHandler.register(target, tracing_level, loggerEventHandler); } +/** + * Handles forwarding a log. + */ class LogForwarder extends EventSink { static PREF_CRATES_TO_FORWARD = "toolkit.rust-components.logging.crates"; @@ -341,7 +354,9 @@ class LogForwarder extends EventSink { } /** - * Parse the tracing pref value + * Parse the tracing pref value. + * + * @param {string} prefValue */ parsePrefValue(prefValue) { const parsed = {