commit 2ad23597e0f83c6769b3882539b8700e3dfb12ff parent 0895ef714d19de7b35c74614283fc6a8311d0c7c Author: Mark Banner <standard8@mozilla.com> Date: Mon, 22 Dec 2025 12:39:08 +0000 Bug 2004680 - Fix ESLint rule jsdoc/check-tag-names issues in remaining areas. r=firefox-desktop-core-reviewers ,necko-reviewers,sync-reviewers,valentin Differential Revision: https://phabricator.services.mozilla.com/D275758 Diffstat:
19 files changed, 122 insertions(+), 133 deletions(-)
diff --git a/docshell/base/URIFixup.sys.mjs b/docshell/base/URIFixup.sys.mjs @@ -763,11 +763,11 @@ function isDomainKnown(asciiHost) { } /** - * Checks the suffix of info.fixedURI against the Public Suffix List. - * If the suffix is unknown due to a typo this will try to fix it up. + * Checks the suffix of ``info.fixedURI`` against the Public Suffix List. + * If the suffix is unknown due to a typo this will try to fix it up in-place, + * by modifying the public suffix of ``info.fixedURI``. * * @param {URIFixupInfo} info about the uri to check. - * @note this may modify the public suffix of info.fixedURI. * @returns {object} result The lookup result. * @returns {string} result.suffix The public suffix if one can be identified. * @returns {boolean} result.hasUnknownSuffix True when the suffix is not in the @@ -910,8 +910,7 @@ function maybeSetAlternateFixedURI(info, fixupFlags) { * Try to fixup a file URI. * * @param {string} uriString The file URI to fix. - * @returns {nsIURI} a fixed uri or null. - * @note FileURIFixup only returns a URI if it has to add the file: protocol. + * @returns {?nsIURI} a fixed uri if it has to add the file: protocol or null. */ function fileURIFixup(uriString) { let attemptFixup = false; diff --git a/modules/libpref/test/unit/test_warnings.js b/modules/libpref/test/unit/test_warnings.js @@ -7,8 +7,8 @@ function makeBuffer(length) { } /** - * @resolves |true| if execution proceeded without warning, - * |false| if there was a warning. + * @returns {Promise<boolean>} + * True if execution proceeded without warning, false if there was a warning. */ function checkWarning(pref, buffer) { return new Promise(resolve => { diff --git a/netwerk/test/unit/test_backgroundfilesaver.js b/netwerk/test/unit/test_backgroundfilesaver.js @@ -89,8 +89,8 @@ function toHex(str) { * @param aExpectedContents * String containing the octets that are expected in the file. * - * @return {Promise} - * @resolves When the operation completes. + * @returns {Promise<void>} + * Resolves when the operation completes. * @rejects Never. */ function promiseVerifyContents(aFile, aExpectedContents) { @@ -127,8 +127,8 @@ function promiseVerifyContents(aFile, aExpectedContents) { * @param aOnTargetChangeFn * Optional callback invoked with the target file name when it changes. * - * @return {Promise} - * @resolves When onSaveComplete is called with a success code. + * @returns {Promise<void>} + * Resolves when onSaveComplete is called with a success code. * @rejects With an exception, if onSaveComplete is called with a failure code. */ function promiseSaverComplete(aSaver, aOnTargetChangeFn) { @@ -160,8 +160,8 @@ function promiseSaverComplete(aSaver, aOnTargetChangeFn) { * @param aCloseWhenDone * If true, the output stream will be closed when the copy finishes. * - * @return {Promise} - * @resolves When the copy completes with a success code. + * @returns {Promise<void>} + * Resolves when the copy completes with a success code. * @rejects With an exception, if the copy fails. */ function promiseCopyToSaver(aSourceString, aSaverOutputStream, aCloseWhenDone) { @@ -206,8 +206,8 @@ function promiseCopyToSaver(aSourceString, aSaverOutputStream, aCloseWhenDone) { * @param aCloseWhenDone * If true, the output stream will be closed when the copy finishes. * - * @return {Promise} - * @resolves When the operation completes with a success code. + * @returns {Promise<void>} + * Resolves when the operation completes with a success code. * @rejects With an exception, if the operation fails. */ function promisePumpToSaver(aSourceString, aSaverStreamListener) { diff --git a/netwerk/test/unit/test_signature_extraction.js b/netwerk/test/unit/test_signature_extraction.js @@ -45,8 +45,8 @@ function getTempFile(leafName) { * @param aOnTargetChangeFn * Optional callback invoked with the target file name when it changes. * - * @return {Promise} - * @resolves When onSaveComplete is called with a success code. + * @returns {Promise<void>} + * Resolves when onSaveComplete is called with a success code. * @rejects With an exception, if onSaveComplete is called with a failure code. */ function promiseSaverComplete(aSaver, aOnTargetChangeFn) { @@ -78,8 +78,8 @@ function promiseSaverComplete(aSaver, aOnTargetChangeFn) { * @param aCloseWhenDone * If true, the output stream will be closed when the copy finishes. * - * @return {Promise} - * @resolves When the copy completes with a success code. + * @returns {Promise<void>} + * Resolves when the copy completes with a success code. * @rejects With an exception, if the copy fails. */ function promiseCopyToSaver(aSourceString, aSaverOutputStream, aCloseWhenDone) { diff --git a/services/common/async.sys.mjs b/services/common/async.sys.mjs @@ -14,8 +14,9 @@ export var Async = { * must take a callback function as their last argument. The 'this' object * will be whatever chain()'s is. * - * @usage this._chain = Async.chain; - * this._chain(this.foo, this.bar, this.baz)(args, for, foo) + * @example + * this._chain = Async.chain; + * this._chain(this.foo, this.bar, this.baz)(args, for, foo) * * This is equivalent to: * diff --git a/services/common/tests/unit/head_helpers.js b/services/common/tests/unit/head_helpers.js @@ -88,8 +88,9 @@ function do_check_throws_message(aFunc, aResult) { * * @param [arg0, arg1, arg2, ...] * Any number of arguments to print out - * @usage _("Hello World") -> prints "Hello World" - * @usage _(1, 2, 3) -> prints "1 2 3" + * @example + * _("Hello World") -> prints "Hello World" + * _(1, 2, 3) -> prints "1 2 3" */ var _ = function () { print(Array.from(arguments).join(" ")); diff --git a/services/crypto/modules/WeaveCrypto.sys.mjs b/services/crypto/modules/WeaveCrypto.sys.mjs @@ -95,13 +95,12 @@ WeaveCrypto.prototype = { /** * _commonCrypt * - * @args - * data: data to encrypt/decrypt (ArrayBuffer) - * symKeyStr: symmetric key (Base64 String) - * ivStr: initialization vector (Base64 String) - * operation: operation to apply (either OPERATIONS.ENCRYPT or OPERATIONS.DECRYPT) - * @returns - * the encrypted/decrypted data (ArrayBuffer) + * @param {ArrayBuffer} data - data to encrypt/decrypt. + * @param {string} symKeyStr - symmetric key (Base64 String). + * @param {string} ivStr - initialization vector (Base64 String). + * @param {number} operation - operation to apply (either OPERATIONS.ENCRYPT or OPERATIONS.DECRYPT) + * @returns {ArrayBuffer} + * The encrypted/decrypted data. */ async _commonCrypt(data, symKeyStr, ivStr, operation) { this.log("_commonCrypt() called"); diff --git a/services/crypto/tests/unit/head_helpers.js b/services/crypto/tests/unit/head_helpers.js @@ -60,8 +60,8 @@ function base64UrlDecode(s) { * * @param [arg0, arg1, arg2, ...] * Any number of arguments to print out - * @usage _("Hello World") -> prints "Hello World" - * @usage _(1, 2, 3) -> prints "1 2 3" + * Usage: _("Hello World") -> prints "Hello World" + * Usage: _(1, 2, 3) -> prints "1 2 3" */ var _ = function () { print(Array.from(arguments).join(" ")); diff --git a/services/sync/modules/util.sys.mjs b/services/sync/modules/util.sys.mjs @@ -99,11 +99,12 @@ export var Utils = { /** * Wrap a [promise-returning] function to catch all exceptions and log them. * - * @usage MyObj._catch = Utils.catch; - * MyObj.foo = function() { this._catch(func)(); } - * * Optionally pass a function which will be called if an * exception occurs. + * + * @example + * MyObj._catch = Utils.catch; + * MyObj.foo = function() { this._catch(func)(); } */ catch(func, exceptionCallback) { let thisArg = this; @@ -131,8 +132,9 @@ export var Utils = { * Wrap a [promise-returning] function to call lock before calling the function * then unlock when it finishes executing or if it threw an error. * - * @usage MyObj._lock = Utils.lock; - * MyObj.foo = async function() { await this._lock(func)(); } + * @example + * MyObj._lock = Utils.lock; + * MyObj.foo = async function() { await this._lock(func)(); } */ lock(label, func) { let thisArg = this; @@ -162,17 +164,16 @@ export var Utils = { * is the function's return value on "finish" or the caught exception on * "error". The data argument is the predefined data value. * - * Example: - * - * @usage function MyObj(name) { - * this.name = name; - * this._notify = Utils.notify("obj:"); - * } - * MyObj.prototype = { - * foo: function() this._notify("func", "data-arg", async function () { - * //... - * }(), - * }; + * @example + * function MyObj(name) { + * this.name = name; + * this._notify = Utils.notify("obj:"); + * } + * MyObj.prototype = { + * foo: function() this._notify("func", "data-arg", async function () { + * //... + * }(), + * }; */ notify(prefix) { return function NotifyMaker(name, data, func) { diff --git a/testing/mochitest/BrowserTestUtils/BrowserTestUtils.sys.mjs b/testing/mochitest/BrowserTestUtils/BrowserTestUtils.sys.mjs @@ -90,21 +90,21 @@ export var BrowserTestUtils = { /** * Loads a page in a new tab, executes a Task and closes the tab. * + * @template T * @param {object | string} options * If this is a string it is the url to open and will be opened in the * currently active browser window. - * @param {tabbrowser} [options.gBrowser + * @param {tabbrowser} [options.gBrowser] * A reference to the ``tabbrowser`` element where the new tab should * be opened, * @param {string} options.url * The URL of the page to load. - * @param {Function} taskFn + * @param {(browser: MozBrowser) => T} taskFn * Async function representing that will be executed while * the tab is loaded. The first argument passed to the function is a * reference to the browser object for the new tab. * - * @return {Any} Returns the value that is returned from taskFn. - * @resolves When the tab has been closed. + * @return {Promise<T>} Resolves to the value that is returned from taskFn. * @rejects Any exception from taskFn is propagated. */ async withNewTab(options, taskFn) { @@ -161,7 +161,6 @@ export var BrowserTestUtils = { * * @return {Promise} * Resolves when the tab is ready and loaded as necessary. - * @resolves The new tab. */ openNewForegroundTab(tabbrowser, ...args) { let startTime = ChromeUtils.now(); @@ -357,7 +356,6 @@ export var BrowserTestUtils = { * * @return {Promise} * Resolves when the tab has been switched to. - * @resolves The tab switched to. */ switchTab(tabbrowser, tab) { let startTime = ChromeUtils.now(); @@ -427,7 +425,7 @@ export var BrowserTestUtils = { * 'about:neterror?...' for error page. * * @return {Promise} - * @resolves When a load event is triggered for the browser. + * Resovles when a load event is triggered for the browser. */ browserLoaded(browser, ...args) { const options = @@ -569,8 +567,8 @@ export var BrowserTestUtils = { * If checkFn(browser) returns false, the load is ignored * and we continue to wait. * - * @return {Promise} - * @resolves Once the selected browser fires its load event. + * @return {Promise<Event>} + * Resolves to the fired load event. */ firstBrowserLoaded(win, aboutBlank = true, checkFn = null) { return this.waitForEvent( @@ -607,8 +605,8 @@ export var BrowserTestUtils = { * If checkFn(aStateFlags, aStatus) returns false, the state change * is ignored and we continue to wait. * - * @return {Promise} - * @resolves When the desired state change reaches the tab's progress listener + * @return {Promise<void>} + * Resolves when the desired state change reaches the tab's progress listener. */ waitForBrowserStateChange(browser, expectedURI, checkFn) { return new Promise(resolve => { @@ -667,8 +665,8 @@ export var BrowserTestUtils = { * Whether NS_BINDING_ABORTED stops 'count' as 'real' stops * (e.g. caused by the stop button or equivalent APIs) * - * @return {Promise} - * @resolves When STATE_STOP reaches the tab's progress listener + * @return {Promise<void>} + * Resolves when STATE_STOP reaches the tab's progress listener. */ browserStopped(browser, expectedURI, checkAborts = false) { let testFn = function (aStateFlags, aStatus) { @@ -699,8 +697,8 @@ export var BrowserTestUtils = { * @param {string} expectedURI (optional) * A specific URL to check the channel load against * - * @return {Promise} - * @resolves When STATE_START reaches the tab's progress listener + * @return {Promise<void>} + * Resolves when STATE_START reaches the tab's progress listener */ browserStarted(browser, expectedURI) { let testFn = function (aStateFlags) { @@ -741,8 +739,8 @@ export var BrowserTestUtils = { * See ``browserLoaded`` function. * * @return {Promise} - * @resolves With the {xul:tab} when a tab is opened and its location changes - * to the given URL and optionally that browser has loaded. + * Resolves with the {xul:tab} when a tab is opened and its location changes + * to the given URL and optionally that browser has loaded. * * NB: this method will not work if you open a new tab with e.g. BrowserCommands.openTab * and the tab does not load a URL, because no onLocationChange will fire. @@ -827,8 +825,7 @@ export var BrowserTestUtils = { * @param {string} [url] * The string URL to look for. The URL must match the URL in the * location bar exactly. - * @return {Promise} - * @resolves {webProgress, request, flags} When onLocationChange fires. + * @return {Promise<{webProgress: nsIWebProgress, request: nsIRequest, flags: number}>} */ waitForLocationChange(tabbrowser, url) { return new Promise(resolve => { @@ -1212,8 +1209,8 @@ export var BrowserTestUtils = { * * @param {xul:tab} tab * The tab that will be removed. - * @returns {Promise} - * @resolves When the SessionStore information is updated. + * @returns {Promise<void>} + * Resolves when the SessionStore information is updated. */ waitForSessionStoreUpdate(tab) { let browser = tab.linkedBrowser; @@ -1224,8 +1221,8 @@ export var BrowserTestUtils = { }, /** - * @returns {Promise} - * @resolves When the locale has been changed. + * @returns {Promise<void>} + * Resolves when the locale has been changed. */ enableRtlLocale() { let localeChanged = TestUtils.topicObserved("intl:app-locales-changed"); @@ -1234,8 +1231,8 @@ export var BrowserTestUtils = { }, /** - * @returns {Promise} - * @resolves When the locale has been changed. + * @returns {Promise<void>} + * Resolves when the locale has been changed. */ disableRtlLocale() { let localeChanged = TestUtils.topicObserved("intl:app-locales-changed"); @@ -1290,12 +1287,11 @@ export var BrowserTestUtils = { * @param {bool} [wantsUntrusted=false] * True to receive synthetic events dispatched by web content. * - * @note Because this function is intended for testing, any error in checkFn + * Note: Because this function is intended for testing, any error in checkFn * will cause the returned promise to be rejected instead of waiting for * the next event, since this is probably a bug in the test. * - * @returns {Promise} - * @resolves The Event object. + * @returns {Promise<Event>} */ waitForEvent(subject, eventName, capture, checkFn, wantsUntrusted) { let startTime = ChromeUtils.now(); @@ -1374,14 +1370,15 @@ export var BrowserTestUtils = { * @param {bool} wantUntrusted [optional] * Whether to accept untrusted events * - * @note As of bug 1588193, this function no longer rejects the returned + * Note: As of bug 1588193, this function no longer rejects the returned * promise in the case of a checkFn error. Instead, since checkFn is now * called through eval in the content process, the error is thrown in * the listener created by ContentEventListenerChild. Work to improve * error handling (eg. to reject the promise as before and to preserve * the filename/stack) is being tracked in bug 1593811. * - * @returns {Promise} + * @returns {Promise<string>} + * Resolves with the event name. */ waitForContentEvent( browser, @@ -1682,8 +1679,9 @@ export var BrowserTestUtils = { * @param {xul:browser} browser * A xul:browser. * - * @return {Promise} - * @resolves When an error page has been loaded in the browser. + * @return {Promise<string>} + * Resolves when an error page has been loaded in the browser, with the name + * of the event. */ waitForErrorPage(browser) { return this.waitForContentEvent( @@ -1794,8 +1792,8 @@ export var BrowserTestUtils = { * Whether the synthesize should be perfomed while simulating * user interaction (making windowUtils.isHandlingUserInput be true). * - * @returns {Promise} - * @resolves True if the mouse event was cancelled. + * @returns {Promise<boolean>} + * Resolves to true if the mouse event was cancelled. */ synthesizeMouse( target, @@ -1846,8 +1844,8 @@ export var BrowserTestUtils = { * @param {BrowserContext|MozFrameLoaderOwner} browsingContext * Browsing context or browser element, must not be null * - * @returns {Promise} - * @resolves True if the touch event was cancelled. + * @returns {Promise<boolean>} + * Resolves to true if the touch event was cancelled. */ synthesizeTouch(target, offsetX, offsetY, event, browsingContext) { let targetFn = null; @@ -1936,10 +1934,10 @@ export var BrowserTestUtils = { /** * Returns a Promise that resolves once the tab starts closing. * - * @param (tab) tab + * @param {tab} tab * The tab that will be removed. - * @returns (Promise) - * @resolves When the tab starts closing. Does not get passed a value. + * @returns {Promise<Event>} + * Resolves with the event when the tab starts closing. */ waitForTabClosing(tab) { return this.waitForEvent(tab, "TabClose"); @@ -1959,7 +1957,7 @@ export var BrowserTestUtils = { * If bypassCache is true, this skips some steps that normally happen * when a user reloads a tab. * @returns {Promise} - * @resolves When the tab finishes reloading. + * Resolves when the tab finishes reloading. */ reloadTab(tab, options = {}) { const finished = BrowserTestUtils.browserLoaded(tab.linkedBrowser, { @@ -2067,8 +2065,8 @@ export var BrowserTestUtils = { * If specified and `true`, cause the crash asynchronously. * * @returns (Promise) - * @resolves An Object with key-value pairs representing the data from the - * crash report's extra file (if applicable). + * An Object with key-value pairs representing the data from the crash + * report's extra file (if applicable). */ async crashFrame( browser, @@ -2234,8 +2232,7 @@ export var BrowserTestUtils = { * * @param browser (<xul:browser>) * The browser to simulate a content process launch failure on. - * @return Promise - * @resolves undefined + * @return {Promise<void>} * Resolves when the TabCrashHandler should be done handling the * simulated crash. */ @@ -2347,8 +2344,8 @@ export var BrowserTestUtils = { * @param {BrowserContext|MozFrameLoaderOwner} browsingContext * Browsing context or browser element, must not be null * - * @returns {Promise} - * @resolves True if the keypress event was synthesized. + * @returns {Promise<boolean>} + * Resolves to true if the keypress event was synthesized. */ sendChar(char, browsingContext) { browsingContext = this.getBrowsingContextFrom(browsingContext); @@ -2389,8 +2386,8 @@ export var BrowserTestUtils = { * @param {BrowserContext|MozFrameLoaderOwner} browsingContext * Browsing context or browser element, must not be null * - * @returns {Promise} - * @resolves False if the composition event could not be synthesized. + * @returns {Promise<boolean>} + * Resolves to false if the composition event could not be synthesized. */ synthesizeComposition(event, browsingContext) { browsingContext = this.getBrowsingContextFrom(browsingContext); diff --git a/testing/mochitest/BrowserTestUtils/ContentTask.sys.mjs b/testing/mochitest/BrowserTestUtils/ContentTask.sys.mjs @@ -46,10 +46,8 @@ export var ContentTask = { * the remote browser to be executed. Unlike Task.spawn, this * argument may not be an iterator as it will be serialized and * sent to the remote browser. - * @return A promise object where you can register completion callbacks to be - * called when the task terminates. - * @resolves With the final returned value of the task if it executes - * successfully. + * @return {Promise} + * Resolves when the task finishes without errors. * @rejects An error message if execution fails. */ spawn: function ContentTask_spawn(browser, arg, task) { diff --git a/testing/mochitest/tests/SimpleTest/AccessibilityUtils.js b/testing/mochitest/tests/SimpleTest/AccessibilityUtils.js @@ -129,7 +129,7 @@ this.AccessibilityUtils = (function () { /** * Get role attribute for an accessible object if specified for its - * corresponding {@code DOMNode}. + * corresponding ``DOMNode``. * * @param {nsIAccessible} accessible * Accessible for which to determine its role attribute value. @@ -166,13 +166,13 @@ this.AccessibilityUtils = (function () { } /** - * Test if an accessible has a {@code hidden} attribute. + * Test if an accessible has a ``hidden`` attribute. * * @param {nsIAccessible} accessible * Accessible object. * * @return {boolean} - * True if the accessible object has a {@code hidden} attribute, false + * True if the accessible object has a ``hidden`` attribute, false * otherwise. */ function hasHiddenAttribute(accessible) { diff --git a/testing/mochitest/tests/SimpleTest/ChromeTask.js b/testing/mochitest/tests/SimpleTest/ChromeTask.js @@ -111,10 +111,8 @@ var ChromeTask = { * the remote browser to be executed. Unlike Task.spawn, this * argument may not be an iterator as it will be serialized and * sent to the remote browser. - * @return A promise object where you can register completion callbacks to be - * called when the task terminates. - * @resolves With the final returned value of the task if it executes - * successfully. + * @return {Promise} + * Resolves when the task finishes without errors. * @rejects An error message if execution fails. */ spawn: function ChromeTask_spawn(arg, task) { diff --git a/testing/mochitest/tests/SimpleTest/EventUtils.js b/testing/mochitest/tests/SimpleTest/EventUtils.js @@ -4164,14 +4164,10 @@ function _checkDataTransferItems(aDataTransfer, aExpectedDragData) { } /** - * This callback type is used with ``synthesizePlainDragAndCancel()``. - * It should compare ``actualData`` and ``expectedData`` and return - * true if the two should be considered equal, false otherwise. - * - * @callback eqTest - * @param {*} actualData - * @param {*} expectedData - * @return {boolean} + * @typedef {(actualData: any, expectedData: any) -> boolean} eqTest + * This callback type is used with ``synthesizePlainDragAndCancel()``. + * It should compare ``actualData`` and ``expectedData`` and return + * true if the two should be considered equal, false otherwise. */ /** @@ -4188,14 +4184,14 @@ function _checkDataTransferItems(aDataTransfer, aExpectedDragData) { * * [ * [ - * {"type": value, "data": value, eqTest: function} + * {"type": value, "data": value, "eqTest": eqTest} * ..., * ], * ... * ] * * This can also be null. - * You can optionally provide ``eqTest`` {@type eqTest} if the + * You can optionally provide ``eqTest`` if the * comparison to the expected data transfer items can't be done * with x == y; * @return {boolean} diff --git a/testing/modules/FileTestUtils.sys.mjs b/testing/modules/FileTestUtils.sys.mjs @@ -27,7 +27,7 @@ export var FileTestUtils = { * * @return nsIFile pointing to a non-existent file in a temporary directory. * - * @note It is not enough to delete the file if it exists, or to delete the + * Note: It is not enough to delete the file if it exists, or to delete the * file after calling nsIFile.createUnique, because on Windows the * delete operation in the file system may still be pending, preventing * a new file with the same name to be created. diff --git a/testing/modules/TestUtils.sys.mjs b/testing/modules/TestUtils.sys.mjs @@ -46,12 +46,12 @@ export var TestUtils = { * notification is the expected one, or false if it should be ignored * and listening should continue. * - * @note Because this function is intended for testing, any error in checkFn + * Note: Because this function is intended for testing, any error in checkFn * will cause the returned promise to be rejected instead of waiting for * the next notification, since this is probably a bug in the test. * * @return {Promise} - * @resolves The message from the observed notification. + * Resolved with the message from the observed notification. */ consoleMessageObserved(checkFn) { return new Promise((resolve, reject) => { @@ -133,12 +133,12 @@ export var TestUtils = { * and listening should continue. If not specified, the first * notification for the specified topic resolves the returned promise. * - * @note Because this function is intended for testing, any error in checkFn + * Note: Because this function is intended for testing, any error in checkFn * will cause the returned promise to be rejected instead of waiting for * the next notification, since this is probably a bug in the test. * - * @return {Promise} - * @resolves The array [subject, data] from the observed notification. + * @return {Promise<[nsISupports, string]>} + * Resolved with the array ``[subject, data]`` from the observed notification. */ topicObserved(topic, checkFn) { let startTime = ChromeUtils.now(); @@ -198,12 +198,12 @@ export var TestUtils = { * and listening should continue. If not specified, the first * notification for the specified topic resolves the returned promise. * - * @note Because this function is intended for testing, any error in checkFn + * Note: Because this function is intended for testing, any error in checkFn * will cause the returned promise to be rejected instead of waiting for * the next notification, since this is probably a bug in the test. * - * @return {Promise} - * @resolves The value of the preference. + * @return {Promise<number|string|boolean>} + * The value of the preference. */ waitForPrefChange(prefName, checkFn) { return new Promise((resolve, reject) => { diff --git a/testing/specialpowers/content/ContentTaskUtils.sys.mjs b/testing/specialpowers/content/ContentTaskUtils.sys.mjs @@ -141,12 +141,11 @@ export var ContentTaskUtils = { * listening should continue. If not specified, the first event with * the specified name resolves the returned promise. * - * @note Because this function is intended for testing, any error in checkFn + * Note: Because this function is intended for testing, any error in checkFn * will cause the returned promise to be rejected instead of waiting for * the next event, since this is probably a bug in the test. * - * @returns {Promise} - * @resolves The Event object. + * @returns {Promise<Event>} */ waitForEvent(subject, eventName, capture, checkFn, wantsUntrusted = false) { return new Promise((resolve, reject) => { diff --git a/testing/xpcshell/head.js b/testing/xpcshell/head.js @@ -264,7 +264,7 @@ void Cc["@mozilla.org/widget/transferable;1"].createInstance(); * This behaviour would cause random failures and slowdown tests execution, * for example by running database vacuum or cleanups for each test. * - * @note Idle service is overridden by default. If a test requires it, it will + * Note: Idle service is overridden by default. If a test requires it, it will * have to call do_get_idle() function at least once before use. */ var _fakeIdleService = { diff --git a/uriloader/exthandler/tests/HandlerServiceTestUtils.sys.mjs b/uriloader/exthandler/tests/HandlerServiceTestUtils.sys.mjs @@ -49,7 +49,7 @@ export var HandlerServiceTestUtils = { /** * Retrieves all the configured handlers for MIME types and protocols. * - * @note The nsIHandlerInfo instances returned by the "enumerate" method + * Note: The nsIHandlerInfo instances returned by the "enumerate" method * cannot be used for testing because they incorporate information from * the operating system and also from the default nsIHandlerService * instance, independently from what instance is under testing. @@ -65,7 +65,7 @@ export var HandlerServiceTestUtils = { * incorporates information from the operating system and also from the * handler service instance currently under testing. * - * @note If the handler service instance currently under testing is not the + * Note: If the handler service instance currently under testing is not the * default one and the requested type is a MIME type, the returned * nsIHandlerInfo will include information from the default * nsIHandlerService instance. This cannot be avoided easily because the @@ -123,7 +123,7 @@ export var HandlerServiceTestUtils = { * Creates an nsIHandlerInfo for the given MIME type or protocol, initialized * to the default values for the current platform. * - * @note For this method to work, the specified MIME type or protocol must not + * Note: For this method to work, the specified MIME type or protocol must not * be configured in the default handler service instance or the one * under testing, and must not be registered in the operating system. *