diff --git a/remote/cdp/CDPConnection.sys.mjs b/remote/cdp/CDPConnection.sys.mjs index 2f38098a0a16..dfbb94ee09b0 100644 --- a/remote/cdp/CDPConnection.sys.mjs +++ b/remote/cdp/CDPConnection.sys.mjs @@ -70,11 +70,11 @@ export class CDPConnection extends WebSocketConnection { /** * Send an error back to the CDP client. * - * @param {Number} id + * @param {number} id * Id of the packet which lead to an error. * @param {Error} err * Error object with `message` and `stack` attributes. - * @param {String=} sessionId + * @param {string=} sessionId * Id of the session used to send this packet. Falls back to the * default session if not specified. */ @@ -90,12 +90,12 @@ export class CDPConnection extends WebSocketConnection { /** * Send an event coming from a Domain to the CDP client. * - * @param {String} method + * @param {string} method * The event name. This is composed by a domain name, a dot character * followed by the event name, e.g. `Target.targetCreated`. - * @param {Object} params + * @param {object} params * A JSON-serializable object, which is the payload of this event. - * @param {String=} sessionId + * @param {string=} sessionId * The sessionId from which this packet is emitted. Falls back to the * default session if not specified. */ @@ -129,9 +129,9 @@ export class CDPConnection extends WebSocketConnection { /** * Interpret a given CDP packet for a given Session. * - * @param {String} sessionId + * @param {string} sessionId * ID of the session for which we should execute a command. - * @param {String} message + * @param {string} message * The stringified JSON payload of the CDP packet, which is about * executing a Domain's function. */ @@ -158,11 +158,11 @@ export class CDPConnection extends WebSocketConnection { /** * Send the result of a call to a Domain's function back to the CDP client. * - * @param {Number} id + * @param {number} id * The request id being sent by the client to call the domain's method. - * @param {Object} result + * @param {object} result * A JSON-serializable object, which is the actual result. - * @param {String=} sessionId + * @param {string=} sessionId * The sessionId from which this packet is emitted. Falls back to the * default session if not specified. */ @@ -208,7 +208,7 @@ export class CDPConnection extends WebSocketConnection { * This packet is sent by a CDP client and is meant to execute * a particular function on a given Domain. * - * @param {Object} packet + * @param {object} packet * JSON-serializable object sent by the client. */ async onPacket(packet) { @@ -269,10 +269,10 @@ export class CDPConnection extends WebSocketConnection { /** * Splits a CDP method into domain and command components. * - * @param {String} method + * @param {string} method * Name of the method to split, e.g. "Browser.getVersion". * - * @returns {Object} + * @returns {Object} * Object with the domain ("Browser") and command ("getVersion") * as properties. */ diff --git a/remote/cdp/Error.sys.mjs b/remote/cdp/Error.sys.mjs index b5f324ce357a..084d8c55f218 100644 --- a/remote/cdp/Error.sys.mjs +++ b/remote/cdp/Error.sys.mjs @@ -55,12 +55,12 @@ export class RemoteAgentError extends Error { * error serialisation to include discrete fields for each data * property. * - * @param {Object} json + * @param {object} json * CDP error encoded as a JSON object, which must have a * "message" field, where the first line will make out the error * message and the subsequent lines the stacktrace. * - * @return {RemoteAgentError} + * @returns {RemoteAgentError} */ static fromJSON(json) { const [message, ...stack] = json.message.split("\n"); diff --git a/remote/cdp/StreamRegistry.sys.mjs b/remote/cdp/StreamRegistry.sys.mjs index 1436998af94b..25be39260773 100644 --- a/remote/cdp/StreamRegistry.sys.mjs +++ b/remote/cdp/StreamRegistry.sys.mjs @@ -86,7 +86,7 @@ export class StreamRegistry { * @param {string} path * The path to the file to use as a stream. * - * @return {string} + * @returns {string} * Stream handle (uuid) */ add(stream) { @@ -110,7 +110,7 @@ export class StreamRegistry { * @param {string} handle * Handle of the stream to retrieve. * - * @return {Stream} + * @returns {Stream} * The requested stream. */ get(handle) { @@ -129,7 +129,7 @@ export class StreamRegistry { * @param {string} handle * Handle of the stream to remove. * - * @return {boolean} + * @returns {boolean} * true if successfully removed */ async remove(handle) { diff --git a/remote/cdp/domains/Domain.sys.mjs b/remote/cdp/domains/Domain.sys.mjs index e20f9aadbd3b..d9b36c62b8bf 100644 --- a/remote/cdp/domains/Domain.sys.mjs +++ b/remote/cdp/domains/Domain.sys.mjs @@ -34,9 +34,9 @@ export class Domain { * * This can only be called from parent domains managed by a TabSession. * - * @param {String} method + * @param {string} method * Name of the method to call on the child domain. - * @param {Object} params + * @param {object} params * Optional parameters. Must be serializable. */ executeInChild(method, params) { diff --git a/remote/cdp/domains/content/DOM.sys.mjs b/remote/cdp/domains/content/DOM.sys.mjs index 092d06f57b88..34c4e96ea995 100644 --- a/remote/cdp/domains/content/DOM.sys.mjs +++ b/remote/cdp/domains/content/DOM.sys.mjs @@ -27,7 +27,7 @@ export class DOM extends ContentProcessDomain { * * Does not require domain to be enabled. Does not start tracking any objects. * - * @param {Object} options + * @param {object} options * @param {number=} options.backendNodeId [not supported] * Identifier of the backend node. * @param {number=} options.depth [not supported] @@ -41,7 +41,7 @@ export class DOM extends ContentProcessDomain { * Whether or not iframes and shadow roots should be traversed * when returning the subtree, defaults to false. * - * @return {DOM.Node} + * @returns {DOM.Node} * Node description. */ describeNode(options = {}) { @@ -192,7 +192,7 @@ export class DOM extends ContentProcessDomain { /** * Resolves the JavaScript node object for a given NodeId or BackendNodeId. * - * @param {Object} options + * @param {object} options * @param {number} options.backendNodeId [required for now] * Backend identifier of the node to resolve. * @param {number=} options.executionContextId @@ -202,7 +202,7 @@ export class DOM extends ContentProcessDomain { * @param {string=} options.objectGroup [not supported] * Symbolic group name that can be used to release multiple objects. * - * @return {Runtime.RemoteObject} + * @returns {Runtime.RemoteObject} * JavaScript object wrapper for given node. */ resolveNode(options = {}) { diff --git a/remote/cdp/domains/content/Page.sys.mjs b/remote/cdp/domains/content/Page.sys.mjs index 5f833a910225..04c08c2b68f3 100644 --- a/remote/cdp/domains/content/Page.sys.mjs +++ b/remote/cdp/domains/content/Page.sys.mjs @@ -163,10 +163,10 @@ export class Page extends ContentProcessDomain { * At this time, queued scripts do not get evaluated, hence `source` is marked as * "unsupported". * - * @param {Object} options + * @param {object} options * @param {string} options.source (not supported) * @param {string=} options.worldName - * @return {string} Page.ScriptIdentifier + * @returns {string} Page.ScriptIdentifier */ addScriptToEvaluateOnNewDocument(options = {}) { const { source, worldName } = options; @@ -187,7 +187,7 @@ export class Page extends ContentProcessDomain { * * Really it just creates an execution context with label "isolated". * - * @param {Object} options + * @param {object} options * @param {string} options.frameId * Id of the frame in which the isolated world should be created. * @param {string=} options.worldName @@ -195,7 +195,7 @@ export class Page extends ContentProcessDomain { * @param {boolean=} options.grantUniversalAccess (not supported) * This is a powerful option, use with caution. * - * @return {number} Runtime.ExecutionContextId + * @returns {number} Runtime.ExecutionContextId * Execution context of the isolated world. */ createIsolatedWorld(options = {}) { @@ -234,7 +234,7 @@ export class Page extends ContentProcessDomain { /** * Controls whether page will emit lifecycle events. * - * @param {Object} options + * @param {object} options * @param {boolean} options.enabled * If true, starts emitting lifecycle events. */ @@ -297,7 +297,7 @@ export class Page extends ContentProcessDomain { } /** - * @param {Object=} options + * @param {object=} options * @param {number} options.windowId * The inner window id of the window the script has been loaded for. * @param {Window} options.window diff --git a/remote/cdp/domains/content/Runtime.sys.mjs b/remote/cdp/domains/content/Runtime.sys.mjs index 576166fee170..d3cd2fa53d8b 100644 --- a/remote/cdp/domains/content/Runtime.sys.mjs +++ b/remote/cdp/domains/content/Runtime.sys.mjs @@ -153,10 +153,10 @@ export class Runtime extends ContentProcessDomain { * * Object group of the result is inherited from the target object. * - * @param {Object} options + * @param {object} options * @param {string} options.functionDeclaration * Declaration of the function to call. - * @param {Array.=} options.arguments + * @param {Array.=} options.arguments * Call arguments. All call arguments must belong to the same * JavaScript world as the target object. * @param {boolean=} options.awaitPromise @@ -173,7 +173,7 @@ export class Runtime extends ContentProcessDomain { * Whether the result is expected to be a JSON object * which should be sent by value. * - * @return {Object.} + * @returns {Object} */ callFunctionOn(options = {}) { if (typeof options.functionDeclaration != "string") { @@ -237,7 +237,7 @@ export class Runtime extends ContentProcessDomain { /** * Evaluate expression on global object. * - * @param {Object} options + * @param {object} options * @param {string} options.expression * Expression to evaluate. * @param {boolean=} options.awaitPromise @@ -253,7 +253,7 @@ export class Runtime extends ContentProcessDomain { * @param {boolean=} options.userGesture [unsupported] * Whether execution should be treated as initiated by user in the UI. * - * @return {Object} + * @returns {Object} * The evaluation result, and optionally exception details. */ evaluate(options = {}) { @@ -473,7 +473,7 @@ export class Runtime extends ContentProcessDomain { * * @param {string} name * Event name - * @param {Object=} options + * @param {object=} options * @param {number} options.windowId * The inner window id of the newly instantiated document. * @param {Window} options.window @@ -485,7 +485,7 @@ export class Runtime extends ContentProcessDomain { * @param {string=} options.contextType * "default" or "isolated" * - * @return {number} ID of created context + * @returns {number} ID of created context * */ _onContextCreated(name, options = {}) { @@ -546,7 +546,7 @@ export class Runtime extends ContentProcessDomain { * * @param {string} name * Event name - * @param {Object=} options + * @param {object=} options * @param {number} id * The execution context id to destroy. * @param {number} windowId diff --git a/remote/cdp/domains/content/runtime/ExecutionContext.sys.mjs b/remote/cdp/domains/content/runtime/ExecutionContext.sys.mjs index d05bf53cd5b2..cf347f3dc5f2 100644 --- a/remote/cdp/domains/content/runtime/ExecutionContext.sys.mjs +++ b/remote/cdp/domains/content/runtime/ExecutionContext.sys.mjs @@ -121,7 +121,7 @@ export class ExecutionContext { /** * Evaluate a Javascript expression. * - * @param {String} expression + * @param {string} expression * The JS expression to evaluate against the JS context. * @param {boolean} options.awaitPromise * Whether execution should `await` for resulting value @@ -130,7 +130,7 @@ export class ExecutionContext { * Whether the result is expected to be a JSON object * that should be sent by value. * - * @return {Object} A multi-form object depending if the execution + * @returns {object} A multi-form object depending if the execution * succeed or failed. If the expression failed to evaluate, * it will return an object with an `exceptionDetails` attribute * matching the `ExceptionDetails` CDP type. Otherwise it will @@ -378,7 +378,7 @@ export class ExecutionContext { * * @param {Debugger.Object} debuggerObj * The object to serialize - * @return {RemoteObject} + * @returns {RemoteObject} * The serialized description of the given object */ _toRemoteObject(debuggerObj) { @@ -476,7 +476,7 @@ export class ExecutionContext { * * @param {Debugger.Object} debuggerObj * The object to serialize - * @return {RemoteObject} + * @returns {RemoteObject} * The serialized description of the given object */ _toRemoteObjectByValue(debuggerObj) { @@ -521,7 +521,7 @@ export class ExecutionContext { * @param {Debugger.Object} obj * The object to convert * - * @return {Object} + * @returns {object} * The converted object */ _serialize(debuggerObj) { diff --git a/remote/cdp/domains/parent/Emulation.sys.mjs b/remote/cdp/domains/parent/Emulation.sys.mjs index f5ce827f0eb9..8cb01b16ac57 100644 --- a/remote/cdp/domains/parent/Emulation.sys.mjs +++ b/remote/cdp/domains/parent/Emulation.sys.mjs @@ -31,7 +31,7 @@ export class Emulation extends Domain { * - window.innerHeight * - "device-width"/"device-height"-related CSS media query results * - * @param {Object} options + * @param {object} options * @param {number} options.width * Overriding width value in pixels. 0 disables the override. * @param {number} options.height @@ -97,7 +97,7 @@ export class Emulation extends Domain { /** * Enables touch on platforms which do not support them. * - * @param {Object} options + * @param {object} options * @param {boolean} options.enabled * Whether the touch event emulation should be enabled. * @param {number=} options.maxTouchPoints [not yet supported] @@ -123,7 +123,7 @@ export class Emulation extends Domain { /** * Allows overriding user agent with the given string. * - * @param {Object} options + * @param {object} options * @param {string} options.userAgent * User agent to use. * @param {string=} options.acceptLanguage [not yet supported] diff --git a/remote/cdp/domains/parent/IO.sys.mjs b/remote/cdp/domains/parent/IO.sys.mjs index 5ef347737175..e27b087514da 100644 --- a/remote/cdp/domains/parent/IO.sys.mjs +++ b/remote/cdp/domains/parent/IO.sys.mjs @@ -16,7 +16,7 @@ export class IO extends Domain { /** * Close the stream, discard any temporary backing storage. * - * @param {Object} options + * @param {object} options * @param {string} options.handle * Handle of the stream to close. */ @@ -33,7 +33,7 @@ export class IO extends Domain { /** * Read a chunk of the stream. * - * @param {Object} options + * @param {object} options * @param {string} options.handle * Handle of the stream to read. * @param {number=} options.offset @@ -44,7 +44,7 @@ export class IO extends Domain { * Maximum number of bytes to read (left upon the agent * discretion if not specified). * - * @return {string, boolean, boolean} + * @returns {string, boolean, boolean} * Data that were read, including flags for base64-encoded, and end-of-file reached. */ async read(options = {}) { diff --git a/remote/cdp/domains/parent/Input.sys.mjs b/remote/cdp/domains/parent/Input.sys.mjs index b3b7fd253bb5..4121298d5004 100644 --- a/remote/cdp/domains/parent/Input.sys.mjs +++ b/remote/cdp/domains/parent/Input.sys.mjs @@ -10,7 +10,7 @@ export class Input extends Domain { /** * Simulate key events. * - * @param {Object} options + * @param {object} options * - autoRepeat (not supported) * - code (not supported) * - key @@ -77,7 +77,7 @@ export class Input extends Domain { /** * Simulate mouse events. * - * @param {Object} options + * @param {object} options * @param {string} options.type * @param {number} options.x * @param {number} options.y diff --git a/remote/cdp/domains/parent/Network.sys.mjs b/remote/cdp/domains/parent/Network.sys.mjs index bccebe7aedae..8c1379593613 100644 --- a/remote/cdp/domains/parent/Network.sys.mjs +++ b/remote/cdp/domains/parent/Network.sys.mjs @@ -73,7 +73,7 @@ export class Network extends Domain { /** * Deletes browser cookies with matching name and url or domain/path pair. * - * @param {Object} options + * @param {object} options * @param {string} name * Name of the cookies to remove. * @param {string=} url @@ -127,7 +127,7 @@ export class Network extends Domain { /** * Activates emulation of network conditions. * - * @param {Object} options + * @param {object} options * @param {boolean} offline * True to emulate internet disconnection. */ @@ -146,9 +146,9 @@ export class Network extends Domain { * * Depending on the backend support, will return detailed cookie information in the cookies field. * - * @param {Object} options + * @param {object} options * - * @return {Array} + * @returns {Array} * Array of cookie objects. */ async getAllCookies(options = {}) { @@ -163,12 +163,12 @@ export class Network extends Domain { /** * Returns all browser cookies for the current URL. * - * @param {Object} options + * @param {object} options * @param {Array=} urls * The list of URLs for which applicable cookies will be fetched. * Defaults to the currently open URL. * - * @return {Array} + * @returns {Array} * Array of cookie objects. */ async getCookies(options = {}) { @@ -231,7 +231,7 @@ export class Network extends Domain { * * Note that it may overwrite equivalent cookies if they exist. * - * @param {Object} cookie + * @param {object} cookie * @param {string} name * Cookie name. * @param {string} value @@ -253,7 +253,7 @@ export class Network extends Domain { * This value can affect the default domain and path values of the * created cookie. * - * @return {boolean} + * @returns {boolean} * True if successfully set cookie. */ setCookie(cookie) { @@ -340,7 +340,7 @@ export class Network extends Domain { /** * Sets given cookies. * - * @param {Object} options + * @param {object} options * @param {Array.} cookies * Cookies to be set. */ @@ -362,7 +362,7 @@ export class Network extends Domain { /** * Toggles ignoring cache for each request. If true, cache will not be used. * - * @param {Object} options + * @param {object} options * @param {boolean} options.cacheDisabled * Cache disabled state. */ @@ -514,7 +514,7 @@ function _buildCookie(cookie) { * * @param {Array} headers * Array of {name, value} - * @returns {Object} + * @returns {object} * Object where each key is a header name. */ function headersAsObject(headers) { diff --git a/remote/cdp/domains/parent/Page.sys.mjs b/remote/cdp/domains/parent/Page.sys.mjs index 9c15a17da1d7..f031a34357ad 100644 --- a/remote/cdp/domains/parent/Page.sys.mjs +++ b/remote/cdp/domains/parent/Page.sys.mjs @@ -65,7 +65,7 @@ export class Page extends Domain { /** * Navigates current page to given URL. * - * @param {Object} options + * @param {object} options * @param {string} options.url * destination URL * @param {string=} options.frameId @@ -75,7 +75,7 @@ export class Page extends Domain { * referred URL (optional) * @param {string=} options.transitionType * intended transition type - * @return {Object} + * @returns {object} * - frameId {string} frame id that has navigated (or failed to) * - errorText {string=} error message if navigation has failed * - loaderId {string} (not supported) @@ -192,7 +192,7 @@ export class Page extends Domain { /** * Capture page screenshot. * - * @param {Object} options + * @param {object} options * @param {Viewport=} options.clip * Capture the screenshot of a given region only. * @param {string=} options.format @@ -200,7 +200,7 @@ export class Page extends Domain { * @param {number=} options.quality * Compression quality from range [0..100] (jpeg only). Defaults to 80. * - * @return {string} + * @returns {string} * Base64-encoded image data. */ async captureScreenshot(options = {}) { @@ -397,7 +397,7 @@ export class Page extends Domain { * {number} height * Height of scrollable area * - * @return {Promise} + * @returns {Promise} * @resolves {layoutViewport, visualViewport, contentSize} */ async getLayoutMetrics() { @@ -410,7 +410,7 @@ export class Page extends Domain { /** * Returns navigation history for the current page. * - * @return {currentIndex:number, entries:Array} + * @returns {currentIndex:number, entries:Array} */ async getNavigationHistory() { const { window } = this.session.target; @@ -446,7 +446,7 @@ export class Page extends Domain { * prompt) for this page. This will always close the dialog, either accepting * or rejecting it, with the optional prompt filled. * - * @param {Object} options + * @param {object} options * @param {boolean=} options.accept * for "confirm", "prompt", "beforeunload" dialogs true will accept * the dialog, false will cancel it. For "alert" dialogs, true or @@ -466,7 +466,7 @@ export class Page extends Domain { /** * Navigates current page to the given history entry. * - * @param {Object} options + * @param {object} options * @param {number} options.entryId * Unique id of the entry to navigate to. */ @@ -499,7 +499,7 @@ export class Page extends Domain { /** * Print page as PDF. * - * @param {Object} options + * @param {object} options * @param {boolean=} options.displayHeaderFooter * Display header and footer. Defaults to false. * @param {string=} options.footerTemplate (not supported) @@ -539,7 +539,7 @@ export class Page extends Domain { * Return as base64-encoded string (ReturnAsBase64), * or stream (ReturnAsStream). Defaults to ReturnAsBase64. * - * @return {Promise<{data:string, stream:Stream}>} + * @returns {Promise<{data:string, stream:Stream}>} * Based on the transferMode setting data is a base64-encoded string, * or stream is a Stream. */ @@ -668,7 +668,7 @@ export class Page extends Domain { * the native file chooser dialog is not shown. * Instead, a protocol event Page.fileChooserOpened is emitted. * - * @param {Object} options + * @param {object} options * @param {boolean=} options.enabled * Enabled state of file chooser interception. */ diff --git a/remote/cdp/domains/parent/Security.sys.mjs b/remote/cdp/domains/parent/Security.sys.mjs index 73967d73cba7..ab3987fc6655 100644 --- a/remote/cdp/domains/parent/Security.sys.mjs +++ b/remote/cdp/domains/parent/Security.sys.mjs @@ -31,7 +31,7 @@ export class Security extends Domain { /** * Enable/disable whether all certificate errors should be ignored * - * @param {Object} options + * @param {object} options * @param {boolean=} options.ignore * if true, all certificate errors will be ignored. */ diff --git a/remote/cdp/targets/TabTarget.sys.mjs b/remote/cdp/targets/TabTarget.sys.mjs index a3db99c0dd0a..c4aa1129c5b5 100644 --- a/remote/cdp/targets/TabTarget.sys.mjs +++ b/remote/cdp/targets/TabTarget.sys.mjs @@ -76,7 +76,7 @@ export class TabTarget extends Target { * We determine this by checking if the element * is still attached to the DOM. * - * @return {boolean} + * @returns {boolean} * True if target's browser is still attached, * false if it has been disconnected. */ @@ -92,7 +92,7 @@ export class TabTarget extends Target { return null; } - /** @return {Promise.} */ + /** @returns {Promise.} */ get faviconUrl() { return new Promise((resolve, reject) => { lazy.Favicons.getFaviconURLForPage(this.browser.currentURI, url => { diff --git a/remote/cdp/targets/TargetList.sys.mjs b/remote/cdp/targets/TargetList.sys.mjs index 64dd2b6947de..a68b36763f30 100644 --- a/remote/cdp/targets/TargetList.sys.mjs +++ b/remote/cdp/targets/TargetList.sys.mjs @@ -125,7 +125,7 @@ export class TargetList { * @param {string} id * Target id * - * @return {Target} + * @returns {Target} */ getById(id) { return this._targets.get(id); diff --git a/remote/cdp/test/browser/head.js b/remote/cdp/test/browser/head.js index 856285b4d1ba..aad0c5e3d424 100644 --- a/remote/cdp/test/browser/head.js +++ b/remote/cdp/test/browser/head.js @@ -368,7 +368,7 @@ function getContentProperty(prop) { /** * Retrieve all frames for the current tab as flattened list. * - * @return {Map} + * @returns {Map} * Flattened list of frames as Map */ async function getFlattenedFrameTree(client) { @@ -408,13 +408,13 @@ function fail(message) { * * @param {string} contents * Contents of the file. - * @param {Object} options + * @param {object} options * @param {string=} options.path * Path of the file. Defaults to the temporary directory. * @param {boolean=} options.remove * If true, automatically remove the file after the test. Defaults to true. * - * @return {Promise} + * @returns {Promise} */ async function createFileStream(contents, options = {}) { let { path = null, remove = true } = options; @@ -507,7 +507,7 @@ class RecordEvents { * The recording stops once we accumulate more than the expected * total of all configured events. * - * @param {Object} options + * @param {object} options * @param {CDPEvent} options.event * https://github.com/cyrus-and/chrome-remote-interface#clientdomaineventcallback * @param {string} options.eventName @@ -547,7 +547,7 @@ class RecordEvents { * to the timeline, along with an associated payload, if provided. * * @param {string} step - * @return {Function} callback + * @returns {Function} callback */ addPromise(step) { let callback; @@ -574,7 +574,7 @@ class RecordEvents { * @param {number=} timeout * Timeout in milliseconds. Defaults to 1000. * - * @return {Array<{ eventName, payload, index }>} Recorded events + * @returns {Array<{ eventName, payload, index }>} Recorded events */ async record(timeout = TIMEOUT_EVENTS) { await Promise.race([Promise.all(this.promises), timeoutPromise(timeout)]); @@ -589,7 +589,7 @@ class RecordEvents { * * @param {Function} predicate * - * @return {Array<{ eventName, payload, index }>} + * @returns {Array<{ eventName, payload, index }>} * The list of events matching the filter. */ filter(predicate) { @@ -601,7 +601,7 @@ class RecordEvents { * * @param {string} eventName * - * @return {{ eventName, payload, index }} The event, if any. + * @returns {{ eventName, payload, index }} The event, if any. */ findEvent(eventName) { const event = this.events.find(el => el.eventName == eventName); @@ -616,7 +616,7 @@ class RecordEvents { * * @param {string} eventName * - * @return {Array<{ eventName, payload, index }>} + * @returns {Array<{ eventName, payload, index }>} * The events, if any. */ findEvents(eventName) { @@ -628,7 +628,7 @@ class RecordEvents { * * @param {string} eventName * - * @return {number} The event index, -1 if not found. + * @returns {number} The event index, -1 if not found. */ indexOf(eventName) { const event = this.events.find(el => el.eventName == eventName); diff --git a/remote/cdp/test/browser/network/browser_emulateNetworkConditions.js b/remote/cdp/test/browser/network/browser_emulateNetworkConditions.js index bc6845b63a57..f69dcbe18ac1 100644 --- a/remote/cdp/test/browser/network/browser_emulateNetworkConditions.js +++ b/remote/cdp/test/browser/network/browser_emulateNetworkConditions.js @@ -20,6 +20,7 @@ registerCleanupFunction(() => { /** * Acts just as `add_task`, but does cleanup afterwards + * * @param taskFn */ function add_networking_task(taskFn) { diff --git a/remote/cdp/test/xpcshell/test_StreamRegistry.js b/remote/cdp/test/xpcshell/test_StreamRegistry.js index 55c84d0b4379..329f33d27522 100644 --- a/remote/cdp/test/xpcshell/test_StreamRegistry.js +++ b/remote/cdp/test/xpcshell/test_StreamRegistry.js @@ -124,13 +124,13 @@ add_task(async function test_removeForInvalidHandle() { * * @param {string} contents * Contents of the file. - * @param {Object} options + * @param {object} options * @param {string=} options.path * Path of the file. Defaults to the temporary directory. * @param {boolean=} options.remove * If true, automatically remove the file after the test. Defaults to true. * - * @return {Promise} + * @returns {Promise} */ async function createFileStream(contents, options = {}) { let { path = null, remove = true } = options; diff --git a/remote/components/RemoteAgent.sys.mjs b/remote/components/RemoteAgent.sys.mjs index b859d5771962..c51ebce88efe 100644 --- a/remote/components/RemoteAgent.sys.mjs +++ b/remote/components/RemoteAgent.sys.mjs @@ -157,7 +157,7 @@ class RemoteAgentParentProcess { * * @param {nsIURI} uri * The URI to check. - * @return {boolean} + * @returns {boolean} */ #isIPAddress(uri) { try { @@ -327,7 +327,7 @@ class RemoteAgentParentProcess { * @param {nsICommandLine} cmdLine * Instance of the command line interface. * - * @return {boolean} + * @returns {boolean} * Return `true` if the command line argument has been found. */ handleRemoteDebuggingPortFlag(cmdLine) { diff --git a/remote/marionette/accessibility.sys.mjs b/remote/marionette/accessibility.sys.mjs index 9302dc874fa9..c6b83b19303d 100644 --- a/remote/marionette/accessibility.sys.mjs +++ b/remote/marionette/accessibility.sys.mjs @@ -97,7 +97,7 @@ accessibility.get = function(strict = false) { * * @param {Document} doc * The document to wait for. - * @return {Promise} + * @returns {Promise} * A promise which resolves when the document's accessibility state is no * longer busy. */ @@ -130,7 +130,7 @@ function waitForDocumentAccessibility(doc) { * @param {Element} element * The element for which we need to retrieve the accessible. * - * @return {nsIAccessible|null} + * @returns {nsIAccessible|null} * The Accessible object corresponding to the provided element or null if * the accessibility service is not available. */ @@ -173,7 +173,7 @@ accessibility.Checks = class { * Flag indicating that the element must have an accessible object. * Defaults to not require this. * - * @return {Promise.} + * @returns {Promise.} * Promise with an accessibility object for the given element. */ async assertAccessible(element, mustHaveAccessible = false) { @@ -196,7 +196,7 @@ accessibility.Checks = class { * @param {nsIAccessible} accessible * Accessible object. * - * @return {boolean} + * @returns {boolean} * True if an actionable role is found on the accessible, false * otherwise. */ @@ -212,7 +212,7 @@ accessibility.Checks = class { * @param {nsIAccessible} accessible * Accessible object. * - * @return {boolean} + * @returns {boolean} * True if the accessible has at least one supported action, * false otherwise. */ @@ -226,7 +226,7 @@ accessibility.Checks = class { * @param {nsIAccessible} accessible * Accessible object. * - * @return {boolean} + * @returns {boolean} * True if the accessible has a non-empty valid name, or false if * this is not the case. */ @@ -240,7 +240,7 @@ accessibility.Checks = class { * @param {nsIAccessible} accessible * Accessible object. * - * @return {boolean} + * @returns {boolean} * True if the accessible object has a {@code hidden} attribute, * false otherwise. */ @@ -262,7 +262,7 @@ accessibility.Checks = class { * @param {number} stateToMatch * State to match. * - * @return {boolean} + * @returns {boolean} * True if |accessible| has |stateToMatch|, false otherwise. */ matchState(accessible, stateToMatch) { @@ -277,7 +277,7 @@ accessibility.Checks = class { * @param {nsIAccessible} accessible * Accessible object. * - * @return {boolean} + * @returns {boolean} * True if element is hidden from user, false otherwise. */ isHidden(accessible) { diff --git a/remote/marionette/actors/MarionetteCommandsChild.sys.mjs b/remote/marionette/actors/MarionetteCommandsChild.sys.mjs index c78eb5014a7e..df2555b4cd51 100644 --- a/remote/marionette/actors/MarionetteCommandsChild.sys.mjs +++ b/remote/marionette/actors/MarionetteCommandsChild.sys.mjs @@ -196,7 +196,7 @@ export class MarionetteCommandsChild extends JSWindowActorChild { /** Clear the text of an element. * - * @param {Object} options + * @param {object} options * @param {Element} options.elem */ clearElement(options = {}) { @@ -238,8 +238,8 @@ export class MarionetteCommandsChild extends JSWindowActorChild { * Find an element in the current browsing context's document using the * given search strategy. * - * @param {Object} options - * @param {Object} options.opts + * @param {object} options + * @param {object} options.opts * @param {Element} opts.startNode * @param {string} opts.strategy * @param {string} opts.selector @@ -258,8 +258,8 @@ export class MarionetteCommandsChild extends JSWindowActorChild { * Find elements in the current browsing context's document using the * given search strategy. * - * @param {Object} options - * @param {Object} options.opts + * @param {object} options + * @param {object} options.opts * @param {Element} opts.startNode * @param {string} opts.strategy * @param {string} opts.selector @@ -407,7 +407,7 @@ export class MarionetteCommandsChild extends JSWindowActorChild { * * Also it takes care of scrolling an element into view if requested. * - * @param {Object} options + * @param {object} options * @param {Element} options.elem * Optional element to take a screenshot of. * @param {boolean=} options.full @@ -417,7 +417,7 @@ export class MarionetteCommandsChild extends JSWindowActorChild { * When elem is given, scroll it into view. * Defaults to true. * - * @return {DOMRect} + * @returns {DOMRect} * The area to take a snapshot from. */ async getScreenshotRect(options = {}) { @@ -497,10 +497,10 @@ export class MarionetteCommandsChild extends JSWindowActorChild { /** * Perform a series of grouped actions at the specified points in time. * - * @param {Object} options - * @param {Object} options.actions + * @param {object} options + * @param {object} options.actions * Array of objects with each representing an action sequence. - * @param {Object} options.capabilities + * @param {object} options.capabilities * Object with a list of WebDriver session capabilities. */ async performActions(options = {}) { @@ -557,7 +557,7 @@ export class MarionetteCommandsChild extends JSWindowActorChild { /** * Switch to the specified frame. * - * @param {Object=} options + * @param {object=} options * @param {(number|Element)=} options.id * If it's a number treat it as the index for all the existing frames. * If it's an Element switch to this specific frame. diff --git a/remote/marionette/actors/MarionetteReftestChild.sys.mjs b/remote/marionette/actors/MarionetteReftestChild.sys.mjs index e1a9918af26b..59113293f7d9 100644 --- a/remote/marionette/actors/MarionetteReftestChild.sys.mjs +++ b/remote/marionette/actors/MarionetteReftestChild.sys.mjs @@ -68,12 +68,12 @@ export class MarionetteReftestChild extends JSWindowActorChild { * - if present, wait for the "reftest-wait" classname to be removed from the * document element * - * @param {Object} options - * @param {String} options.url + * @param {object} options + * @param {string} options.url * The expected test page URL - * @param {Boolean} options.useRemote + * @param {boolean} options.useRemote * True when using e10s - * @return {Boolean} + * @returns {boolean} * Returns true when the correct page is loaded and ready for * screenshots. Returns false if the page loaded bug does not have the * expected URL. @@ -173,8 +173,8 @@ export class MarionetteReftestChild extends JSWindowActorChild { /** * Ensure layout is flushed in each frame * - * @param {Object} options - * @param {Boolean} options.ignoreThrottledAnimations Don't flush + * @param {object} options + * @param {boolean} options.ignoreThrottledAnimations Don't flush * the layout of throttled animations. We can end up in a * situation where flushing a throttled animation causes * mozAfterPaint events even when all rendering we care about diff --git a/remote/marionette/actors/MarionetteReftestParent.sys.mjs b/remote/marionette/actors/MarionetteReftestParent.sys.mjs index f6d79f04d319..86d40aa65084 100644 --- a/remote/marionette/actors/MarionetteReftestParent.sys.mjs +++ b/remote/marionette/actors/MarionetteReftestParent.sys.mjs @@ -9,11 +9,11 @@ export class MarionetteReftestParent extends JSWindowActorParent { /** * Wait for the expected URL to be loaded. * - * @param {String} url + * @param {string} url * The expected url. - * @param {Boolean} useRemote + * @param {boolean} useRemote * True if tests are running with e10s. - * @return {Boolean} true if the page is fully loaded with the expected url, + * @returns {boolean} true if the page is fully loaded with the expected url, * false otherwise. */ async reftestWait(url, useRemote) { diff --git a/remote/marionette/addon.sys.mjs b/remote/marionette/addon.sys.mjs index 5ba1143e2888..fda9afcd50aa 100644 --- a/remote/marionette/addon.sys.mjs +++ b/remote/marionette/addon.sys.mjs @@ -55,7 +55,7 @@ export class Addon { * @param {boolean=} temporary * True to install the addon temporarily, false (default) otherwise. * - * @return {Promise.} + * @returns {Promise.} * Addon ID. * * @throws {UnknownError} @@ -100,7 +100,7 @@ export class Addon { * @param {string} id * ID of the addon to uninstall. * - * @return {Promise} + * @returns {Promise} * * @throws {UnknownError} * If there is a problem uninstalling the addon. diff --git a/remote/marionette/browser.sys.mjs b/remote/marionette/browser.sys.mjs index 223045eeca9a..6e663fcc6723 100644 --- a/remote/marionette/browser.sys.mjs +++ b/remote/marionette/browser.sys.mjs @@ -33,7 +33,7 @@ export class Context { * @param {string} s * Context string serialisation. * - * @return {Context} + * @returns {Context} * Context. * * @throws {TypeError} @@ -122,7 +122,7 @@ browser.Context = class { * browser, represented by the <xul:browser>, * has been detached. * - * @return {boolean} + * @returns {boolean} * True if browsing context has been discarded, false otherwise. */ get closed() { @@ -132,7 +132,7 @@ browser.Context = class { /** * Gets the position and dimensions of the top-level browsing context. * - * @return {Map.} + * @returns {Map.} * Object with |x|, |y|, |width|, and |height| properties. */ get rect() { @@ -164,7 +164,7 @@ browser.Context = class { /** * Close the current window. * - * @return {Promise} + * @returns {Promise} * A promise which is resolved when the current window has been closed. */ async closeWindow() { @@ -174,7 +174,7 @@ browser.Context = class { /** * Focus the current window. * - * @return {Promise} + * @returns {Promise} * A promise which is resolved when the current window has been focused. */ async focusWindow() { @@ -187,7 +187,7 @@ browser.Context = class { /** * Open a new browser window. * - * @return {Promise} + * @returns {Promise} * A promise resolving to the newly created chrome window. */ openBrowserWindow(focus = false, isPrivate = false) { @@ -201,7 +201,7 @@ browser.Context = class { /** * Close the current tab. * - * @return {Promise} + * @returns {Promise} * A promise which is resolved when the current tab has been closed. * * @throws UnsupportedOperationError @@ -285,7 +285,7 @@ browser.Context = class { * A boolean value which determins whether to focus * the window. Defaults to true. * - * @return {Tab} + * @returns {Tab} * The selected tab. * * @throws UnsupportedOperationError @@ -358,7 +358,7 @@ export const WindowState = { * @param {number} windowState * Attribute from {@link nsIDOMChromeWindow.windowState}. * - * @return {WindowState} + * @returns {WindowState} * JSON representation. * * @throws {TypeError} diff --git a/remote/marionette/cookie.sys.mjs b/remote/marionette/cookie.sys.mjs index 273a2d353c59..9de219643a9b 100644 --- a/remote/marionette/cookie.sys.mjs +++ b/remote/marionette/cookie.sys.mjs @@ -26,7 +26,7 @@ export const cookie = { /** * @name Cookie * - * @return {Object. + * @returns {Object. */ /** @@ -36,7 +36,7 @@ export const cookie = { * will produce the errors expected by WebDriver if the input is * not valid. * - * @param {Object.} json + * @param {Object} json * Cookie to be deserialised. ``name`` and ``value`` are required * fields which must be strings. The ``path`` and ``domain`` fields * are optional, but must be a string if provided. The ``secure``, @@ -44,7 +44,7 @@ export const cookie = { * Likewise, the ``expiry`` field is optional but must be * unsigned integer. * - * @return {Cookie} + * @returns {Cookie} * Valid cookie object. * * @throws {InvalidArgumentError} @@ -252,7 +252,7 @@ cookie.remove = function(toDelete) { * Optionally filter the cookies for ``host`` for the specific path. * Defaults to ``/``, meaning all cookies for ``host`` are included. * - * @return {Iterable.} + * @returns {Iterable.} * Iterator. */ cookie.iter = function*(host, currentPath = "/") { diff --git a/remote/marionette/driver.sys.mjs b/remote/marionette/driver.sys.mjs index 8e12a8a66dd0..a6252ed4f7ba 100644 --- a/remote/marionette/driver.sys.mjs +++ b/remote/marionette/driver.sys.mjs @@ -156,7 +156,7 @@ Object.defineProperty(GeckoDriver.prototype, "currentSession", { * Returns the current URL of the ChromeWindow or content browser, * depending on context. * - * @return {URL} + * @returns {URL} * Read-only property containing the currently loaded URL. */ Object.defineProperty(GeckoDriver.prototype, "currentURL", { @@ -170,7 +170,7 @@ Object.defineProperty(GeckoDriver.prototype, "currentURL", { * Returns the title of the ChromeWindow or content browser, * depending on context. * - * @return {string} + * @returns {string} * Read-only property containing the title of the loaded URL. */ Object.defineProperty(GeckoDriver.prototype, "title", { @@ -221,7 +221,7 @@ GeckoDriver.prototype._getCurrentURL = function() { /** * Get the current "MarionetteCommands" parent actor. * - * @param {Object} options + * @param {object} options * @param {boolean=} options.top * If set to true use the window's top-level browsing context for the actor, * otherwise the one from the currently selected frame. Defaults to false. @@ -238,7 +238,7 @@ GeckoDriver.prototype.getActor = function(options = {}) { /** * Get the selected BrowsingContext for the current context. * - * @param {Object} options + * @param {object} options * @param {Context=} options.context * Context (content or chrome) for which to retrieve the browsing context. * Defaults to the current one. @@ -249,7 +249,7 @@ GeckoDriver.prototype.getActor = function(options = {}) { * If set to true return the window's top-level browsing context, * otherwise the one from the currently selected frame. Defaults to false. * - * @return {BrowsingContext} + * @returns {BrowsingContext} * The browsing context, or `null` if none is available */ GeckoDriver.prototype.getBrowsingContext = function(options = {}) { @@ -280,14 +280,14 @@ GeckoDriver.prototype.getBrowsingContext = function(options = {}) { * window handle through {@link #switchToWindow}, or the first window that * was registered. * - * @param {Object} options + * @param {object} options * @param {Context=} options.context * Optional name of the context to use for finding the window. * It will be required if a command always needs a specific context, * whether which context is currently set. Defaults to the current * context. * - * @return {ChromeWindow} + * @returns {ChromeWindow} * The current top-level browsing context. */ GeckoDriver.prototype.getCurrentWindow = function(options = {}) { @@ -327,7 +327,7 @@ GeckoDriver.prototype.isReftestBrowser = function(element) { * @param {ChromeWindow} win * Window for which we will create a browsing context. * - * @return {string} + * @returns {string} * Returns the unique server-assigned ID of the window. */ GeckoDriver.prototype.addBrowser = function(win) { @@ -388,12 +388,12 @@ GeckoDriver.prototype.registerBrowser = function(browserElement) { /** * Create a new WebDriver session. * - * @param {Object} cmd - * @param {Object.=} cmd.parameters + * @param {object} cmd + * @param {Object=} cmd.parameters * JSON Object containing any of the recognised capabilities as listed * on the `WebDriverSession` class. * - * @return {Object} + * @returns {object} * Session ID and capabilities offered by the WebDriver service. * * @throws {SessionNotCreatedError} @@ -492,7 +492,7 @@ GeckoDriver.prototype.newSession = async function(cmd) { * * @param {ChromeWindow} win * Chrome window to register event listeners for. - * @param {Object=} options + * @param {object=} options * @param {boolean=} options.registerBrowsers * If true, register all content browsers of found tabs. Defaults to false. */ @@ -591,7 +591,7 @@ GeckoDriver.prototype.setContext = function(cmd) { * * The default browsing context is {@link Context.Content}. * - * @return {Context} + * @returns {Context} * Current context. */ GeckoDriver.prototype.getContext = function() { @@ -629,7 +629,7 @@ GeckoDriver.prototype.getContext = function() { * @param {number=} line * Line in the client's program where this script is evaluated. * - * @return {(string|boolean|number|object|WebReference)} + * @returns {(string|boolean|number|object|WebReference)} * Return value from the script, or null which signifies either the * JavaScript notion of null or undefined. * @@ -701,7 +701,7 @@ GeckoDriver.prototype.executeScript = function(cmd) { * @param {number=} line * Line in the client's program where this script is evaluated. * - * @return {(string|boolean|number|object|WebReference)} + * @returns {(string|boolean|number|object|WebReference)} * Return value from the script, or null which signifies either the * JavaScript notion of null or undefined. * @@ -870,7 +870,7 @@ GeckoDriver.prototype.getCurrentUrl = async function() { /** * Gets the current title of the window. * - * @return {string} + * @returns {string} * Document title of the top-level browsing context. * * @throws {NoSuchWindowError} @@ -888,7 +888,7 @@ GeckoDriver.prototype.getTitle = async function() { /** * Gets the current type of the window. * - * @return {string} + * @returns {string} * Type of window * * @throws {NoSuchWindowError} @@ -903,7 +903,7 @@ GeckoDriver.prototype.getWindowType = function() { /** * Gets the page source of the content document. * - * @return {string} + * @returns {string} * String serialisation of the DOM of the current browsing context's * active document. * @@ -1012,7 +1012,7 @@ GeckoDriver.prototype.refresh = async function() { * uniquely identifies it within this Marionette instance. This can * be used to switch to this window at a later point. * - * @return {string} + * @returns {string} * Unique window handle. * * @throws {NoSuchWindowError} @@ -1038,7 +1038,7 @@ GeckoDriver.prototype.getWindowHandle = function() { * Each window handle is assigned by the server and is guaranteed unique, * however the return array does not have a specified ordering. * - * @return {Array.} + * @returns {Array.} * Unique window handles. */ GeckoDriver.prototype.getWindowHandles = function() { @@ -1055,7 +1055,7 @@ GeckoDriver.prototype.getWindowHandles = function() { * window outerWidth and outerHeight values, which include scroll bars, * title bars, etc. * - * @return {Object.} + * @returns {Object} * Object with |x| and |y| coordinates, and |width| and |height| * of browser window. * @@ -1090,7 +1090,7 @@ GeckoDriver.prototype.getWindowRect = async function() { * @param {number} height * Height to resize the window to. * - * @return {Object.} + * @returns {Object} * Object with `x` and `y` coordinates and `width` and `height` * dimensions. * @@ -1233,7 +1233,7 @@ GeckoDriver.prototype.switchToWindow = async function(cmd) { * the registration is complete. If |focus| is true then set the focus * on the window. * - * @param {Object} winProperties + * @param {object} winProperties * Object containing window properties such as returned from * :js:func:`GeckoDriver#getWindowProperties` * @param {boolean=} focus @@ -1320,7 +1320,7 @@ GeckoDriver.prototype.switchToParentFrame = async function() { /** * Switch to a given frame within the current window. * - * @param {(string|Object)=} element + * @param {(string | object)=} element * A web element reference of the frame or its element id. * @param {number=} id * The index of the frame to switch to. @@ -1371,7 +1371,7 @@ GeckoDriver.prototype.getTimeouts = function() { /** * Set timeout for page loading, searching, and scripts. * - * @param {Object.} + * @param {Object} * Dictionary of timeout types and their new value, where all timeout * types are optional. * @@ -1460,7 +1460,7 @@ GeckoDriver.prototype.releaseActions = async function() { * @param {string} value * Value the client is looking for. * - * @return {WebElement} + * @returns {WebElement} * Return the found element. * * @throws {NoSuchElementError} @@ -1509,7 +1509,7 @@ GeckoDriver.prototype.findElement = async function(cmd) { * @param {string} value * Value the client is looking for. * - * @return {WebElement} + * @returns {WebElement} * Return the found element. * * @throws {DetachedShadowRootError} @@ -1557,7 +1557,7 @@ GeckoDriver.prototype.findElementFromShadowRoot = async function(cmd) { * @param {string} value * Value the client is looking for. * - * @return {Array} + * @returns {Array} * Return the array of found elements. * * @throws {NoSuchElementError} @@ -1606,7 +1606,7 @@ GeckoDriver.prototype.findElements = async function(cmd) { * @param {string} value * Value the client is looking for. * - * @return {Array} + * @returns {Array} * Return the array of found elements. * * @throws {DetachedShadowRootError} @@ -1646,7 +1646,7 @@ GeckoDriver.prototype.findElementsFromShadowRoot = async function(cmd) { * * @param {id} * A web element id reference. - * @return {ShadowRoot} + * @returns {ShadowRoot} * ShadowRoot of the element. * * @throws {InvalidArgumentError} @@ -1682,7 +1682,7 @@ GeckoDriver.prototype.getShadowRoot = async function(cmd) { /** * Return the active element in the document. * - * @return {WebReference} + * @returns {WebReference} * Active element of the current browsing context's document * element, if the document element is non-null. * @@ -1757,7 +1757,7 @@ GeckoDriver.prototype.clickElement = async function(cmd) { * @param {string} name * Name of the attribute which value to retrieve. * - * @return {string} + * @returns {string} * Value of the attribute. * * @throws {InvalidArgumentError} @@ -1790,7 +1790,7 @@ GeckoDriver.prototype.getElementAttribute = async function(cmd) { * @param {string} name * Name of the property which value to retrieve. * - * @return {string} + * @returns {string} * Value of the property. * * @throws {InvalidArgumentError} @@ -1822,7 +1822,7 @@ GeckoDriver.prototype.getElementProperty = async function(cmd) { * @param {string} id * Reference ID to the element that will be inspected. * - * @return {string} + * @returns {string} * Element's text "as rendered". * * @throws {InvalidArgumentError} @@ -1852,7 +1852,7 @@ GeckoDriver.prototype.getElementText = async function(cmd) { * @param {string} id * Reference ID to the element that will be inspected. * - * @return {string} + * @returns {string} * Local tag name of element. * * @throws {InvalidArgumentError} @@ -1882,7 +1882,7 @@ GeckoDriver.prototype.getElementTagName = async function(cmd) { * @param {string} id * Reference ID to the element that will be inspected. * - * @return {boolean} + * @returns {boolean} * True if displayed, false otherwise. * * @throws {InvalidArgumentError} @@ -1915,7 +1915,7 @@ GeckoDriver.prototype.isElementDisplayed = async function(cmd) { * @param {string} propertyName * CSS rule that is being requested. * - * @return {string} + * @returns {string} * Value of |propertyName|. * * @throws {InvalidArgumentError} @@ -1946,7 +1946,7 @@ GeckoDriver.prototype.getElementValueOfCssProperty = async function(cmd) { * @param {string} id * Reference ID to the element that will be checked. * - * @return {boolean} + * @returns {boolean} * True if enabled, false if disabled. * * @throws {InvalidArgumentError} @@ -1979,7 +1979,7 @@ GeckoDriver.prototype.isElementEnabled = async function(cmd) { * @param {string} id * Reference ID to the element that will be checked. * - * @return {boolean} + * @returns {boolean} * True if selected, false if unselected. * * @throws {InvalidArgumentError} @@ -2202,7 +2202,7 @@ GeckoDriver.prototype.deleteCookie = async function(cmd) { * new top-level browsing context should be a private window. * Defaults to false. * - * @return {Object.} + * @returns {Object} * Handle and type of the new browsing context. * * @throws {NoSuchWindowError} @@ -2278,7 +2278,7 @@ GeckoDriver.prototype.newWindow = async function(cmd) { * a shutdown of the application. Instead the returned list of window * handles is empty. * - * @return {Array.} + * @returns {Array.} * Unique window handles of remaining windows. * * @throws {NoSuchWindowError} @@ -2315,7 +2315,7 @@ GeckoDriver.prototype.close = async function() { * closed to prevent a shutdown of the application. Instead the returned * list of chrome window handles is empty. * - * @return {Array.} + * @returns {Array.} * Unique chrome window handles of remaining chrome windows. * * @throws {NoSuchWindowError} @@ -2413,7 +2413,7 @@ GeckoDriver.prototype.deleteSession = function() { * @param {boolean=} scroll * Scroll to element if |id| is provided. Defaults to true. * - * @return {string} + * @returns {string} * If hash is false, PNG image encoded as Base64 encoded * string. If hash is true, hex digest of the SHA-256 * hash of the Base64 encoded string. @@ -2517,7 +2517,7 @@ GeckoDriver.prototype.setScreenOrientation = async function(cmd) { * * Not supported on Fennec. * - * @return {Object.} + * @returns {Object} * Window rect and window state. * * @throws {NoSuchWindowError} @@ -2569,7 +2569,7 @@ GeckoDriver.prototype.minimizeWindow = async function() { * * Not supported on Fennec. * - * @return {Object.} + * @returns {Object} * Window rect. * * @throws {NoSuchWindowError} @@ -2621,7 +2621,7 @@ GeckoDriver.prototype.maximizeWindow = async function() { * * Not supported on Fennec. * - * @return {Map.} + * @returns {Map.} * Window rect. * * @throws {NoSuchWindowError} @@ -2853,7 +2853,7 @@ GeckoDriver.prototype.acceptConnections = function(cmd) { * Optional flag to indicate that the application has to * be restarted in safe mode. * - * @return {Object} + * @returns {Object} * Dictionary containing information that explains the shutdown reason. * The value for `cause` contains the shutdown kind like "shutdown" or * "restart", while `forced` will indicate if it was a normal or forced @@ -2981,7 +2981,7 @@ GeckoDriver.prototype.uninstallAddon = function(cmd) { * @param {string} id * The ID of the entity to retrieve the localized string for. * - * @return {string} + * @returns {string} * The localized string for the requested entity. */ GeckoDriver.prototype.localizeEntity = function(cmd) { @@ -3014,7 +3014,7 @@ GeckoDriver.prototype.localizeEntity = function(cmd) { * @param {string} id * The ID of the property to retrieve the localized string for. * - * @return {string} + * @returns {string} * The localized string for the requested property. */ GeckoDriver.prototype.localizeProperty = function(cmd) { @@ -3139,7 +3139,7 @@ GeckoDriver.prototype.teardownReftest = function() { * Defaults to true, in which case the content will be scaled * to fit the paper size. * - * @return {string} + * @returns {string} * Base64 encoded PDF representing printed document * * @throws {NoSuchWindowError} @@ -3218,7 +3218,7 @@ GeckoDriver.prototype.setPermission = async function(cmd) { * Web element reference ID to the element for which the accessibility label * will be returned. * - * @return {string} + * @returns {string} * The Accessibility label for this element */ GeckoDriver.prototype.getComputedLabel = async function(cmd) { @@ -3238,7 +3238,7 @@ GeckoDriver.prototype.getComputedLabel = async function(cmd) { * Web element reference ID to the element for which the accessibility role * will be returned. * - * @return {string} + * @returns {string} * The Accessibility role for this element */ GeckoDriver.prototype.getComputedRole = async function(cmd) { diff --git a/remote/marionette/element.sys.mjs b/remote/marionette/element.sys.mjs index 7d6a71aabd7f..1a465c1afe42 100644 --- a/remote/marionette/element.sys.mjs +++ b/remote/marionette/element.sys.mjs @@ -71,14 +71,14 @@ element.Strategy = { * See the {@link element.Strategy} enum for a full list of supported * search strategies that can be passed to strategy. * - * @param {Object.} container + * @param {Object} container * Window object. * @param {string} strategy * Search strategy whereby to locate the element(s). * @param {string} selector * Selector search pattern. The selector must be compatible with * the chosen search strategy. - * @param {Object=} options + * @param {object=} options * @param {boolean=} all * If true, a multi-element search selector is used and a sequence of * elements will be returned, otherwise a single element. Defaults to false. @@ -89,7 +89,7 @@ element.Strategy = { * is false, a {@link NoSuchElementError} is thrown if unable to * find the element within the timeout duration. * - * @return {Promise.<(Element|Array.)>} + * @returns {Promise.<(Element|Array.)>} * Single element or a sequence of elements. * * @throws InvalidSelectorError @@ -189,7 +189,7 @@ function find_( * @param {string} expression * XPath search expression. * - * @return {Node} + * @returns {Node} * First element matching expression. */ element.findByXPath = function(document, startNode, expression) { @@ -213,7 +213,7 @@ element.findByXPath = function(document, startNode, expression) { * @param {string} expression * XPath search expression. * - * @return {Iterable.} + * @returns {Iterable.} * Iterator over nodes matching expression. */ element.findByXPathAll = function*(document, startNode, expression) { @@ -240,7 +240,7 @@ element.findByXPathAll = function*(document, startNode, expression) { * @param {string} linkText * Link text to search for. * - * @return {Iterable.} + * @returns {Iterable.} * Sequence of link elements which text is s. */ element.findByLinkText = function(startNode, linkText) { @@ -259,7 +259,7 @@ element.findByLinkText = function(startNode, linkText) { * @param {string} linkText * Link text to search for. * - * @return {Iterable.} + * @returns {Iterable.} * Iterator of link elements which text containins * linkText. */ @@ -279,7 +279,7 @@ element.findByPartialLinkText = function(startNode, linkText) { * Function that determines if given link should be included in * return value or filtered away. * - * @return {Iterable.} + * @returns {Iterable.} * Iterator of link elements matching predicate. */ function* filterLinks(startNode, predicate) { @@ -304,7 +304,7 @@ function* filterLinks(startNode, predicate) { * @param {Element=} startNode * Optional Element from which to start searching. * - * @return {Element} + * @returns {Element} * Found element. * * @throws {InvalidSelectorError} @@ -384,7 +384,7 @@ function findElement(strategy, selector, document, startNode = undefined) { * @param {Element=} startNode * Optional Element from which to start searching. * - * @return {Array.} + * @returns {Array.} * Found elements. * * @throws {InvalidSelectorError} @@ -453,7 +453,7 @@ function getLinks(startNode) { * @param {string} selector * CSS selector expression. * - * @return {Node=} + * @returns {Node=} * First match to selector, or null if no match was found. */ element.findClosest = function(startNode, selector) { @@ -566,10 +566,10 @@ element.getKnownShadowRoot = function(browsingContext, nodeId, nodeCache) { /** * Determines if obj is an HTML or JS collection. * - * @param {Object} seq + * @param {object} seq * Type to determine. * - * @return {boolean} + * @returns {boolean} * True if seq is a collection. */ element.isCollection = function(seq) { @@ -599,7 +599,7 @@ element.isCollection = function(seq) { * @param {ShadowRoot} shadowRoot * ShadowRoot to check for detached state. * - * @return {boolean} + * @returns {boolean} * True if shadowRoot is detached, false otherwise. */ element.isDetached = function(shadowRoot) { @@ -650,7 +650,7 @@ element.isNodeReferenceKnown = function(browsingContext, nodeId, nodeCache) { * @param {Element} el * Element to check for staleness. * - * @return {boolean} + * @returns {boolean} * True if el is stale, false otherwise. */ element.isStale = function(el) { @@ -673,7 +673,7 @@ element.isStale = function(el) { * @param {Element} el * Element to test if selected. * - * @return {boolean} + * @returns {boolean} * True if element is selected, false otherwise. */ element.isSelected = function(el) { @@ -706,7 +706,7 @@ element.isSelected = function(el) { * @param {Element} el * Element to test is read only. * - * @return {boolean} + * @returns {boolean} * True if element is read only. */ element.isReadOnly = function(el) { @@ -725,7 +725,7 @@ element.isReadOnly = function(el) { * @param {Element} el * Element to test for disabledness. * - * @return {boolean} + * @returns {boolean} * True if element, or its container group, is disabled. */ element.isDisabled = function(el) { @@ -765,7 +765,7 @@ element.isDisabled = function(el) { * @param {Element} el * Element to test. * - * @return {boolean} + * @returns {boolean} * True if editable, false otherwise. */ element.isMutableFormControl = function(el) { @@ -815,7 +815,7 @@ element.isMutableFormControl = function(el) { * @param {Element} el * Element to determine if is an editing host. * - * @return {boolean} + * @returns {boolean} * True if editing host, false otherwise. */ element.isEditingHost = function(el) { @@ -846,7 +846,7 @@ element.isEditingHost = function(el) { * @param {Element} * Element to test if editable. * - * @return {boolean} + * @returns {boolean} * True if editable, false otherwise. */ element.isEditable = function(el) { @@ -875,7 +875,7 @@ element.isEditable = function(el) { * Vertical offset relative to target's top-left corner. Defaults to * the centre of the target's bounding box. * - * @return {Object.} + * @returns {Object} * X- and Y coordinates. * * @throws TypeError @@ -913,7 +913,7 @@ element.coordinates = function(node, xOffset = undefined, yOffset = undefined) { * Vertical offset relative to target. Defaults to the centre of * the target's bounding box. * - * @return {boolean} + * @returns {boolean} * True if if el is in viewport, false otherwise. */ element.inViewport = function(el, x = undefined, y = undefined) { @@ -949,7 +949,7 @@ element.inViewport = function(el, x = undefined, y = undefined) { * @param {Element} el * Element to get the container of. * - * @return {Element} + * @returns {Element} * Container element of el. */ element.getContainer = function(el) { @@ -980,7 +980,7 @@ element.getContainer = function(el) { * @param {Element} el * Element to check if is in view. * - * @return {boolean} + * @returns {boolean} * True if el is inside the viewport, or false otherwise. */ element.isInView = function(el) { @@ -1007,7 +1007,7 @@ element.isInView = function(el) { * * The generated uuid will not contain the curly braces. * - * @return {string} + * @returns {string} * UUID. */ element.generateUUID = function() { @@ -1030,7 +1030,7 @@ element.generateUUID = function() { * Vertical offset relative to target. Defaults to the centre of * the target's bounding box. * - * @return {boolean} + * @returns {boolean} * True if visible, false otherwise. */ element.isVisible = function(el, x = undefined, y = undefined) { @@ -1066,7 +1066,7 @@ element.isVisible = function(el, x = undefined, y = undefined) { * @param {DOMElement} el * Element determine if is pointer-interactable. * - * @return {boolean} + * @returns {boolean} * True if element is obscured, false otherwise. */ element.isObscured = function(el) { @@ -1099,7 +1099,7 @@ element.isObscured = function(el) { * @param {WindowProxy} win * Current window global. * - * @return {Map.} + * @returns {Map.} * X and Y coordinates that denotes the in-view centre point of * `rect`. */ @@ -1135,7 +1135,7 @@ element.getInViewCentrePoint = function(rect, win) { * @param {DOMElement} el * Element to determine if is pointer-interactable. * - * @return {Array.} + * @returns {Array.} * Sequence of elements in paint order. */ element.getPointerInteractablePaintTree = function(el) { @@ -1180,11 +1180,11 @@ element.scrollIntoView = function(el) { /** * Ascertains whether obj is a DOM-, SVG-, or XUL element. * - * @param {Object} obj + * @param {object} obj * Object thought to be an Element or * XULElement. * - * @return {boolean} + * @returns {boolean} * True if obj is an element, false otherwise. */ element.isElement = function(obj) { @@ -1227,10 +1227,10 @@ element.isShadowRoot = function(node) { /** * Ascertains whether obj is a DOM element. * - * @param {Object} obj + * @param {object} obj * Object to check. * - * @return {boolean} + * @returns {boolean} * True if obj is a DOM element, false otherwise. */ element.isDOMElement = function(obj) { @@ -1240,10 +1240,10 @@ element.isDOMElement = function(obj) { /** * Ascertains whether obj is a XUL element. * - * @param {Object} obj + * @param {object} obj * Object to check. * - * @return {boolean} + * @returns {boolean} * True if obj is a XULElement, false otherwise. */ element.isXULElement = function(obj) { @@ -1256,7 +1256,7 @@ element.isXULElement = function(obj) { * @param {Node} node * Node to check. * - * @return {boolean} + * @returns {boolean} * True if node is in a privileged document, * false otherwise. */ @@ -1267,10 +1267,10 @@ element.isInPrivilegedDocument = function(node) { /** * Ascertains whether obj is a WindowProxy. * - * @param {Object} obj + * @param {object} obj * Object to check. * - * @return {boolean} + * @returns {boolean} * True if obj is a DOM window. */ element.isDOMWindow = function(obj) { @@ -1324,7 +1324,7 @@ const boolEls = { * @param {string} attr * Attribute to test is a boolean attribute. * - * @return {boolean} + * @returns {boolean} * True if the attribute is boolean, false otherwise. */ element.isBooleanAttribute = function(el, attr) { @@ -1369,7 +1369,7 @@ export class WebReference { * @param {WebReference} other * Web element to compare with this. * - * @return {boolean} + * @returns {boolean} * True if this and other are the same. False * otherwise. */ @@ -1391,7 +1391,7 @@ export class WebReference { * Optional unique identifier of the WebReference if already known. * If not defined a new unique identifier will be created. * - * @return {WebReference)} + * @returns {WebReference)} * Web reference for node. * * @throws {InvalidArgumentError} @@ -1426,12 +1426,12 @@ export class WebReference { * Unmarshals a JSON Object to one of {@link ShadowRoot}, {@link WebElement}, * {@link WebFrame}, or {@link WebWindow}. * - * @param {Object.} json + * @param {Object} json * Web reference, which is supposed to be a JSON Object * where the key is one of the {@link WebReference} concrete * classes' UUID identifiers. * - * @return {WebReference} + * @returns {WebReference} * Web reference for the JSON object. * * @throws {InvalidArgumentError} @@ -1468,10 +1468,10 @@ export class WebReference { /** * Checks if obj is a {@link WebReference} reference. * - * @param {Object.} obj + * @param {Object} obj * Object that represents a {@link WebReference}. * - * @return {boolean} + * @returns {boolean} * True if obj is a {@link WebReference}, false otherwise. */ static isReference(obj) { @@ -1523,7 +1523,7 @@ export class WebElement extends WebReference { * @param {string} uuid * UUID to be associated with the web reference. * - * @return {WebElement} + * @returns {WebElement} * The web element reference. * * @throws {InvalidArgumentError} @@ -1568,7 +1568,7 @@ export class ShadowRoot extends WebReference { * @param {string} uuid * UUID to be associated with the web reference. * - * @return {ShadowRoot} + * @returns {ShadowRoot} * The shadow root reference. * * @throws {InvalidArgumentError} diff --git a/remote/marionette/evaluate.sys.mjs b/remote/marionette/evaluate.sys.mjs index a43908e7ad2f..293fbf648b0f 100644 --- a/remote/marionette/evaluate.sys.mjs +++ b/remote/marionette/evaluate.sys.mjs @@ -62,7 +62,7 @@ export const evaluate = {}; * @param {number=} [timeout=DEFAULT_TIMEOUT] timeout * Duration in milliseconds before interrupting the script. * - * @return {Promise} + * @returns {Promise} * A promise that when resolved will give you the return value from * the script. Note that the return value requires serialisation before * it can be sent to the client. @@ -170,7 +170,7 @@ evaluate.sandbox = function( * was assosciated with and extension popup. This provides a way to * still test for a dead object. * - * @param {Object} obj + * @param {object} obj * A potentially dead object. * @param {string} prop * Name of a property on the object. @@ -210,11 +210,11 @@ sandbox.cloneInto = function(obj, sb) { * * @param {Sandbox} sb * The sandbox to augment. - * @param {Object} adapter + * @param {object} adapter * Object that holds an `exports` property, or a map, of function * names and function references. * - * @return {Sandbox} + * @returns {Sandbox} * The augmented sandbox. */ sandbox.augment = function(sb, adapter) { @@ -241,7 +241,7 @@ sandbox.augment = function(sb, adapter) { * An optional, custom principal to prefer over the Window. Useful if * you need elevated security permissions. * - * @return {Sandbox} + * @returns {Sandbox} * The created sandbox. */ sandbox.create = function(win, principal = null, opts = {}) { @@ -266,7 +266,7 @@ sandbox.create = function(win, principal = null, opts = {}) { * @param {Window} win * The DOM Window object. * - * @return {Sandbox} + * @returns {Sandbox} * The created sandbox. */ sandbox.createMutable = function(win) { @@ -326,7 +326,7 @@ export class Sandboxes { * @param {boolean=} [fresh=false] fresh * Remove old sandbox by name first, if it exists. * - * @return {Sandbox} + * @returns {Sandbox} * A used or fresh sandbox. */ get(name = "default", fresh = false) { diff --git a/remote/marionette/event.sys.mjs b/remote/marionette/event.sys.mjs index 731076d09d63..45570d3cb0b7 100644 --- a/remote/marionette/event.sys.mjs +++ b/remote/marionette/event.sys.mjs @@ -111,14 +111,14 @@ event.parseModifiers_ = function(modifiers, win) { * Offset from viewport left, in CSS pixels * @param {number} top * Offset from viewport top, in CSS pixels - * @param {Object} opts + * @param {object} opts * Object which may contain the properties "shiftKey", "ctrlKey", * "altKey", "metaKey", "accessKey", "clickCount", "button", and * "type". * @param {Window} win * Window object. * - * @return {boolean} defaultPrevented + * @returns {boolean} defaultPrevented */ event.synthesizeMouseAtPoint = function(left, top, opts, win) { return _getEventUtils(win).synthesizeMouseAtPoint(left, top, opts, win); @@ -134,14 +134,14 @@ event.synthesizeMouseAtPoint = function(left, top, opts, win) { * Offset from viewport left, in CSS pixels * @param {number} top * Offset from viewport top, in CSS pixels - * @param {Object} opts + * @param {object} opts * Object which may contain the properties "id", "rx", "ry", "angle", * "force", "shiftKey", "ctrlKey", "altKey", "metaKey", "accessKey", * "type". * @param {Window} win * Window object. * - * @return {boolean} defaultPrevented + * @returns {boolean} defaultPrevented */ event.synthesizeTouchAtPoint = function(left, top, opts, win) { return _getEventUtils(win).synthesizeTouchAtPoint(left, top, opts, win); @@ -154,7 +154,7 @@ event.synthesizeTouchAtPoint = function(left, top, opts, win) { * Offset from viewport left, in CSS pixels * @param {number} top * Offset from viewport top, in CSS pixels - * @param {Object} opts + * @param {object} opts * Object which may contain the properties "shiftKey", "ctrlKey", * "altKey", "metaKey", "accessKey", "deltaX", "deltaY", "deltaZ", * "deltaMode", "lineOrPageDeltaX", "lineOrPageDeltaY", "isMomentum", @@ -188,7 +188,7 @@ event.synthesizeMultiTouch = function(opts, win) { /** * Synthesize a keydown event for a single key. * - * @param {Object} key + * @param {object} key * Key data as returned by keyData.getData * @param {Window} win * Window object. @@ -200,7 +200,7 @@ event.sendKeyDown = function(key, win) { /** * Synthesize a keyup event for a single key. * - * @param {Object} key + * @param {object} key * Key data as returned by keyData.getData * @param {Window} win * Window object. @@ -212,7 +212,7 @@ event.sendKeyUp = function(key, win) { /** * Synthesize a key event for a single key. * - * @param {Object} key + * @param {object} key * Key data as returned by keyData.getData * @param {Window} win * Window object. diff --git a/remote/marionette/interaction.sys.mjs b/remote/marionette/interaction.sys.mjs index 320caee5aae5..c029ae01453d 100644 --- a/remote/marionette/interaction.sys.mjs +++ b/remote/marionette/interaction.sys.mjs @@ -392,7 +392,7 @@ function clearResettableElement(el) { * @param {Element} el * Element that is expected to receive the click. * - * @return {Promise} + * @returns {Promise} * Promise is resolved once el has been clicked * (its click event fires), the document is unloaded, * or a 500 ms timeout is reached. @@ -469,7 +469,7 @@ interaction.moveCaretToEnd = function(el) { * @param {Element} el * Element to check. * - * @return {boolean} + * @returns {boolean} * True if element is keyboard-interactable, false otherwise. */ interaction.isKeyboardInteractable = function(el) { @@ -688,7 +688,7 @@ async function legacySendKeysToElement(el, value, a11y) { * @param {boolean=} [strict=false] strict * Enforce strict accessibility tests. * - * @return {boolean} + * @returns {boolean} * True if element is displayed, false otherwise. */ interaction.isElementDisplayed = function(el, strict = false) { @@ -708,7 +708,7 @@ interaction.isElementDisplayed = function(el, strict = false) { * @param {DOMElement|XULElement} el * Element to test if is enabled. * - * @return {boolean} + * @returns {boolean} * True if enabled, false otherwise. */ interaction.isElementEnabled = function(el, strict = false) { @@ -752,7 +752,7 @@ interaction.isElementEnabled = function(el, strict = false) { * @param {boolean=} [strict=false] strict * Enforce strict accessibility tests. * - * @return {boolean} + * @returns {boolean} * True if element is selected, false otherwise. * * @throws {ElementNotAccessibleError} diff --git a/remote/marionette/json.sys.mjs b/remote/marionette/json.sys.mjs index 1fd3c8fea7f1..9c0ce61f538e 100644 --- a/remote/marionette/json.sys.mjs +++ b/remote/marionette/json.sys.mjs @@ -26,7 +26,7 @@ export const json = {}; /** * Clone an object including collections. * - * @param {Object} value + * @param {object} value * Object to be cloned. * @param {Set} seen * List of objects already processed. @@ -34,7 +34,7 @@ export const json = {}; * The clone algorithm to invoke for individual list entries or object * properties. * - * @return {Object} + * @returns {object} * The cloned object. */ function cloneObject(value, seen, cloneAlgorithm) { @@ -90,12 +90,12 @@ function cloneObject(value, seen, cloneAlgorithm) { * * - If a cyclic references is detected a JavaScriptError is thrown. * - * @param {Object} value + * @param {object} value * Object to be cloned. * @param {NodeCache} nodeCache * Node cache that holds already seen WebElement and ShadowRoot references. * - * @return {Object} + * @returns {object} * Same object as provided by `value` with the WebDriver specific * elements replaced by WebReference's. * @@ -183,14 +183,14 @@ json.clone = function(value, nodeCache) { /** * Deserialize an arbitrary object. * - * @param {Object} value + * @param {object} value * Arbitrary object. * @param {NodeCache} nodeCache * Node cache that holds already seen WebElement and ShadowRoot references. * @param {WindowProxy} win * Current window. * - * @return {Object} + * @returns {object} * Same object as provided by `value` with the WebDriver specific * references replaced with real JavaScript objects. * diff --git a/remote/marionette/l10n.sys.mjs b/remote/marionette/l10n.sys.mjs index 132b30c6ad7a..83e44e2de31e 100644 --- a/remote/marionette/l10n.sys.mjs +++ b/remote/marionette/l10n.sys.mjs @@ -41,7 +41,7 @@ export const l10n = {}; * @param {string} id * The ID of the entity to retrieve the localized string for. * - * @return {string} + * @returns {string} * The localized string for the requested entity. */ l10n.localizeEntity = function(urls, id) { @@ -79,7 +79,7 @@ l10n.localizeEntity = function(urls, id) { * @param {string} id * The ID of the property to retrieve the localized string for. * - * @return {string} + * @returns {string} * The localized string for the requested property. */ l10n.localizeProperty = function(urls, id) { diff --git a/remote/marionette/legacyaction.sys.mjs b/remote/marionette/legacyaction.sys.mjs index ce98acda5dc1..e552fc64d6a7 100644 --- a/remote/marionette/legacyaction.sys.mjs +++ b/remote/marionette/legacyaction.sys.mjs @@ -57,11 +57,11 @@ action.Chain = function() { * * @param {Element} elem * The Element on which the touch event should be created. - * @param {Number} x + * @param {number} x * x coordinate relative to the viewport. - * @param {Number} y + * @param {number} y * y coordinate relative to the viewport. - * @param {Number} touchId + * @param {number} touchId * Touch event id used by legacyactions. */ action.Chain.prototype.createATouch = function(elem, x, y, touchId) { @@ -132,7 +132,7 @@ action.Chain.prototype.dispatchActions = function( * X coordinate of the mouse relative to the viewport. * @param {number} elClientY * Y coordinate of the mouse relative to the viewport. - * @param {Object} modifiers + * @param {object} modifiers * An object of modifier keys present. */ action.Chain.prototype.emitMouseEvent = function( @@ -262,16 +262,16 @@ action.Chain.prototype.singleTap = async function( * * @param {Array.>} chain * A multi-dimensional array of actions. - * @param {Object.} touchId + * @param {Object} touchId * Represents the finger ID. * @param {number} i * Keeps track of the current action of the chain. - * @param {Object.} keyModifiers + * @param {Object} keyModifiers * Keeps track of keyDown/keyUp pairs through an action chain. * @param {function(?)} cb * Called on success. * - * @return {Object.} + * @returns {Object} * Last finger ID, or an empty object. */ action.Chain.prototype.actions = function(chain, touchId, i, keyModifiers, cb) { diff --git a/remote/marionette/message.sys.mjs b/remote/marionette/message.sys.mjs index 35b8620e3c5a..32b0b41b7567 100644 --- a/remote/marionette/message.sys.mjs +++ b/remote/marionette/message.sys.mjs @@ -39,7 +39,7 @@ export class Message { * message type, message ID, method name or error, and parameters * or result. * - * @return {Message} + * @returns {Message} * Based on the message type, a {@link Command} or {@link Response} * instance. * @@ -128,7 +128,7 @@ Message.Origin = { * Message ID unique identifying this message. * @param {string} name * Command name. - * @param {Object.} params + * @param {Object} params * Command parameters. */ export class Command extends Message { @@ -164,7 +164,7 @@ export class Command extends Message { /** * Encodes the command to a packet. * - * @return {Array} + * @returns {Array} * Packet. */ toPacket() { @@ -178,7 +178,7 @@ export class Command extends Message { * A four element array where the elements, in sequence, signifies * message type, message ID, command name, and parameters. * - * @return {Command} + * @returns {Command} * Representation of packet. * * @throws {TypeError} @@ -294,7 +294,7 @@ export class Response extends Message { /** * Encodes the response to a packet. * - * @return {Array} + * @returns {Array} * Packet. */ toPacket() { @@ -308,7 +308,7 @@ export class Response extends Message { * A four element array where the elements, in sequence, signifies * message type, message ID, error, and result. * - * @return {Response} + * @returns {Response} * Representation of packet. * * @throws {TypeError} diff --git a/remote/marionette/modal.sys.mjs b/remote/marionette/modal.sys.mjs index 98eef0495e2c..c81f0553cb3b 100644 --- a/remote/marionette/modal.sys.mjs +++ b/remote/marionette/modal.sys.mjs @@ -29,7 +29,7 @@ export const modal = { * @param {browser.Context} context * Reference to the browser context to check for existent dialogs. * - * @return {modal.Dialog} + * @returns {modal.Dialog} * Returns instance of the Dialog class, or `null` if no modal dialog * is present. */ @@ -101,7 +101,7 @@ modal.findModalDialogs = function(context) { * @param {function(): browser.Context} curBrowserFn * Function that returns the current |browser.Context|. * - * @return {modal.DialogObserver} + * @returns {modal.DialogObserver} * Returns instance of the DialogObserver class. */ modal.DialogObserver = class { @@ -227,7 +227,7 @@ modal.DialogObserver = class { /** * Add dialog handler by function reference. * - * @param {function} callback + * @param {Function} callback * The handler to be added. */ add(callback) { @@ -240,7 +240,7 @@ modal.DialogObserver = class { /** * Remove dialog handler by function reference. * - * @param {function} callback + * @param {Function} callback * The handler to be removed. */ remove(callback) { diff --git a/remote/marionette/navigate.sys.mjs b/remote/marionette/navigate.sys.mjs index ede81fb3dafc..e4047c54bdeb 100644 --- a/remote/marionette/navigate.sys.mjs +++ b/remote/marionette/navigate.sys.mjs @@ -44,7 +44,7 @@ export const navigate = {}; * @param {string} eventData.readyState * Current ready state of the document. * - * @return {boolean} + * @returns {boolean} * True if the page load has been finished. */ function checkReadyState(pageLoadStrategy, eventData = {}) { @@ -92,7 +92,7 @@ function checkReadyState(pageLoadStrategy, eventData = {}) { * * @param {URL} current * URL the browser is currently visiting. - * @param {Object} options + * @param {object} options * @param {BrowsingContext=} options.browsingContext * The current browsing context. Needed for targets of _parent and _top. * @param {URL=} options.future @@ -100,7 +100,7 @@ function checkReadyState(pageLoadStrategy, eventData = {}) { * @param {target=} options.target * Link target, if known. * - * @return {boolean} + * @returns {boolean} * Full page load would be expected if future is followed. * * @throws TypeError @@ -189,7 +189,7 @@ navigate.refresh = async function(browsingContext) { * Reference to driver instance. * @param {Function} callback * Callback to execute that might trigger a navigation. - * @param {Object} options + * @param {object} options * @param {BrowsingContext=} browsingContext * Browsing context to observe. Defaults to the current browsing context. * @param {boolean=} loadEventExpected diff --git a/remote/marionette/packets.sys.mjs b/remote/marionette/packets.sys.mjs index 3ae663778da6..e3220728d2bb 100644 --- a/remote/marionette/packets.sys.mjs +++ b/remote/marionette/packets.sys.mjs @@ -29,13 +29,13 @@ XPCOMUtils.defineLazyGetter(lazy, "unicodeConverter", () => { * instantiated for each incoming or outgoing packet. * * A complete Packet type should expose at least the following: - * * read(stream, scriptableStream) + * read(stream, scriptableStream) * Called when the input stream has data to read - * * write(stream) + * write(stream) * Called when the output stream is ready to write - * * get done() + * get done() * Returns true once the packet is done being read / written - * * destroy() + * destroy() * Called to clean up at the end of use */ @@ -74,7 +74,7 @@ export function Packet(transport) { * @param {DebuggerTransport} transport * Transport instance that will own the packet. * - * @return {Packet} + * @returns {Packet} * Parsed packet of the matching type, or null if no types matched. */ Packet.fromHeader = function(header, transport) { @@ -131,7 +131,7 @@ export function JSONPacket(transport) { * @param {DebuggerTransport} transport * Transport instance that will own the packet. * - * @return {JSONPacket} + * @returns {JSONPacket} * Parsed packet, or null if it's not a match. */ JSONPacket.fromHeader = function(header, transport) { @@ -260,7 +260,7 @@ export function BulkPacket(transport) { * @param {DebuggerTransport} transport * Transport instance that will own the packet. * - * @return {BulkPacket} + * @returns {BulkPacket} * Parsed packet, or null if it's not a match. */ BulkPacket.fromHeader = function(header, transport) { @@ -393,6 +393,7 @@ BulkPacket.prototype.toString = function() { /** * RawPacket is used to test the transport's error handling of malformed * packets, by writing data directly onto the stream. + * * @param transport DebuggerTransport * The transport instance that will own the packet. * @param data string diff --git a/remote/marionette/permissions.sys.mjs b/remote/marionette/permissions.sys.mjs index 4bc35420f5d6..9d702c263afc 100644 --- a/remote/marionette/permissions.sys.mjs +++ b/remote/marionette/permissions.sys.mjs @@ -16,7 +16,7 @@ export const permissions = {}; * Set a permission's state. * Note: Currently just a shim to support testdriver's set_permission. * - * @param {Object} descriptor + * @param {object} descriptor * Descriptor with the `name` property. * @param {string} state * State of the permission. It can be `granted`, `denied` or `prompt`. diff --git a/remote/marionette/prefs.sys.mjs b/remote/marionette/prefs.sys.mjs index e4c8b7da5df8..ac6fa529b1f2 100644 --- a/remote/marionette/prefs.sys.mjs +++ b/remote/marionette/prefs.sys.mjs @@ -21,7 +21,7 @@ export class Branch { * @param {?=} fallback * Fallback value to return if `pref` does not exist. * - * @return {(string|boolean|number)} + * @returns {(string|boolean|number)} * Value of `pref`, or the `fallback` value if `pref` does * not exist. * @@ -108,7 +108,7 @@ class MarionetteBranch extends Branch { * server startup until a modal dialogue has been clicked to allow * time for user to set breakpoints in the Browser Toolbox. * - * @return {boolean} + * @returns {boolean} */ get clickToStart() { return this.get("debugging.clicktostart", false); @@ -118,7 +118,7 @@ class MarionetteBranch extends Branch { * The `marionette.port` preference, detailing which port * the TCP server should listen on. * - * @return {number} + * @returns {number} */ get port() { return this.get("port", 2828); @@ -132,7 +132,7 @@ class MarionetteBranch extends Branch { * Gets the `marionette.setpermission.enabled` preference, should * only be used for testdriver's set_permission API. * - * @return {boolean} + * @returns {boolean} */ get setPermissionEnabled() { return this.get("setpermission.enabled", false); @@ -150,7 +150,7 @@ export class EnvironmentPrefs { * @param {string} key * Environment variable. * - * @return {Iterable. + * @returns {Iterable. */ static *from(key) { if (!Services.env.exists(key)) { diff --git a/remote/marionette/reftest.sys.mjs b/remote/marionette/reftest.sys.mjs index d90ca3337ab8..805556fe9f91 100644 --- a/remote/marionette/reftest.sys.mjs +++ b/remote/marionette/reftest.sys.mjs @@ -79,7 +79,7 @@ reftest.Runner = class { * This will open a non-browser window in which the tests will * be loaded, and set up various caches for the reftest run. * - * @param {Object.} urlCount + * @param {Object} urlCount * Object holding a map of URL: number of times the URL * will be opened during the reftest run, where that's * greater than 1. @@ -281,7 +281,7 @@ reftest.Runner = class { * @param {number} timeout * Test timeout in milliseconds. * - * @return {Object} + * @returns {object} * Result object with fields status, message and extra. */ async run( diff --git a/remote/marionette/server.sys.mjs b/remote/marionette/server.sys.mjs index c058d137be41..ab7e29ed4677 100644 --- a/remote/marionette/server.sys.mjs +++ b/remote/marionette/server.sys.mjs @@ -58,7 +58,7 @@ export class TCPListener { * * Determines the application to initialise the driver with. * - * @return {GeckoDriver} + * @returns {GeckoDriver} * A driver instance. */ driverFactory() { @@ -353,7 +353,7 @@ export class TCPConnection { * @param {number} msgID * Message ID to respond to. If it is not a number, -1 is used. * - * @return {Response} + * @returns {Response} * Response to the message with `msgID`. */ createResponse(msgID) { @@ -433,7 +433,7 @@ export class TCPConnection { * Send the given payload over the debugger transport socket to the * connected client. * - * @param {Object.} payload + * @param {Object} payload * The payload to ship. */ sendRaw(payload) { diff --git a/remote/marionette/stream-utils.sys.mjs b/remote/marionette/stream-utils.sys.mjs index fc403b1fe564..9a4437966ceb 100644 --- a/remote/marionette/stream-utils.sys.mjs +++ b/remote/marionette/stream-utils.sys.mjs @@ -58,7 +58,7 @@ const BUFFER_SIZE = 0x8000; * @param {number} length * Amount of data that needs to be copied. * - * @return {Promise} + * @returns {Promise} * Promise is resolved when copying completes or rejected if any * (unexpected) errors occur. */ @@ -217,7 +217,7 @@ StreamCopier.prototype = { * @param {number} count * Max number of characters to read while searching. * - * @return {string} + * @returns {string} * Collected data. If the delimiter was found, this string will * end with it. */ diff --git a/remote/marionette/sync.sys.mjs b/remote/marionette/sync.sys.mjs index 890773bfbe1a..b360ce2ad221 100644 --- a/remote/marionette/sync.sys.mjs +++ b/remote/marionette/sync.sys.mjs @@ -24,7 +24,7 @@ const PROMISE_TIMEOUT = AppConstants.DEBUG ? 4500 : 1500; /** * Dispatch a function to be executed on the main thread. * - * @param {function} func + * @param {Function} func * Function to be executed. */ export function executeSoon(func) { @@ -75,7 +75,7 @@ export function executeSoon(func) { * Duration between each poll of ``func`` in milliseconds. * Defaults to 10 milliseconds. * - * @return {Promise.<*>} + * @returns {Promise.<*>} * Yields the value passed to ``func``'s * ``resolve`` or ``reject`` callbacks. * @@ -161,8 +161,8 @@ export function PollPromise(func, { timeout = null, interval = 10 } = {}) { * callback invoked after the ``timeout`` duration is reached. * It is given two callbacks: ``resolve(value)`` and * ``reject(error)``. - * @param {Object=} options - * @param {String} [options.errorMessage] + * @param {object=} options + * @param {string} [options.errorMessage] * Message to use for the thrown error. * @param {number=} options.timeout * ``condition``'s ``reject`` callback will be called @@ -174,7 +174,7 @@ export function PollPromise(func, { timeout = null, interval = 10 } = {}) { * thrown. If it is null, no error is thrown and the promise is * instead resolved on timeout. * - * @return {Promise.<*>} + * @returns {Promise.<*>} * Timed promise. * * @throws {TypeError} @@ -242,7 +242,7 @@ export function TimedPromise(fn, options = {}) { * @param {number} timeout * Duration to wait before fulfilling promise in milliseconds. * - * @return {Promise} + * @returns {Promise} * Promise that fulfills when the `timeout` is elapsed. * * @throws {TypeError} @@ -294,7 +294,7 @@ export function Sleep(timeout) { * Use the browser message manager when closing a content browser, * and the window message manager when closing a chrome window. * - * @return {Promise} + * @returns {Promise} * A promise that resolves when the message manager has been destroyed. */ export function MessageManagerDestroyedPromise(messageManager) { @@ -319,7 +319,7 @@ export function MessageManagerDestroyedPromise(messageManager) { * @param {ChromeWindow} win * Window to request the animation frame from. * - * @return Promise + * @returns Promise */ export function IdlePromise(win) { const animationFramePromise = new Promise(resolve => { @@ -409,7 +409,7 @@ export class DebounceCallback { * The message manager that should be used. * @param {string} messageName * The message to wait for. - * @param {Object=} options + * @param {object=} options * Extra options. * @param {function(Message)=} options.checkFn * Called with the ``Message`` object as argument, should return ``true`` @@ -417,7 +417,7 @@ export class DebounceCallback { * ignored and listening should continue. If not specified, the first * message with the specified name resolves the returned promise. * - * @return {Promise.} + * @returns {Promise.} * Promise which resolves to the data property of the received * ``Message``. */ @@ -459,15 +459,15 @@ export function waitForMessage( * * @param {string} topic * The topic to observe. - * @param {Object=} options + * @param {object=} options * Extra options. - * @param {function(String,Object)=} options.checkFn + * @param {function(string, object)=} options.checkFn * Called with ``subject``, and ``data`` as arguments, should return true * if the notification is the expected one, or false if it should be * ignored and listening should continue. If not specified, the first * notification for the specified topic resolves the returned promise. * - * @return {Promise.>} + * @returns {Promise.>} * Promise which resolves to an array of ``subject``, and ``data`` from * the observed notification. */ diff --git a/remote/marionette/transport.sys.mjs b/remote/marionette/transport.sys.mjs index b3bb0b22d612..4766fa59a4b0 100644 --- a/remote/marionette/transport.sys.mjs +++ b/remote/marionette/transport.sys.mjs @@ -62,26 +62,26 @@ const PACKET_HEADER_MAX = 200; * * - onBulkPacket(packet) - called when we have switched to bulk packet * receiving mode. |packet| is an object containing: - * * actor: Name of actor that will receive the packet - * * type: Name of actor's method that should be called on receipt - * * length: Size of the data to be read - * * stream: This input stream should only be used directly if you + * actor: Name of actor that will receive the packet + * type: Name of actor's method that should be called on receipt + * length: Size of the data to be read + * stream: This input stream should only be used directly if you * can ensure that you will read exactly |length| bytes and * will not close the stream when reading is complete - * * done: If you use the stream directly (instead of |copyTo| + * done: If you use the stream directly (instead of |copyTo| * below), you must signal completion by resolving/rejecting * this deferred. If it's rejected, the transport will * be closed. If an Error is supplied as a rejection value, * it will be logged via |dump|. If you do use |copyTo|, * resolving is taken care of for you when copying completes. - * * copyTo: A helper function for getting your data out of the + * copyTo: A helper function for getting your data out of the * stream that meets the stream handling requirements above, * and has the following signature: * * @param nsIAsyncOutputStream {output} * The stream to copy to. * - * @return {Promise} + * @returns {Promise} * The promise is resolved when copying completes or * rejected if any (unexpected) errors occur. This object * also emits "progress" events for each chunk that is @@ -148,7 +148,7 @@ DebuggerTransport.prototype = { * will continue to be used by this transport afterwards. Most users * should instead use the provided |copyFrom| function instead. * - * @param {Object} header + * @param {object} header * This is modeled after the format of JSON packets above, but does * not actually contain the data, but is instead just a routing * header: @@ -157,7 +157,7 @@ DebuggerTransport.prototype = { * - type: Name of actor's method that should be called on receipt * - length: Size of the data to be sent * - * @return {Promise} + * @returns {Promise} * The promise will be resolved when you are allowed to write to * the stream with an object containing: * @@ -180,7 +180,7 @@ DebuggerTransport.prototype = { * @param {nsIAsyncInputStream} input * The stream to copy from. * - * @return {Promise} + * @returns {Promise} * The promise is resolved when copying completes * or rejected if any (unexpected) errors occur. * This object also emits "progress" events for @@ -382,7 +382,7 @@ DebuggerTransport.prototype = { * its data is ready for delivery by calling one of this transport's * _on*Ready methods (see ./packets.js and the _on*Ready methods below). * - * @return {boolean} + * @returns {boolean} * Whether incoming stream processing should continue for any * remaining data. */ @@ -442,7 +442,7 @@ DebuggerTransport.prototype = { * up a complete packet header (which terminates with ":"). We'll only * read up to PACKET_HEADER_MAX characters. * - * @return {boolean} + * @returns {boolean} * True if we now have a complete header. */ _readHeader() { diff --git a/remote/server/WebSocketHandshake.sys.mjs b/remote/server/WebSocketHandshake.sys.mjs index cb060885d5ae..f8ca5629cf6a 100644 --- a/remote/server/WebSocketHandshake.sys.mjs +++ b/remote/server/WebSocketHandshake.sys.mjs @@ -105,7 +105,7 @@ function writeHttpResponse(output, headers, body = "") { * * @param {nsIURI} uri * The URI to check. - * @return {boolean} + * @returns {boolean} */ function isIPAddress(uri) { try { diff --git a/remote/shared/AppInfo.sys.mjs b/remote/shared/AppInfo.sys.mjs index f47046fe1ca1..300041987b8b 100644 --- a/remote/shared/AppInfo.sys.mjs +++ b/remote/shared/AppInfo.sys.mjs @@ -12,12 +12,12 @@ const ID_THUNDERBIRD = "{3550f703-e582-4d05-9a08-453d09bdfdc6}"; * used by different protocols as handled by the Remote Agent. * * @typedef {object} RemoteAgent.AppInfo - * @property {Boolean} isAndroid - Whether the application runs on Android. - * @property {Boolean} isLinux - Whether the application runs on Linux. - * @property {Boolean} isMac - Whether the application runs on Mac OS. - * @property {Boolean} isWindows - Whether the application runs on Windows. - * @property {Boolean} isFirefox - Whether the application is Firefox. - * @property {Boolean} isThunderbird - Whether the application is Thunderbird. + * @property {boolean} isAndroid - Whether the application runs on Android. + * @property {boolean} isLinux - Whether the application runs on Linux. + * @property {boolean} isMac - Whether the application runs on Mac OS. + * @property {boolean} isWindows - Whether the application runs on Windows. + * @property {boolean} isFirefox - Whether the application is Firefox. + * @property {boolean} isThunderbird - Whether the application is Thunderbird. * * @since 88 */ diff --git a/remote/shared/Capture.sys.mjs b/remote/shared/Capture.sys.mjs index 9f6ae941dc69..97c9ded1a940 100644 --- a/remote/shared/Capture.sys.mjs +++ b/remote/shared/Capture.sys.mjs @@ -58,7 +58,7 @@ capture.Format = { * If true, read back a snapshot of the pixel data currently in the * compositor/window. Defaults to false. * - * @return {HTMLCanvasElement} + * @returns {HTMLCanvasElement} * The canvas on which the selection from the window's framebuffer * has been painted on. */ @@ -156,7 +156,7 @@ capture.canvas = async function( * @param {HTMLCanvasElement} canvas * The canvas to encode. * - * @return {string} + * @returns {string} * A Base64 encoded string. */ capture.toBase64 = function(canvas) { @@ -170,7 +170,7 @@ capture.toBase64 = function(canvas) { * @param {HTMLCanvasElement} canvas * The canvas to encode. * - * @return {string} + * @returns {string} * A hex digest of the SHA-256 hash of the base64 encoded string. */ capture.toHash = function(canvas) { @@ -185,7 +185,7 @@ capture.toHash = function(canvas) { * @param {ArrayBuffer} buffer * The buffer containing the data to convert to hex. * - * @return {string} + * @returns {string} * A hex digest of the input buffer. */ function hex(buffer) { diff --git a/remote/shared/Log.sys.mjs b/remote/shared/Log.sys.mjs index 9bd174d8f1ba..34bb198d76ff 100644 --- a/remote/shared/Log.sys.mjs +++ b/remote/shared/Log.sys.mjs @@ -19,7 +19,7 @@ export class Log { * Get a logger instance. For each provided type, a dedicated logger instance * will be returned, but all loggers are relying on the same preference. * - * @param {String} type + * @param {string} type * The type of logger to use. Protocol-specific modules should use the * corresponding logger type. Eg. files under /marionette should use * Log.TYPES.MARIONETTE. diff --git a/remote/shared/MobileTabBrowser.sys.mjs b/remote/shared/MobileTabBrowser.sys.mjs index fd8e78e45ada..457781a2d15a 100644 --- a/remote/shared/MobileTabBrowser.sys.mjs +++ b/remote/shared/MobileTabBrowser.sys.mjs @@ -58,7 +58,7 @@ export class MobileTabBrowser { * * @param url URL to load within the newly opended tab. * - * @return {Promise} The created tab. + * @returns {Promise} The created tab. * @throws {Error} Throws an error if the tab cannot be created. */ addTab(url) { diff --git a/remote/shared/Navigate.sys.mjs b/remote/shared/Navigate.sys.mjs index be8a24e87296..77c0f53ea7ba 100644 --- a/remote/shared/Navigate.sys.mjs +++ b/remote/shared/Navigate.sys.mjs @@ -47,8 +47,8 @@ const webProgressListeners = new Set(); * * @param {WebProgress} webProgress * The WebProgress instance to observe. - * @param {Object=} options - * @param {Boolean=} options.resolveWhenStarted + * @param {object=} options + * @param {boolean=} options.resolveWhenStarted * Flag to indicate that the Promise has to be resolved when the * page load has been started. Otherwise wait until the page has * finished loading. Defaults to `false`. @@ -120,22 +120,22 @@ export class ProgressListener { * * @param {WebProgress} webProgress * The web progress to attach the listener to. - * @param {Object=} options - * @param {Boolean=} options.expectNavigation + * @param {object=} options + * @param {boolean=} options.expectNavigation * Flag to indicate that a navigation is guaranteed to happen. * When set to `true`, the ProgressListener will ignore options.unloadTimeout * and will only resolve when the expected navigation happens. * Defaults to `false`. - * @param {Boolean=} options.resolveWhenStarted + * @param {boolean=} options.resolveWhenStarted * Flag to indicate that the Promise has to be resolved when the * page load has been started. Otherwise wait until the page has * finished loading. Defaults to `false`. - * @param {Number=} options.unloadTimeout + * @param {number=} options.unloadTimeout * Time to allow before the page gets unloaded. Defaults to 200ms on * regular platforms. A multiplier will be applied on slower platforms * (eg. debug, ccov...). * Ignored if options.expectNavigation is set to `true` - * @param {Boolean=} options.waitForExplicitStart + * @param {boolean=} options.waitForExplicitStart * Flag to indicate that the Promise can only resolve after receiving a * STATE_START state change. In other words, if the webProgress is already * navigating, the Promise will only resolve for the next navigation. @@ -361,7 +361,7 @@ export class ProgressListener { /** * Stop observing web progress changes. * - * @param {Object=} options + * @param {object=} options * @param {Error=} options.error * If specified the navigation promise will be rejected with this error. */ @@ -401,7 +401,7 @@ export class ProgressListener { * Stop the progress listener if and only if we already detected a navigation * start. * - * @param {Object=} options + * @param {object=} options * @param {Error=} options.error * If specified the navigation promise will be rejected with this error. */ diff --git a/remote/shared/PDF.sys.mjs b/remote/shared/PDF.sys.mjs index e7c6506b022d..b313c0e4abbb 100644 --- a/remote/shared/PDF.sys.mjs +++ b/remote/shared/PDF.sys.mjs @@ -142,7 +142,7 @@ print.getPrintSettings = function(settings) { * Page ranges to print, e.g., ['1-5', '8', '11-13']. * Defaults to the empty string, which means print all pages. * - * @return {Array.} + * @returns {Array.} * Even-length array containing page range limits */ function parseRanges(ranges) { diff --git a/remote/shared/Stack.sys.mjs b/remote/shared/Stack.sys.mjs index 4611dbb04fd4..d0c7f9407d46 100644 --- a/remote/shared/Stack.sys.mjs +++ b/remote/shared/Stack.sys.mjs @@ -5,20 +5,20 @@ /** * An object that contains details of a stack frame. * - * @typedef {Object} StackFrame + * @typedef {object} StackFrame * @see nsIStackFrame * - * @property {String=} asyncCause + * @property {string=} asyncCause * Type of asynchronous call by which this frame was invoked. - * @property {Number} columnNumber + * @property {number} columnNumber * The column number for this stack frame. - * @property {String} filename + * @property {string} filename * The source URL for this stack frame. - * @property {String} function + * @property {string} function * SpiderMonkey’s inferred name for this stack frame’s function, or null. - * @property {Number} lineNumber + * @property {number} lineNumber * The line number for this stack frame (starts with 1). - * @property {Number} sourceId + * @property {number} sourceId * The process-unique internal integer ID of this source. */ @@ -27,7 +27,7 @@ * * Convert stack objects to the JSON attributes expected by consumers. * - * @param {Object} stack + * @param {object} stack * The native stack object to process. * * @returns {Array=} @@ -59,7 +59,7 @@ export function getFramesFromStack(stack) { /** * Check if a frame is from chrome scope. * - * @param {Object} frame + * @param {object} frame * The frame to check * * @returns {boolean} diff --git a/remote/shared/Sync.sys.mjs b/remote/shared/Sync.sys.mjs index c05f27a86875..2cb6d0f279ef 100644 --- a/remote/shared/Sync.sys.mjs +++ b/remote/shared/Sync.sys.mjs @@ -23,7 +23,7 @@ XPCOMUtils.defineLazyGetter(lazy, "logger", () => * @param {ChromeWindow} win * Window to request the animation frame from. * - * @return {Promise} + * @returns {Promise} */ export function AnimationFramePromise(win) { const animationFramePromise = new Promise(resolve => { @@ -43,7 +43,7 @@ export function AnimationFramePromise(win) { /** * Create a helper object to defer a promise. * - * @returns {Object} + * @returns {object} * An object that returns the following properties: * - fulfilled Flag that indicates that the promise got resolved * - pending Flag that indicates a not yet fulfilled/rejected promise @@ -93,12 +93,12 @@ export function Deferred() { * The element that should receive the event. * @param {string} eventName * Case-sensitive string representing the event name to listen for. - * @param {Object=} options + * @param {object=} options * @param {boolean=} [false] options.capture * Indicates the event will be despatched to this subject, * before it bubbles down to any EventTarget beneath it in the * DOM tree. - * @param {function=} [null] options.checkFn + * @param {Function=} [null] options.checkFn * Called with the Event object as argument, should return true if the * event is the expected one, or false if it should be ignored and * listening should continue. If not specified, the first event with @@ -113,7 +113,7 @@ export function Deferred() { * @param {boolean=} [false] options.wantUntrusted * Receive synthetic events despatched by web content. * - * @return {Promise} + * @returns {Promise} * Either fulfilled with the first described event, satisfying * options.checkFn if specified, or rejected with TimeoutError after * options.timeout milliseconds if specified. @@ -195,7 +195,7 @@ export function EventPromise(subject, eventName, options = {}) { /** * Wait for the next tick in the event loop to execute a callback. * - * @param {function} fn + * @param {Function} fn * Function to be executed. */ export function executeSoon(fn) { @@ -246,7 +246,7 @@ export function executeSoon(fn) { * Duration between each poll of ``func`` in milliseconds. * Defaults to 10 milliseconds. * - * @return {Promise.<*>} + * @returns {Promise.<*>} * Yields the value passed to ``func``'s * ``resolve`` or ``reject`` callbacks. * diff --git a/remote/shared/TabManager.sys.mjs b/remote/shared/TabManager.sys.mjs index 6a55ba84750d..3c77807a3892 100644 --- a/remote/shared/TabManager.sys.mjs +++ b/remote/shared/TabManager.sys.mjs @@ -17,7 +17,7 @@ export var TabManager = { /** * Retrieve all the browser elements from tabs as contained in open windows. * - * @return {Array} + * @returns {Array} * All the found s. Will return an empty array if * no windows and tabs can be found. */ @@ -49,7 +49,7 @@ export var TabManager = { * TODO: Similarly to getBrowserById, we should improve the performance of * this getter in Bug 1750065. * - * @return {Array} + * @returns {Array} * Array of UUIDs for all content browsers. */ get allBrowserUniqueIds() { @@ -79,7 +79,7 @@ export var TabManager = { * @param {Tab} tab * The tab whose browser needs to be returned. * - * @return {xul:browser} + * @returns {xul:browser} * The linked browser for the tab or null if no browser can be found. */ getBrowserForTab(tab) { @@ -96,7 +96,7 @@ export var TabManager = { * @param {ChromeWindow} win * Window whose tabbrowser needs to be accessed. * - * @return {Tab} + * @returns {Tab} * Tab browser or null if it's not a browser window. */ getTabBrowser(win) { @@ -112,15 +112,15 @@ export var TabManager = { /** * Create a new tab. * - * @param {Object} options - * @param {Boolean=} options.focus + * @param {object} options + * @param {boolean=} options.focus * Set to true if the new tab should be focused (selected). Defaults to * false. * @param {Tab=} options.referenceTab * The reference tab after which the new tab will be added. If no * reference tab is provided, the new tab will be added after all the * other tabs. - * @param {Number} options.userContextId + * @param {number} options.userContextId * The user context (container) id. * @param {window=} options.window * The window where the new tab will open. Defaults to Services.wm.getMostRecentWindow @@ -167,9 +167,9 @@ export var TabManager = { * potentially leaking those elements, this method loops over all windows and * all tabs. It should be replaced by a faster implementation in Bug 1750065. * - * @param {String} id + * @param {string} id * A browser unique id created by getIdForBrowser. - * @return {xul:browser} + * @returns {xul:browser} * The corresponding to the provided id. Will return null if * no matching browser element is found. */ @@ -191,9 +191,9 @@ export var TabManager = { /** * Retrieve the browsing context corresponding to the provided unique id. * - * @param {String} id + * @param {string} id * A browsing context unique id (created by getIdForBrowsingContext). - * @return {BrowsingContext=} + * @returns {BrowsingContext=} * The browsing context found for this id, null if none was found. */ getBrowsingContextById(id) { @@ -214,7 +214,7 @@ export var TabManager = { * * @param {xul:browser} browserElement * The for which we want to retrieve the id. - * @return {String} The unique id for this browser. + * @returns {string} The unique id for this browser. */ getIdForBrowser(browserElement) { if (browserElement === null) { @@ -237,7 +237,7 @@ export var TabManager = { * @param {BrowsingContext=} browsingContext * The browsing context to get the id from. * - * @returns {String} + * @returns {string} * The id of the browsing context. */ getIdForBrowsingContext(browsingContext) { diff --git a/remote/shared/WebSocketConnection.sys.mjs b/remote/shared/WebSocketConnection.sys.mjs index 2ce8ca2cddbd..c74d7169c481 100644 --- a/remote/shared/WebSocketConnection.sys.mjs +++ b/remote/shared/WebSocketConnection.sys.mjs @@ -84,7 +84,7 @@ export class WebSocketConnection { /** * Send the JSON-serializable object to the client. * - * @param {Object} data + * @param {object} data * The object to be sent. */ send(data) { @@ -140,7 +140,7 @@ export class WebSocketConnection { * * Needs to be implemented in the sub class. * - * @param {Object} packet + * @param {object} packet * JSON-serializable object sent by the client. */ async onPacket(packet) { diff --git a/remote/shared/WindowManager.sys.mjs b/remote/shared/WindowManager.sys.mjs index 1b918f997188..8b5d5ad51b49 100644 --- a/remote/shared/WindowManager.sys.mjs +++ b/remote/shared/WindowManager.sys.mjs @@ -41,11 +41,11 @@ class WindowManager { /** * Find a specific window matching the provided window handle. * - * @param {String} handle + * @param {string} handle * The unique handle of either a chrome window or a content browser, as * returned by :js:func:`#getIdForBrowser` or :js:func:`#getIdForWindow`. * - * @return {Object} A window properties object, + * @returns {object} A window properties object, * @see :js:func:`GeckoDriver#getWindowProperties` */ findWindowByHandle(handle) { @@ -81,13 +81,13 @@ class WindowManager { * identify it. The described window can either be a Chrome Window or a * Content Window. * - * @typedef {Object} WindowProperties + * @typedef {object} WindowProperties * @property {Window} win - The Chrome Window containing the window. * When describing a Chrome Window, this is the window itself. - * @property {String} id - The unique id of the containing Chrome Window. - * @property {Boolean} hasTabBrowser - `true` if the Chrome Window has a + * @property {string} id - The unique id of the containing Chrome Window. + * @property {boolean} hasTabBrowser - `true` if the Chrome Window has a * tabBrowser. - * @property {Number} tabIndex - Optional, the index of the specific tab + * @property {number} tabIndex - Optional, the index of the specific tab * within the window. */ @@ -96,10 +96,10 @@ class WindowManager { * * @param {Window} win * The Chrome Window for which we want to create a properties object. - * @param {Object} options - * @param {Number} options.tabIndex + * @param {object} options + * @param {number} options.tabIndex * Tab index of a specific Content Window in the specified Chrome Window. - * @return {WindowProperties} A window properties object. + * @returns {WindowProperties} A window properties object. */ getWindowProperties(win, options = {}) { if (!Window.isInstance(win)) { @@ -120,7 +120,7 @@ class WindowManager { * * @param {window} win * The window object for which we want to retrieve the id. - * @return {String} The unique id for this chrome window. + * @returns {string} The unique id for this chrome window. */ getIdForWindow(win) { if (!this._chromeWindowHandles.has(win)) { @@ -135,7 +135,7 @@ class WindowManager { * * @param {window} win * The window to close. - * @return {Promise} + * @returns {Promise} * A promise which is resolved when the current window has been closed. */ async closeWindow(win) { @@ -153,7 +153,7 @@ class WindowManager { * * @param {window} win * The window to focus. - * @return {Promise} + * @returns {Promise} * A promise which is resolved when the window has been focused. */ async focusWindow(win) { @@ -170,15 +170,15 @@ class WindowManager { /** * Open a new browser window. * - * @param {Object=} options - * @param {Boolean=} options.focus + * @param {object=} options + * @param {boolean=} options.focus * If true, the opened window will receive the focus. Defaults to false. - * @param {Boolean=} options.isPrivate + * @param {boolean=} options.isPrivate * If true, the opened window will be a private window. Defaults to false. * @param {ChromeWindow=} options.openerWindow * Use this window as the opener of the new window. Defaults to the * topmost window. - * @return {Promise} + * @returns {Promise} * A promise resolving to the newly created chrome window. */ async openBrowserWindow(options = {}) { @@ -236,7 +236,7 @@ class WindowManager { /** * Wait until the initial application window has been opened and loaded. * - * @return {Promise} + * @returns {Promise} * A promise that resolved to the application window. */ waitForInitialApplicationWindowLoaded() { diff --git a/remote/shared/listeners/BrowsingContextListener.sys.mjs b/remote/shared/listeners/BrowsingContextListener.sys.mjs index e201caed3a71..b7334e3d4f9a 100644 --- a/remote/shared/listeners/BrowsingContextListener.sys.mjs +++ b/remote/shared/listeners/BrowsingContextListener.sys.mjs @@ -29,7 +29,7 @@ const OBSERVER_TOPIC_SET_EMBEDDER = "browsing-context-did-set-embedder"; * }; * ``` * - * @emits message + * @fires message * The BrowsingContextListener emits "attached" and "discarded" events, * with the following object as payload: * - {BrowsingContext} browsingContext diff --git a/remote/shared/listeners/ConsoleAPIListener.sys.mjs b/remote/shared/listeners/ConsoleAPIListener.sys.mjs index c8b8560e7f61..2c8d4d047c1d 100644 --- a/remote/shared/listeners/ConsoleAPIListener.sys.mjs +++ b/remote/shared/listeners/ConsoleAPIListener.sys.mjs @@ -32,7 +32,7 @@ XPCOMUtils.defineLazyGetter(lazy, "ConsoleAPIStorage", () => { * }; * ``` * - * @emits message + * @fires message * The ConsoleAPIListener emits "message" events, with the following object as * payload: * - {Array} arguments - Arguments as passed-in when the method was called. @@ -48,7 +48,7 @@ export class ConsoleAPIListener { /** * Create a new ConsolerListener instance. * - * @param {Number} innerWindowId + * @param {number} innerWindowId * The inner window id to filter the messages for. */ constructor(innerWindowId) { diff --git a/remote/shared/listeners/ConsoleListener.sys.mjs b/remote/shared/listeners/ConsoleListener.sys.mjs index d9ccd50daf6d..aef41692c01d 100644 --- a/remote/shared/listeners/ConsoleListener.sys.mjs +++ b/remote/shared/listeners/ConsoleListener.sys.mjs @@ -35,7 +35,7 @@ XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get()); * listener.stopListening(); * ``` * - * @emits message + * @fires message * The ConsoleListener emits "error", "warn" and "info" events, with the * following object as payload: * - {String} level - Importance, one of `info`, `warn`, `error`, @@ -53,7 +53,7 @@ export class ConsoleListener { /** * Create a new ConsolerListener instance. * - * @param {Number} innerWindowId + * @param {number} innerWindowId * The inner window id to filter the messages for. */ constructor(innerWindowId) { diff --git a/remote/shared/listeners/LoadListener.sys.mjs b/remote/shared/listeners/LoadListener.sys.mjs index e84891dd5693..cccfca7a900f 100644 --- a/remote/shared/listeners/LoadListener.sys.mjs +++ b/remote/shared/listeners/LoadListener.sys.mjs @@ -23,7 +23,7 @@ ChromeUtils.defineESModuleGetters(lazy, { * }; * ``` * - * @emits message + * @fires message * The LoadListener emits "DOMContentLoaded" and "load" events, * with the following object as payload: * - {Document} target diff --git a/remote/shared/listeners/NetworkEventRecord.sys.mjs b/remote/shared/listeners/NetworkEventRecord.sys.mjs index f63ddbdf2665..20d9a47e1b74 100644 --- a/remote/shared/listeners/NetworkEventRecord.sys.mjs +++ b/remote/shared/listeners/NetworkEventRecord.sys.mjs @@ -29,7 +29,7 @@ export class NetworkEventRecord { /** * - * @param {Object} networkEvent + * @param {object} networkEvent * The initial network event information (see createNetworkEvent() in * NetworkUtils.sys.mjs). * @param {nsIChannel} channel @@ -95,7 +95,7 @@ export class NetworkEventRecord { * * Required API for a NetworkObserver event owner. * - * @param {Object} postData + * @param {object} postData * The request POST data. */ addRequestPostData(postData) { @@ -149,7 +149,7 @@ export class NetworkEventRecord { * * Not used for RemoteAgent. * - * @param {Object} info + * @param {object} info * The object containing security information. * @param {boolean} isRacing * True if the corresponding channel raced the cache and network requests. @@ -165,9 +165,9 @@ export class NetworkEventRecord { * * @param {number} total * The total time for the request. - * @param {Object} timings + * @param {object} timings * The har-like timings. - * @param {Object} offsets + * @param {object} offsets * The har-like timings, but as offset from the request start. * @param {Array} serverTimings * The server timings. @@ -181,7 +181,7 @@ export class NetworkEventRecord { * * Not used for RemoteAgent. * - * @param {Object} options + * @param {object} options * An object which contains a single responseCache property. */ addResponseCache(options) {} @@ -191,9 +191,9 @@ export class NetworkEventRecord { * * Required API for a NetworkObserver event owner. * - * @param {Object} response + * @param {object} response * An object which represents the response content. - * @param {Object} responseInfo + * @param {object} responseInfo * Additional meta data about the response. */ addResponseContent(response, responseInfo) { diff --git a/remote/shared/listeners/NetworkListener.sys.mjs b/remote/shared/listeners/NetworkListener.sys.mjs index 1fefd6df988e..7b19240309d1 100644 --- a/remote/shared/listeners/NetworkListener.sys.mjs +++ b/remote/shared/listeners/NetworkListener.sys.mjs @@ -33,7 +33,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, { * }; * ``` * - * @emits before-request-sent + * @fires before-request-sent * The NetworkListener emits "before-request-sent" events, with the * following object as payload: * - {number} browsingContextId - The browsing context id of the browsing diff --git a/remote/shared/listeners/test/browser/head.js b/remote/shared/listeners/test/browser/head.js index 2508616d3c4c..b905d54e851e 100644 --- a/remote/shared/listeners/test/browser/head.js +++ b/remote/shared/listeners/test/browser/head.js @@ -19,7 +19,7 @@ async function clearConsole() { * * @param {string} script * The script to execute. - * @return {Promise} + * @returns {Promise} * A promise that resolves when the script node was added and removed from * the content page. */ @@ -58,7 +58,7 @@ async function doGC() { * * @param {Browser} browser * The browser element where the URL should be loaded. - * @param {String} url + * @param {string} url * The URL to load. */ async function loadURL(browser, url) { @@ -74,7 +74,7 @@ async function loadURL(browser, url) { * * @param {Browser} browser * The browser element where the fetch should be performed. - * @param {String} url + * @param {string} url * The URL to fetch. */ function fetch(browser, url) { diff --git a/remote/shared/messagehandler/Errors.sys.mjs b/remote/shared/messagehandler/Errors.sys.mjs index 4e7d5400ec2c..69c65acd09d5 100644 --- a/remote/shared/messagehandler/Errors.sys.mjs +++ b/remote/shared/messagehandler/Errors.sys.mjs @@ -26,7 +26,7 @@ class MessageHandlerError extends RemoteError { } /** - * @return {Object.} + * @returns {Object} * JSON serialisation of error prototype. */ toJSON() { @@ -41,10 +41,10 @@ class MessageHandlerError extends RemoteError { * Unmarshals a JSON error representation to the appropriate MessageHandler * error type. * - * @param {Object.} json + * @param {Object} json * Error object. * - * @return {Error} + * @returns {Error} * Error prototype. */ static fromJSON(json) { diff --git a/remote/shared/messagehandler/EventsDispatcher.sys.mjs b/remote/shared/messagehandler/EventsDispatcher.sys.mjs index 05542d3446a1..b5db49ee7c87 100644 --- a/remote/shared/messagehandler/EventsDispatcher.sys.mjs +++ b/remote/shared/messagehandler/EventsDispatcher.sys.mjs @@ -30,7 +30,7 @@ export class EventsDispatcher { #messageHandler; /** - * @typedef {Object} EventListenerInfo + * @typedef {object} EventListenerInfo * @property {ContextDescriptor} contextDescriptor * The ContextDescriptor to which those callbacks are associated * @property {Set} callbacks @@ -69,9 +69,9 @@ export class EventsDispatcher { * Name of the event to unsubscribe from. * @param {ContextDescriptor} contextDescriptor * Context descriptor for this event. - * @param {function} callback + * @param {Function} callback * Event listener callback. - * @return {Promise} + * @returns {Promise} * Promise which resolves when the event fully unsubscribed, including * propagating the necessary session data. */ @@ -87,9 +87,9 @@ export class EventsDispatcher { * Name of the event to subscribe to. * @param {ContextDescriptor} contextDescriptor * Context descriptor for this event. - * @param {function} callback + * @param {Function} callback * Event listener callback. - * @return {Promise} + * @returns {Promise} * Promise which resolves when the event fully subscribed to, including * propagating the necessary session data. */ @@ -107,7 +107,7 @@ export class EventsDispatcher { * Name of the event to subscribe/unsubscribe to. * @param {ContextDescriptor} contextDescriptor * Context descriptor for this event. - * @param {function} callback + * @param {Function} callback * Event listener callback. * @param {boolean} enable * True, if we need to subscribe to an event. @@ -121,7 +121,7 @@ export class EventsDispatcher { * @param {Array} subscriptions * The list of information to subscribe/unsubscribe to. * - * @return {Promise} + * @returns {Promise} * Promise which resolves when the events fully subscribed/unsubscribed to, * including propagating the necessary session data. */ diff --git a/remote/shared/messagehandler/MessageHandler.sys.mjs b/remote/shared/messagehandler/MessageHandler.sys.mjs index f362cc55b225..77e8a53dd425 100644 --- a/remote/shared/messagehandler/MessageHandler.sys.mjs +++ b/remote/shared/messagehandler/MessageHandler.sys.mjs @@ -23,10 +23,10 @@ XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get()); * A ContextDescriptor object provides information to decide if a broadcast or * a session data item should be applied to a specific MessageHandler context. * - * @typedef {Object} ContextDescriptor + * @typedef {object} ContextDescriptor * @property {ContextDescriptorType} type * The type of context - * @property {String=} id + * @property {string=} id * Unique id of a given context for the provided type. * For ContextDescriptorType.All, id can be ommitted. * For ContextDescriptorType.TopBrowsingContext, the id should be the @@ -53,10 +53,10 @@ export const ContextDescriptorType = { * Or it can be assembled manually, for instance when emitting an event which * relates to a window global from the root layer (eg browsingContext.contextCreated). * - * @typedef {Object} ContextInfo - * @property {String} contextId + * @typedef {object} ContextInfo + * @property {string} contextId * Unique id of the MessageHandler corresponding to this context. - * @property {String} type + * @property {string} type * One of MessageHandler.type. */ @@ -93,9 +93,9 @@ export class MessageHandler extends EventEmitter { /** * Create a new MessageHandler instance. * - * @param {String} sessionId + * @param {string} sessionId * ID of the session the handler is used for. - * @param {Object} context + * @param {object} context * The context linked to this MessageHandler instance. */ constructor(sessionId, context) { @@ -150,10 +150,10 @@ export class MessageHandler extends EventEmitter { * * Such events should bubble up to the root of a MessageHandler network. * - * @param {String} name + * @param {string} name * Name of the event. Protocol level events should be of the * form [module name].[event name]. - * @param {Object} data + * @param {object} data * The event's data. * @param {ContextInfo=} contextInfo * The event's context info, used to identify the origin of the event. @@ -178,10 +178,10 @@ export class MessageHandler extends EventEmitter { } /** - * @typedef {Object} CommandDestination - * @property {String} type + * @typedef {object} CommandDestination + * @property {string} type * One of MessageHandler.type. - * @property {String=} id + * @property {string=} id * Unique context identifier. The format depends on the type. * For WINDOW_GLOBAL destinations, this is a browsing context id. * Optional, should only be provided if `contextDescriptor` is missing. @@ -192,12 +192,12 @@ export class MessageHandler extends EventEmitter { */ /** - * @typedef {Object} Command - * @property {String} commandName + * @typedef {object} Command + * @property {string} commandName * The name of the command to execute. - * @property {String} moduleName + * @property {string} moduleName * The name of the module. - * @property {Object} params + * @property {object} params * Optional command parameters. * @property {CommandDestination} destination * The destination describing a debuggable context. @@ -211,11 +211,11 @@ export class MessageHandler extends EventEmitter { * Retrieve all module classes matching the moduleName and destination. * See `getAllModuleClasses` (ModuleCache.jsm) for more details. * - * @param {String} moduleName + * @param {string} moduleName * The name of the module. * @param {Destination} destination * The destination. - * @return {Array.=>} + * @returns {Array.=>} * An array of Module classes. */ getAllModuleClasses(moduleName, destination) { @@ -229,7 +229,7 @@ export class MessageHandler extends EventEmitter { * @param {Command} command * The command that should be either handled in this layer or forwarded to * the next layer leading to the destination. - * @return {Promise} A Promise that will resolve with the return value of the + * @returns {Promise} A Promise that will resolve with the return value of the * command once it has been executed. */ handleCommand(command) { @@ -318,13 +318,13 @@ export class MessageHandler extends EventEmitter { * Check if the given command is supported in the module * for the destination * - * @param {String} moduleName + * @param {string} moduleName * The name of the module. - * @param {String} commandName + * @param {string} commandName * The name of the command. * @param {Destination} destination * The destination. - * @return {Boolean} + * @returns {boolean} * True if the command is supported. */ supportsCommand(moduleName, commandName, destination) { @@ -337,7 +337,7 @@ export class MessageHandler extends EventEmitter { * Return the context information for this MessageHandler instance, which * can be used to identify the origin of an event. * - * @return {ContextInfo} + * @returns {ContextInfo} * The context information for this MessageHandler. */ #getContextInfo() { diff --git a/remote/shared/messagehandler/MessageHandlerRegistry.sys.mjs b/remote/shared/messagehandler/MessageHandlerRegistry.sys.mjs index b6f1bb0fd118..951849dbe5c8 100644 --- a/remote/shared/messagehandler/MessageHandlerRegistry.sys.mjs +++ b/remote/shared/messagehandler/MessageHandlerRegistry.sys.mjs @@ -36,9 +36,9 @@ XPCOMUtils.defineLazyGetter( /** * Get the MessageHandler subclass corresponding to the provided type. - * @param {String} type + * @param {string} type * MessageHandler type, one of MessageHandler.type. - * @return {Class} + * @returns {Class} * A MessageHandler subclass * @throws {Error} * Throws if no MessageHandler subclass is found for the provided type. @@ -115,7 +115,7 @@ export class MessageHandlerRegistry extends EventEmitter { * Retrieve all MessageHandler instances held in this registry, for all * session IDs. * - * @return {Iterable.} + * @returns {Iterable.} * Iterator of MessageHandler instances */ getAllMessageHandlers() { @@ -126,9 +126,9 @@ export class MessageHandlerRegistry extends EventEmitter { * Retrieve an existing MessageHandler instance matching the provided session * id. Returns null if no MessageHandler was found. * - * @param {String} sessionId + * @param {string} sessionId * ID of the session the handler is used for. - * @return {MessageHandler=} + * @returns {MessageHandler=} * A MessageHandler instance, null if not found. */ getExistingMessageHandler(sessionId) { @@ -139,14 +139,14 @@ export class MessageHandlerRegistry extends EventEmitter { * Retrieve an already registered MessageHandler instance matching the * provided parameters. * - * @param {String} sessionId + * @param {string} sessionId * ID of the session the handler is used for. - * @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. Can be null for ROOT * type MessageHandlers. - * @return {MessageHandler} + * @returns {MessageHandler} * A MessageHandler instance. */ getOrCreateMessageHandler(sessionId) { @@ -162,9 +162,9 @@ export class MessageHandlerRegistry extends EventEmitter { * Retrieve an already registered RootMessageHandler instance matching the * provided sessionId. * - * @param {String} sessionId + * @param {string} sessionId * ID of the session the handler is used for. - * @return {RootMessageHandler} + * @returns {RootMessageHandler} * A RootMessageHandler instance. * @throws {Error} * If no root MessageHandler can be found for the provided session id. @@ -189,12 +189,12 @@ export class MessageHandlerRegistry extends EventEmitter { /** * Create a new MessageHandler instance. * - * @param {String} sessionId + * @param {string} sessionId * ID of the session the handler will be used for. * @param {Array=} sessionDataItems * Optional array of session data items to be applied automatically to the * MessageHandler. - * @return {MessageHandler} + * @returns {MessageHandler} * A new MessageHandler instance. */ _createMessageHandler(sessionId, sessionDataItems) { diff --git a/remote/shared/messagehandler/Module.sys.mjs b/remote/shared/messagehandler/Module.sys.mjs index 32684ce69688..5288f8039e97 100644 --- a/remote/shared/messagehandler/Module.sys.mjs +++ b/remote/shared/messagehandler/Module.sys.mjs @@ -41,10 +41,10 @@ export class Module { * * Such events should bubble up to the root of a MessageHandler network. * - * @param {String} name + * @param {string} name * Name of the event. Protocol level events should be of the * form [module name].[event name]. - * @param {Object} data + * @param {object} data * The event's data. * @param {ContextInfo=} contextInfo * The event's context info, see MessageHandler:emitEvent. Optional. @@ -60,9 +60,9 @@ export class Module { * * @param {string} name * Name of the event. - * @param {Object} payload + * @param {object} payload * The event's payload. - * @returns {Object} + * @returns {object} * The modified event payload. */ interceptEvent(name, payload) { @@ -74,7 +74,7 @@ export class Module { /** * Assert if experimental commands are enabled. * - * @param {String} methodName + * @param {string} methodName * Name of the command. * * @throws {UnknownCommandError} diff --git a/remote/shared/messagehandler/ModuleCache.sys.mjs b/remote/shared/messagehandler/ModuleCache.sys.mjs index 177f5d1f2f9d..487b3a2dcd87 100644 --- a/remote/shared/messagehandler/ModuleCache.sys.mjs +++ b/remote/shared/messagehandler/ModuleCache.sys.mjs @@ -100,11 +100,11 @@ export class ModuleCache { * A command's method must be implemented in one of the classes returned by * getAllModuleClasses in order to be successfully handled. * - * @param {String} moduleName + * @param {string} moduleName * The name of the module. * @param {Destination} destination * The destination. - * @return {Array.=>} + * @returns {Array.=>} * An array of Module classes. */ getAllModuleClasses(moduleName, destination) { @@ -132,12 +132,12 @@ export class ModuleCache { * will attempt to import the module file and create a new instance, which * will then be cached and returned for subsequent calls. * - * @param {String} moduleName + * @param {string} moduleName * The name of the module which should implement the command. * @param {CommandDestination} destination * The destination of the command for which we need to instantiate a * module. See MessageHandler.jsm for the CommandDestination typedef. - * @return {Object=} + * @returns {object=} * A module instance corresponding to the provided moduleName and * destination, or null if it could not be instantiated. */ @@ -175,11 +175,11 @@ export class ModuleCache { /** * Check if the given module exists for the destination. * - * @param {String} moduleName + * @param {string} moduleName * The name of the module. * @param {Destination} destination * The destination. - * @returns {Boolean} + * @returns {boolean} * True if the module exists. */ hasModule(moduleName, destination) { diff --git a/remote/shared/messagehandler/RootMessageHandler.sys.mjs b/remote/shared/messagehandler/RootMessageHandler.sys.mjs index c1ebeb9b36c8..33e9e55ba8ab 100644 --- a/remote/shared/messagehandler/RootMessageHandler.sys.mjs +++ b/remote/shared/messagehandler/RootMessageHandler.sys.mjs @@ -29,7 +29,7 @@ export class RootMessageHandler extends MessageHandler { /** * Returns the RootMessageHandler module path. * - * @return {String} + * @returns {string} */ static get modulePath() { return "root"; @@ -38,7 +38,7 @@ export class RootMessageHandler extends MessageHandler { /** * Returns the RootMessageHandler type. * - * @return {String} + * @returns {string} */ static get type() { return "ROOT"; @@ -55,7 +55,7 @@ export class RootMessageHandler extends MessageHandler { /** * Create a new RootMessageHandler instance. * - * @param {String} sessionId + * @param {string} sessionId * ID of the session the handler is used for. */ constructor(sessionId) { @@ -90,10 +90,10 @@ export class RootMessageHandler extends MessageHandler { /** * Emit a public protocol event. This event will be sent over to the client. * - * @param {String} name + * @param {string} name * Name of the event. Protocol level events should be of the * form [module name].[event name]. - * @param {Object} data + * @param {object} data * The event's data. */ emitProtocolEvent(name, data) { @@ -110,7 +110,7 @@ export class RootMessageHandler extends MessageHandler { * * @param {Command} command * The command to forward. See type definition in MessageHandler.js - * @return {Promise} + * @returns {Promise} * Returns a promise that resolves with the result of the command. */ forwardCommand(command) { diff --git a/remote/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs b/remote/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs index a4af679e2dde..c1eb38523571 100644 --- a/remote/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs +++ b/remote/shared/messagehandler/WindowGlobalMessageHandler.sys.mjs @@ -26,7 +26,7 @@ export class WindowGlobalMessageHandler extends MessageHandler { /** * Returns the WindowGlobalMessageHandler module path. * - * @return {String} + * @returns {string} */ static get modulePath() { return "windowglobal"; @@ -35,7 +35,7 @@ export class WindowGlobalMessageHandler extends MessageHandler { /** * Returns the WindowGlobalMessageHandler type. * - * @return {String} + * @returns {string} */ static get type() { return "WINDOW_GLOBAL"; @@ -48,7 +48,7 @@ export class WindowGlobalMessageHandler extends MessageHandler { * @param {BrowsingContext} context * WindowGlobalMessageHandler contexts are expected to be * BrowsingContexts. - * @return {String} + * @returns {string} * The browsing context id. */ static getIdFromContext(context) { diff --git a/remote/shared/messagehandler/sessiondata/SessionData.sys.mjs b/remote/shared/messagehandler/sessiondata/SessionData.sys.mjs index 01f07b39049d..9ab177c2090e 100644 --- a/remote/shared/messagehandler/sessiondata/SessionData.sys.mjs +++ b/remote/shared/messagehandler/sessiondata/SessionData.sys.mjs @@ -20,14 +20,14 @@ XPCOMUtils.defineLazyGetter(lazy, "logger", () => lazy.Log.get()); /** * @typedef {string} SessionDataCategory - **/ + */ /** * Enum of session data categories. * * @readonly * @enum {SessionDataCategory} - **/ + */ export const SessionDataCategory = { Event: "event", PreloadScript: "preload-script", @@ -35,14 +35,14 @@ export const SessionDataCategory = { /** * @typedef {string} SessionDataMethod - **/ + */ /** * Enum of session data methods. * * @readonly * @enum {SessionDataMethod} - **/ + */ export const SessionDataMethod = { Add: "add", Remove: "remove", @@ -59,8 +59,8 @@ export const SESSION_DATA_SHARED_DATA_KEY = "MessageHandlerSessionData"; const sessionDataMap = new Map(); /** - * @typedef {Object} SessionDataItem - * @property {String} moduleName + * @typedef {object} SessionDataItem + * @property {string} moduleName * The name of the module responsible for this data item. * @property {SessionDataCategory} category * The category of data. The supported categories depend on the module. @@ -74,7 +74,7 @@ const sessionDataMap = new Map(); * @typedef SessionDataItemUpdate * @property {SessionDataMethod} method * The way sessionData is updated. - * @property {String} moduleName + * @property {string} moduleName * The name of the module responsible for this data item. * @property {SessionDataCategory} category * The category of data. The supported categories depend on the module. @@ -166,7 +166,7 @@ export class SessionData { * @param {Array} sessionDataItemUpdates * Array of session data item updates. * - * @return {Array} + * @returns {Array} * The subset of session data item updates which want to be applied. */ applySessionData(sessionDataItemUpdates = []) { @@ -231,14 +231,14 @@ export class SessionData { /** * Retrieve the SessionDataItems for a given module and type. * - * @param {String} moduleName + * @param {string} moduleName * The name of the module responsible for this data item. - * @param {String} category + * @param {string} category * The session data category. * @param {ContextDescriptor=} contextDescriptor * Optional context descriptor, to retrieve only session data items added * for a specific context descriptor. - * @return {Array} + * @returns {Array} * Array of SessionDataItems for the provided module and type. */ getSessionData(moduleName, category, contextDescriptor) { diff --git a/remote/shared/messagehandler/sessiondata/SessionDataReader.sys.mjs b/remote/shared/messagehandler/sessiondata/SessionDataReader.sys.mjs index 107ab82dc622..c96409fb94c9 100644 --- a/remote/shared/messagehandler/sessiondata/SessionDataReader.sys.mjs +++ b/remote/shared/messagehandler/sessiondata/SessionDataReader.sys.mjs @@ -22,7 +22,7 @@ XPCOMUtils.defineLazyGetter(lazy, "sharedData", () => { * Returns a snapshot of the session data map, which is cloned from the * sessionDataMap singleton of SessionData.jsm. * - * @return {Map.>} + * @returns {Map.>} * Map of session id to arrays of SessionDataItems. */ export const readSessionData = () => diff --git a/remote/shared/messagehandler/test/browser/broadcast/head.js b/remote/shared/messagehandler/test/browser/broadcast/head.js index b31619ab315c..eb97549c26ba 100644 --- a/remote/shared/messagehandler/test/browser/broadcast/head.js +++ b/remote/shared/messagehandler/test/browser/broadcast/head.js @@ -14,17 +14,17 @@ Services.scriptloader.loadSubScript( * network. * Returns a promise which will resolve the result of the command broadcast. * - * @param {String} module + * @param {string} module * The name of the module implementing the command to broadcast. - * @param {String} command + * @param {string} command * The name of the command to broadcast. - * @param {Object} params + * @param {object} params * The parameters for the command. * @param {ContextDescriptor} contextDescriptor * The context descriptor to use for this broadcast * @param {RootMessageHandler} rootMessageHandler * The root of the MessageHandler network. - * @return {Promise.} + * @returns {Promise.} * Promise which resolves an array where each item is the result of the * command handled by an individual context. */ diff --git a/remote/shared/messagehandler/test/browser/head.js b/remote/shared/messagehandler/test/browser/head.js index 6a66ca873f0a..215e72324940 100644 --- a/remote/shared/messagehandler/test/browser/head.js +++ b/remote/shared/messagehandler/test/browser/head.js @@ -29,7 +29,7 @@ function createRootMessageHandler(sessionId) { * * @param {Browser} browser * The browser element where the URL should be loaded. - * @param {String} url + * @param {string} url * The URL to load in the new tab */ async function loadURL(browser, url) { @@ -42,7 +42,7 @@ async function loadURL(browser, url) { * Create a new foreground tab loading the provided url. * Returns a promise which will resolve when the page is loaded. * - * @param {String} url + * @param {string} url * The URL to load in the new tab */ async function addTab(url) { @@ -57,7 +57,7 @@ async function addTab(url) { * Create inline markup for a simple iframe that can be used with * document-builder.sjs. The iframe will be served under the provided domain. * - * @param {String} domain + * @param {string} domain * A domain (eg "example.com"), compatible with build/pgo/server-locations.txt */ function createFrame(domain) { @@ -75,9 +75,9 @@ function createFrameForUri(uri) { * * @param {xul:tab} tab * The XUL tab in which the browser element should be inserted. - * @param {String} type + * @param {string} type * The type attribute of the browser element, "chrome" or "content". - * @return {xul:browser} + * @returns {xul:browser} * The created browser element. */ function createParentBrowserElement(tab, type) { @@ -129,7 +129,7 @@ const hasPromiseResolved = async function(promise) { /** * Install a sidebar extension. * - * @return {Object} + * @returns {object} * Return value with two properties: * - extension: test wrapper as returned by SpecialPowers.loadExtension. * Make sure to explicitly call extension.unload() before the end of the test. diff --git a/remote/shared/messagehandler/test/browser/resources/modules/ModuleRegistry.sys.mjs b/remote/shared/messagehandler/test/browser/resources/modules/ModuleRegistry.sys.mjs index e5d9c387196c..70e921b1b78a 100644 --- a/remote/shared/messagehandler/test/browser/resources/modules/ModuleRegistry.sys.mjs +++ b/remote/shared/messagehandler/test/browser/resources/modules/ModuleRegistry.sys.mjs @@ -6,16 +6,16 @@ * Retrieve the WebDriver BiDi module class matching the provided module name * and folder. * - * @param {String} moduleName + * @param {string} moduleName * The name of the module to get the class for. - * @param {String} moduleFolder + * @param {string} moduleFolder * A valid folder name for modules. - * @return {Class=} + * @returns {Class=} * The class corresponding to the module name and folder, null if no match * was found. * @throws {Error} * If the provided module folder is unexpected. - **/ + */ export const getModuleClass = function(moduleName, moduleFolder) { const root = `chrome://mochitests/content/browser/remote/shared/messagehandler/test/`; const path = `${root}browser/resources/modules/${moduleFolder}/${moduleName}.sys.mjs`; diff --git a/remote/shared/messagehandler/transports/FrameContextUtils.sys.mjs b/remote/shared/messagehandler/transports/FrameContextUtils.sys.mjs index 341e7918ee4f..482f90948a55 100644 --- a/remote/shared/messagehandler/transports/FrameContextUtils.sys.mjs +++ b/remote/shared/messagehandler/transports/FrameContextUtils.sys.mjs @@ -33,10 +33,10 @@ function isParentProcess(browsingContext) { * * @param {BrowsingContext} browsingContext * The browsing context to check. - * @param {Object=} options - * @param {String=} options.browserId + * @param {object=} options + * @param {string=} options.browserId * The id of the browser to filter the browsing contexts by (optional). - * @return {Boolean} + * @returns {boolean} * True if the browsing context is valid, false otherwise. */ export function isBrowsingContextCompatible(browsingContext, options = {}) { diff --git a/remote/shared/messagehandler/transports/FrameTransport.sys.mjs b/remote/shared/messagehandler/transports/FrameTransport.sys.mjs index e2d48e00f4c2..b55f88ea7773 100644 --- a/remote/shared/messagehandler/transports/FrameTransport.sys.mjs +++ b/remote/shared/messagehandler/transports/FrameTransport.sys.mjs @@ -45,7 +45,7 @@ export class FrameTransport { * * @param {Command} command * The command to forward. See type definition in MessageHandler.js - * @return {Promise} + * @returns {Promise} * Returns a promise that resolves with the result of the command after * being processed by WINDOW_GLOBAL MessageHandlers. */ @@ -165,10 +165,10 @@ export class FrameTransport { /** * Get all browsing contexts, optionally matching the provided options. * - * @param {Object} options - * @param {String=} options.browserId + * @param {object} options + * @param {string=} options.browserId * The id of the browser to filter the browsing contexts by (optional). - * @return {Array} + * @returns {Array} * The browsing contexts matching the provided options or all browsing contexts * if no options are provided. */ diff --git a/remote/shared/messagehandler/transports/js-window-actors/MessageHandlerFrameParent.sys.mjs b/remote/shared/messagehandler/transports/js-window-actors/MessageHandlerFrameParent.sys.mjs index 9524fb08a594..372a651440a2 100644 --- a/remote/shared/messagehandler/transports/js-window-actors/MessageHandlerFrameParent.sys.mjs +++ b/remote/shared/messagehandler/transports/js-window-actors/MessageHandlerFrameParent.sys.mjs @@ -70,9 +70,9 @@ export class MessageHandlerFrameParent extends JSWindowActorParent { * * @param {Command} command * The command to forward. See type definition in MessageHandler.js - * @param {String} sessionId + * @param {string} sessionId * ID of the session that sent the command. - * @return {Promise} + * @returns {Promise} * Promise that will resolve with the result of query sent to the * MessageHandlerFrameChild actor. */ diff --git a/remote/shared/webdriver/Actions.sys.mjs b/remote/shared/webdriver/Actions.sys.mjs index ab5c84ee6394..33f18361b353 100644 --- a/remote/shared/webdriver/Actions.sys.mjs +++ b/remote/shared/webdriver/Actions.sys.mjs @@ -101,7 +101,7 @@ action.State = class { * Get the state for a given input source. * * @param {string} id Input source id. - * @return {InputSource} Input source state. + * @returns {InputSource} Input source state. */ getInputSource(id) { return this.inputStateMap.get(id); @@ -127,7 +127,7 @@ action.State = class { * Iterate over all input states of a given type * * @param {string} type Input source type name (e.g. "pointer"). - * @return {Iterator} Iterator over [id, input source]. + * @returns {Iterator} Iterator over [id, input source]. */ *inputSourcesByType(type) { for (const [id, inputSource] of this.inputStateMap) { @@ -146,7 +146,7 @@ action.State = class { * * @param {string} id Pointer id. * @param {string} id Pointer type. - * @return {number} Numerical pointer id. + * @returns {number} Numerical pointer id. */ getPointerId(id, type) { let pointerId = this.pointerIdMap.get(id); @@ -192,7 +192,7 @@ class InputSource { * @param {State} state Actions state. * @param {Sequence} actionSequence Actions for a specific input source. * - * @return {InputSource} + * @returns {InputSource} * An {@link InputSource} object for the type of the * {@link actionSequence}. * @@ -284,7 +284,7 @@ class KeyInputSource extends InputSource { * @param {string} key * Normalized key value. * - * @return {boolean} + * @returns {boolean} * True if |key| is in set of pressed keys. */ isPressed(key) { @@ -297,7 +297,7 @@ class KeyInputSource extends InputSource { * @param {string} key * Normalized key value. * - * @return {boolean} + * @returns {boolean} * True if |key| is in list of pressed keys. */ press(key) { @@ -310,7 +310,7 @@ class KeyInputSource extends InputSource { * @param {string} key * Normalized key value. * - * @return {boolean} + * @returns {boolean} * True if |key| was present before removal, false otherwise. */ release(key) { @@ -342,7 +342,7 @@ class PointerInputSource extends InputSource { * @param {number} button * Positive integer that refers to a mouse button. * - * @return {boolean} + * @returns {boolean} * True if |button| is in set of pressed buttons. */ isPressed(button) { @@ -356,7 +356,7 @@ class PointerInputSource extends InputSource { * @param {number} button * Positive integer that refers to a mouse button. * - * @return {Set} + * @returns {Set} * Set of pressed buttons. */ press(button) { @@ -370,7 +370,7 @@ class PointerInputSource extends InputSource { * @param {number} button * A positive integer that refers to a mouse button. * - * @return {boolean} + * @returns {boolean} * True if |button| was present before removals, false otherwise. */ release(button) { @@ -446,7 +446,7 @@ class Origin { /** * @param {Element|string=} origin - Type of orgin, one of "viewport", "pointer", element or undefined. * - * @return {Origin} - An origin object representing the origin. + * @returns {Origin} - An origin object representing the origin. * * @throws {InvalidArgumentError} * If origin isn't a valid origin. @@ -539,7 +539,7 @@ class Action { * @param {InputSource} inputSource - State of the current input device. * @param {number} tickDuration - Length of the current tick, in ms. * @param {WindowProxy} win - Current window global. - * @return {Promise} - Promise that is resolved once the action is complete. + * @returns {Promise} - Promise that is resolved once the action is complete. */ dispatch(state, inputSource, tickDuration, win) { throw new Error( @@ -550,9 +550,9 @@ class Action { /** * @param {string} type - Input source type. * @param {string} type - Input source id. - * @param {Object} actionItem - Object representing a single action. + * @param {object} actionItem - Object representing a single action. * - * @return {Action} - An action that can be dispatched. + * @returns {Action} - An action that can be dispatched. * * @throws {InvalidArgumentError} * If any actionSequence or actionItem @@ -589,7 +589,7 @@ class NullAction extends Action { * Action that waits for a given duration. * * @param {string} id - Input source ID. - * @param {Object} options - Named arguments. + * @param {object} options - Named arguments. * @param {number} options.duration - Time to pause, in ms. */ class PauseAction extends NullAction { @@ -609,7 +609,7 @@ class PauseAction extends NullAction { * @param {InputSource} inputSource - State of the current input device. * @param {number} tickDuration - Length of the current tick, in ms. * @param {WindowProxy} win - Current window global. - * @return {Promise} - Promise that is resolved once the action is complete. + * @returns {Promise} - Promise that is resolved once the action is complete. */ dispatch(state, inputSource, tickDuration, win) { const ms = this.duration ?? tickDuration; @@ -635,7 +635,7 @@ class PauseAction extends NullAction { * Action associated with a keyboard input device * * @param {string} id - Input source ID. - * @param {Object} options - Named arguments. + * @param {object} options - Named arguments. * @param {string} options.value - Key character. */ class KeyAction extends Action { @@ -736,7 +736,7 @@ class KeyUpAction extends KeyAction { * Action associated with a pointer input device * * @param {string} id - Input source ID. - * @param {Object} options - Named arguments. + * @param {object} options - Named arguments. * @param {number=} options.width - Pointer width in pixels. * @param {number=} options.height - Pointer height in pixels. * @param {number=} options.pressure - Pointer pressure. @@ -777,7 +777,7 @@ class PointerAction extends Action { /** * Validate properties common to all pointer types * - * @param {Object} actionItem - Object representing a single action. + * @param {object} actionItem - Object representing a single action. */ static validateCommon(actionItem) { const { @@ -872,7 +872,7 @@ class PointerAction extends Action { * Action associated with a pointer input device being depressed. * * @param {string} id - Input source ID. - * @param {Object} options - Named arguments. + * @param {object} options - Named arguments. * @param {number} options.button - Button being pressed. For devices without buttons (e.g. touch), this should be 0. * @param {number=} options.width - Pointer width in pixels. * @param {number=} options.height - Pointer height in pixels. @@ -927,7 +927,7 @@ class PointerDownAction extends PointerAction { * Action associated with a pointer input device being released. * * @param {string} id - Input source ID. - * @param {Object} options - Named arguments. + * @param {object} options - Named arguments. * @param {number} options.button - Button being released. For devices without buttons (e.g. touch), this should be 0. * @param {number=} options.width - Pointer width in pixels. * @param {number=} options.height - Pointer height in pixels. @@ -981,7 +981,7 @@ class PointerUpAction extends PointerAction { * Action associated with a pointer input device being moved. * * @param {string} id - Input source ID. - * @param {Object} options - Named arguments. + * @param {object} options - Named arguments. * @param {number=} options.width - Pointer width in pixels. * @param {number=} options.height - Pointer height in pixels. * @param {number=} options.pressure - Pointer pressure. @@ -1035,7 +1035,7 @@ class PointerMoveAction extends PointerAction { * * @param {State} state - Actions state. * @param {InputSource} inputSource - State of the current input device. - * @param {Array>} targets - Array of [x, y] arrays + * @param {Array>} targets - Array of [x, y] arrays * specifying the viewport coordinates to move to. * @param {WindowProxy} win - Current window global. */ @@ -1262,7 +1262,7 @@ class TouchActionGroup { * with {@link Action.dispatch}. * @param {number} tickDuration - Length of the current tick, in ms. * @param {WindowProxy} win - Current window global. - * @return {Promise} - Promise that is resolved once the action is complete. + * @returns {Promise} - Promise that is resolved once the action is complete. */ dispatch(state, inputSource, tickDuration, win) { throw new Error( @@ -1642,7 +1642,7 @@ class Pointer { /** * @param {number} pointerId - Numeric pointer id. * @param {string} pointerType - Pointer type. - * @return {Pointer} - The pointer class for {@link pointerType} + * @returns {Pointer} - The pointer class for {@link pointerType} * * @throws {InvalidArgumentError} - If {@link pointerType} is not a valid pointer type. */ @@ -1754,7 +1754,7 @@ action.Chain = class extends Array { * * @param {State} state - Actions state. * @param {WindowProxy} win - Current window global. - * @return {Promise} - Promise that is resolved once the action + * @returns {Promise} - Promise that is resolved once the action * chain is complete. */ dispatch(state, win) { @@ -1769,9 +1769,9 @@ action.Chain = class extends Array { } /** - * @param {Array.} actions - Array of objects that each + * @param {Array.} actions - Array of objects that each * represent an action sequence. - * @return {action.Chain} - Object that allows dispatching a chain + * @returns {action.Chain} - Object that allows dispatching a chain * of actions. * @throws {InvalidArgumentError} - If actions doesn't correspond to * a valid action chain. @@ -1804,7 +1804,7 @@ class TickActions extends Array { /** * Tick duration in milliseconds. * - * @return {number} - Longest action duration in |tickActions| if any, or 0. + * @returns {number} - Longest action duration in |tickActions| if any, or 0. */ getDuration() { let max = 0; @@ -1830,7 +1830,7 @@ class TickActions extends Array { * @param {State} state - Actions state. * @param {WindowProxy} win - Current window global. * - * @return {Promise} - Promise that resolves when tick is complete. + * @returns {Promise} - Promise that resolves when tick is complete. */ dispatch(state, win) { const tickDuration = this.getDuration(); @@ -1849,7 +1849,7 @@ class TickActions extends Array { * actions into {@link TouchActionGroup} instances. * * @param {State} state - Actions state. - * @return {Array.>} + * @returns {Array.>} * Array of pairs. For ungrouped actions each element is * [InputSource, Action] For touch actions there are multiple * pointers handled at once, so the first item of the array is @@ -1894,9 +1894,9 @@ class Sequence extends Array { /** * @param {State} state - Actions state. - * @param {Object} actionSequence + * @param {object} actionSequence * Protocol representation of the actions for a specific input source. - * @return {Array.} - Array of [InputSource?,Action|TouchActionGroup] + * @returns {Array.} - Array of [InputSource?,Action|TouchActionGroup] */ static fromJSON(state, actionSequence) { // used here to validate 'type' in addition to InputSource type below @@ -2020,7 +2020,7 @@ class MouseEventData extends PointerEventData { /** * Representation of a wheel scroll event * - * @param {Object} options - Named arguments. + * @param {object} options - Named arguments. * @param {number} options.deltaX - Scroll delta X. * @param {number} options.deltaY - Scroll delta Y. * @param {number} options.deltaY - Scroll delta Z (current always 0). diff --git a/remote/shared/webdriver/Assert.sys.mjs b/remote/shared/webdriver/Assert.sys.mjs index ed0278308a19..baa1046bc964 100644 --- a/remote/shared/webdriver/Assert.sys.mjs +++ b/remote/shared/webdriver/Assert.sys.mjs @@ -99,7 +99,7 @@ assert.mobile = function(msg = "") { * @param {string=} msg * Custom error message. * - * @return {string} + * @returns {string} * context is returned unaltered. * * @throws {UnsupportedOperationError} @@ -122,7 +122,7 @@ assert.content = function(context, msg = "") { * @param {string=} msg * Custom error message. * - * @return {CanonicalBrowsingContext} + * @returns {CanonicalBrowsingContext} * browsingContext is returned unaltered. * * @throws {NoSuchWindowError} @@ -174,7 +174,7 @@ assert.noUserPrompt = function(dialog, msg = "") { * @param {string=} msg * Custom error message. * - * @return {?} + * @returns {?} * obj is returned unaltered. * * @throws {InvalidArgumentError} @@ -193,7 +193,7 @@ assert.defined = function(obj, msg = "") { * @param {string=} msg * Custom error message. * - * @return {number} + * @returns {number} * obj is returned unaltered. * * @throws {InvalidArgumentError} @@ -212,7 +212,7 @@ assert.number = function(obj, msg = "") { * @param {string=} msg * Custom error message. * - * @return {number} + * @returns {number} * obj is returned unaltered. * * @throws {InvalidArgumentError} @@ -234,7 +234,7 @@ assert.positiveNumber = function(obj, msg = "") { * @param {string=} msg * Custom error message. * - * @return {number} + * @returns {number} * obj is returned unaltered. * * @throws {InvalidArgumentError} @@ -255,7 +255,7 @@ assert.numberInRange = function(obj, range, msg = "") { * @param {string=} msg * Custom error message. * - * @return {Function} + * @returns {Function} * obj is returned unaltered. * * @throws {InvalidArgumentError} @@ -274,7 +274,7 @@ assert.callable = function(obj, msg = "") { * @param {string=} msg * Custom error message. * - * @return {number} + * @returns {number} * obj is returned unaltered. * * @throws {InvalidArgumentError} @@ -293,7 +293,7 @@ assert.unsignedShort = function(obj, msg = "") { * @param {string=} msg * Custom error message. * - * @return {number} + * @returns {number} * obj is returned unaltered. * * @throws {InvalidArgumentError} @@ -312,7 +312,7 @@ assert.integer = function(obj, msg = "") { * @param {string=} msg * Custom error message. * - * @return {number} + * @returns {number} * obj is returned unaltered. * * @throws {InvalidArgumentError} @@ -334,7 +334,7 @@ assert.positiveInteger = function(obj, msg = "") { * @param {string=} msg * Custom error message. * - * @return {number} + * @returns {number} * obj is returned unaltered. * * @throws {InvalidArgumentError} @@ -355,7 +355,7 @@ assert.integerInRange = function(obj, range, msg = "") { * @param {string=} msg * Custom error message. * - * @return {boolean} + * @returns {boolean} * obj is returned unaltered. * * @throws {InvalidArgumentError} @@ -374,7 +374,7 @@ assert.boolean = function(obj, msg = "") { * @param {string=} msg * Custom error message. * - * @return {string} + * @returns {string} * obj is returned unaltered. * * @throws {InvalidArgumentError} @@ -393,7 +393,7 @@ assert.string = function(obj, msg = "") { * @param {string=} msg * Custom error message. * - * @return {Object} + * @returns {object} * obj| is returned unaltered. * * @throws {InvalidArgumentError} @@ -419,7 +419,7 @@ assert.object = function(obj, msg = "") { * @param {string=} msg * Custom error message. * - * @return {?} + * @returns {?} * The array element, or the value of obj's own property * prop. * @@ -447,7 +447,7 @@ assert.in = function(prop, obj, msg = "") { * @param {string=} msg * Custom error message. * - * @return {Object} + * @returns {object} * obj is returned unaltered. * * @throws {InvalidArgumentError} @@ -470,7 +470,7 @@ assert.array = function(obj, msg = "") { * @param {Error=} error * Custom error type by its class. * - * @return {function(?): ?} + * @returns {function(?): ?} * Function that takes and returns the passed in value unaltered, * and which may throw error with message * if predicate evaluates to false. diff --git a/remote/shared/webdriver/Capabilities.sys.mjs b/remote/shared/webdriver/Capabilities.sys.mjs index 7a1552746d5d..0a418267847d 100644 --- a/remote/shared/webdriver/Capabilities.sys.mjs +++ b/remote/shared/webdriver/Capabilities.sys.mjs @@ -127,7 +127,7 @@ export class Proxy { /** * Sets Firefox proxy settings. * - * @return {boolean} + * @returns {boolean} * True if proxy settings were updated as a result of calling this * function, or false indicating that this function acted as * a no-op. @@ -201,7 +201,7 @@ export class Proxy { } /** - * @param {Object.} json + * @param {Object} json * JSON Object to unmarshal. * * @throws {InvalidArgumentError} @@ -346,7 +346,7 @@ export class Proxy { } /** - * @return {Object.} + * @returns {Object} * JSON serialisation of proxy object. */ toJSON() { @@ -482,7 +482,7 @@ export class Capabilities extends Map { /** * JSON serialisation of capabilities object. * - * @return {Object.} + * @returns {Object} */ toJSON() { let marshalled = marshal(this); @@ -500,10 +500,10 @@ export class Capabilities extends Map { /** * Unmarshal a JSON object representation of WebDriver capabilities. * - * @param {Object.=} json + * @param {Object=} json * WebDriver capabilities. * - * @return {Capabilities} + * @returns {Capabilities} * Internal representation of WebDriver capabilities. */ static fromJSON(json) { diff --git a/remote/shared/webdriver/Errors.sys.mjs b/remote/shared/webdriver/Errors.sys.mjs index 503cd0860ac2..885767cefba4 100644 --- a/remote/shared/webdriver/Errors.sys.mjs +++ b/remote/shared/webdriver/Errors.sys.mjs @@ -74,7 +74,7 @@ export const error = { * * @param {*} val * Any value that should be undergo the test for errorness. - * @return {boolean} + * @returns {boolean} * True if error, false otherwise. */ isError(val) { @@ -100,7 +100,7 @@ export const error = { * @param {*} obj * Arbitrary object to test. * - * @return {boolean} + * @returns {boolean} * True if ``obj`` is of the WebDriverError prototype chain, * false otherwise. */ @@ -121,7 +121,7 @@ export const error = { * @param {Error} err * Error to conditionally turn into a WebDriverError. * - * @return {WebDriverError} + * @returns {WebDriverError} * If ``err`` is a WebDriverError, it is returned unmodified. * Otherwise an UnknownError type is returned. */ @@ -190,7 +190,7 @@ class WebDriverError extends RemoteError { } /** - * @return {Object.} + * @returns {Object} * JSON serialisation of error prototype. */ toJSON() { @@ -205,10 +205,10 @@ class WebDriverError extends RemoteError { * Unmarshals a JSON error representation to the appropriate Marionette * error type. * - * @param {Object.} json + * @param {Object} json * Error object. * - * @return {Error} + * @returns {Error} * Error prototype. */ static fromJSON(json) { diff --git a/remote/shared/webdriver/KeyData.sys.mjs b/remote/shared/webdriver/KeyData.sys.mjs index 5d2570686fe3..6155aa612f43 100644 --- a/remote/shared/webdriver/KeyData.sys.mjs +++ b/remote/shared/webdriver/KeyData.sys.mjs @@ -316,7 +316,7 @@ export const keyData = { * itself or one of the codepoints in the range U+E000-U+E05D that * WebDriver uses to represent keys not corresponding directly to * a codepoint. - * @returns {Object} Key event data object. + * @returns {object} Key event data object. */ getData(rawKey) { let keyData = { key: rawKey, location: 0, printable: true, shifted: false }; diff --git a/remote/shared/webdriver/NodeCache.sys.mjs b/remote/shared/webdriver/NodeCache.sys.mjs index d2597f43f931..2cb138267a28 100644 --- a/remote/shared/webdriver/NodeCache.sys.mjs +++ b/remote/shared/webdriver/NodeCache.sys.mjs @@ -3,7 +3,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ /** - * @typedef {Object} NodeReferenceDetails + * @typedef {object} NodeReferenceDetails * @property {number} browserId * @property {number} browsingContextGroupId * @property {number} browsingContextId @@ -45,7 +45,7 @@ export class NodeCache { * @param {Node} node * The node to be added. * - * @return {string} + * @returns {string} * The unique node reference for the DOM node. */ getOrCreateNodeReference(node) { @@ -87,7 +87,7 @@ export class NodeCache { /** * Clear known DOM nodes. * - * @param {Object=} options + * @param {object=} options * @param {boolean=} options.all * Clear all references from any browsing context. Defaults to false. * @param {BrowsingContext=} browsingContext @@ -127,7 +127,7 @@ export class NodeCache { * @param {string} nodeId * The unique node reference of the DOM node. * - * @return {Node|null} + * @returns {Node|null} * The DOM node that the unique identifier was generated for or * `null` if the node does not exist anymore. */ diff --git a/remote/shared/webdriver/Session.sys.mjs b/remote/shared/webdriver/Session.sys.mjs index f37c5e5e926f..4d336e7a55a9 100644 --- a/remote/shared/webdriver/Session.sys.mjs +++ b/remote/shared/webdriver/Session.sys.mjs @@ -142,7 +142,7 @@ export class WebDriverSession { * {"capabilities": {"acceptInsecureCerts": true}} * * - * @param {Object.=} capabilities + * @param {Object=} capabilities * JSON Object containing any of the recognised capabilities listed * above. * diff --git a/remote/shared/webdriver/process-actors/WebDriverProcessDataChild.sys.mjs b/remote/shared/webdriver/process-actors/WebDriverProcessDataChild.sys.mjs index b7c6f8a85787..08ece8eb8a21 100644 --- a/remote/shared/webdriver/process-actors/WebDriverProcessDataChild.sys.mjs +++ b/remote/shared/webdriver/process-actors/WebDriverProcessDataChild.sys.mjs @@ -62,7 +62,7 @@ export class WebDriverProcessDataChild extends JSProcessActorChild { /** * Clean up all the process specific data. * - * @param {Object=} options + * @param {object=} options * @param {BrowsingContext=} browsingContext * If specified only clear data living in that browsing context. */ diff --git a/remote/webdriver-bidi/Realm.sys.mjs b/remote/webdriver-bidi/Realm.sys.mjs index 5ddf85932f39..14eaf05ad3ee 100644 --- a/remote/webdriver-bidi/Realm.sys.mjs +++ b/remote/webdriver-bidi/Realm.sys.mjs @@ -17,14 +17,14 @@ XPCOMUtils.defineLazyGetter(lazy, "dbg", () => { /** * @typedef {string} RealmType - **/ + */ /** * Enum of realm types. * * @readonly * @enum {RealmType} - **/ + */ export const RealmType = { AudioWorklet: "audio-worklet", DedicatedWorker: "dedicated-worker", @@ -71,7 +71,7 @@ export class Realm { /** * Get the unique identifier of the realm instance. * - * @return {string} The unique identifier. + * @returns {string} The unique identifier. */ get id() { return this.#id; @@ -89,10 +89,10 @@ export class Realm { /** * Ensure the provided object can be used within this realm. - * @param {Object} object + * @param {object} object * Any non-primitive object. - * @return {Object} + * @returns {object} * An object usable in the current realm. */ cloneIntoRealm(obj) { @@ -113,9 +113,9 @@ export class Realm { * Get a new unique handle for the provided object, creating a strong * reference on the object. * - * @param {Object} object + * @param {object} object * Any non-primitive object. - * @return {string} The unique handle created for this strong reference. + * @returns {string} The unique handle created for this strong reference. */ getHandleForObject(object) { const handle = getUUID(); @@ -126,7 +126,7 @@ export class Realm { /** * Get the basic realm information. * - * @return {BaseRealmInfo} + * @returns {BaseRealmInfo} */ getInfo() { return { @@ -140,7 +140,7 @@ export class Realm { * * @param {string} handle * The unique handle of an object reference tracked in this realm. - * @return {Object} object + * @returns {object} object * Any non-primitive object. */ getObjectForHandle(handle) { @@ -163,7 +163,7 @@ export class WindowRealm extends Realm { * * @param {Window} window * The window global to wrap. - * @param {Object} options + * @param {object} options * @param {string=} options.sandboxName * Name of the sandbox to create if specified. Defaults to `null`. */ @@ -225,10 +225,10 @@ export class WindowRealm extends Realm { * Clone the provided object into the scope of this Realm (either a window * global, or a sandbox). * - * @param {Object} obj + * @param {object} obj * Any non-primitive object. * - * @return {Object} + * @returns {object} * The cloned object. */ cloneIntoRealm(obj) { @@ -241,7 +241,7 @@ export class WindowRealm extends Realm { * @param {string} expression * The expression to evaluate. * - * @return {Object} + * @returns {object} * - evaluationStatus {EvaluationStatus} One of "normal", "throw". * - exceptionDetails {ExceptionDetails=} the details of the exception if * the evaluation status was "throw". @@ -259,12 +259,12 @@ export class WindowRealm extends Realm { * * @param {string} functionDeclaration * The body of the function to call. - * @param {Array} functionArguments + * @param {Array} functionArguments * The arguments to pass to the function call. - * @param {Object} thisParameter + * @param {object} thisParameter * The value of the `this` keyword for the function call. * - * @return {Object} + * @returns {object} * - evaluationStatus {EvaluationStatus} One of "normal", "throw". * - exceptionDetails {ExceptionDetails=} the details of the exception if * the evaluation status was "throw". @@ -298,7 +298,7 @@ export class WindowRealm extends Realm { /** * Get the realm information. * - * @return {Object} + * @returns {object} * - context {BrowsingContext} The browsing context, associated with the realm. * - id {string} The realm unique identifier. * - origin {string} The serialization of an origin. diff --git a/remote/webdriver-bidi/RemoteValue.sys.mjs b/remote/webdriver-bidi/RemoteValue.sys.mjs index c4c014d9c336..4044765dd904 100644 --- a/remote/webdriver-bidi/RemoteValue.sys.mjs +++ b/remote/webdriver-bidi/RemoteValue.sys.mjs @@ -17,15 +17,15 @@ XPCOMUtils.defineLazyGetter(lazy, "logger", () => ); /** - * @typedef {Object} OwnershipModel - **/ + * @typedef {object} OwnershipModel + */ /** * Enum of ownership models supported by the serialization. * * @readonly * @enum {OwnershipModel} - **/ + */ export const OwnershipModel = { None: "none", Root: "root", @@ -55,7 +55,7 @@ const TYPED_ARRAY_CLASSES = [ /** * Build the serialized RemoteValue. * - * @return {Object} + * @returns {object} * An object with a mandatory `type` property, and optional `handle`, * depending on the OwnershipModel, used for the serialization and * on the value's type. @@ -114,11 +114,11 @@ function checkDateTimeString(dateString) { * The Realm in which the value is deserialized. * @param {Array} serializedValueList * List of serialized values. - * @param {Object} options + * @param {object} options * @param {NodeCache} options.nodeCache * The cache containing DOM node references. * - * @return {Array} List of deserialized values. + * @returns {Array} List of deserialized values. * * @throws {InvalidArgumentError} * If serializedValueList is not an array. @@ -147,11 +147,11 @@ function deserializeValueList(realm, serializedValueList, options = {}) { * The Realm in which the value is deserialized. * @param {Array} serializedKeyValueList * List of serialized key-value. - * @param {Object} options + * @param {object} options * @param {NodeCache} options.nodeCache * The cache containing DOM node references. * - * @return {Array} List of deserialized key-value. + * @returns {Array} List of deserialized key-value. * * @throws {InvalidArgumentError} * If serializedKeyValueList is not an array or @@ -195,11 +195,11 @@ function deserializeKeyValueList(realm, serializedKeyValueList, options = {}) { * Shared unique reference of the Node. * @param {Realm} realm * The Realm in which the value is deserialized. - * @param {Object} options + * @param {object} options * @param {NodeCache} options.nodeCache * The cache containing DOM node references. * - * @return {Node} The deserialized DOM node. + * @returns {Node} The deserialized DOM node. */ function deserializeSharedReference(sharedRef, realm, options = {}) { const { nodeCache } = options; @@ -246,13 +246,13 @@ function deserializeSharedReference(sharedRef, realm, options = {}) { * * @param {Realm} realm * The Realm in which the value is deserialized. - * @param {Object} serializedValue + * @param {object} serializedValue * Value of any type to be deserialized. - * @param {Object} options + * @param {object} options * @param {NodeCache} options.nodeCache * The cache containing DOM node references. * - * @return {Object} Deserialized representation of the value. + * @returns {object} Deserialized representation of the value. */ export function deserialize(realm, serializedValue, options = {}) { const { handle, sharedId, type, value } = serializedValue; @@ -397,10 +397,10 @@ export function deserialize(realm, serializedValue, options = {}) { * The Realm from which comes the value being serialized. * @param {OwnershipModel} ownershipType * The ownership model to use for this serialization. - * @param {Object} object + * @param {object} object * The object being serialized. * - * @return {string} The unique handle id for the object. Will be null if the + * @returns {string} The unique handle id for the object. Will be null if the * Ownership type is "none". */ function getHandleForObject(realm, ownershipType, object) { @@ -421,7 +421,7 @@ function getHandleForObject(realm, ownershipType, object) { * Node to create the unique reference for. * @param {Realm} realm * The Realm in which the value is serialized. - * @param {Object} options + * @param {object} options * @param {NodeCache} options.nodeCache * The cache containing DOM node references. * @@ -473,7 +473,7 @@ function isShadowRoot(node) { * The unique id of the value. * @param {boolean} knownObject * Indicates if the value has already been serialized. - * @param {Object} value + * @param {object} value * The Array-like object to serialize. * @param {number|null} maxDepth * Depth of a serialization. @@ -483,11 +483,11 @@ function isShadowRoot(node) { * Map of internal ids. * @param {Realm} realm * The Realm from which comes the value being serialized. - * @param {Object} options + * @param {object} options * @param {NodeCache} options.nodeCache * The cache containing DOM node references. * - * @return {Object} Object for serialized values. + * @returns {object} Object for serialized values. */ function serializeArrayLike( production, @@ -532,11 +532,11 @@ function serializeArrayLike( * Map of internal ids. * @param {Realm} realm * The Realm from which comes the value being serialized. - * @param {Object} options + * @param {object} options * @param {NodeCache} options.nodeCache * The cache containing DOM node references. * - * @return {Array} List of serialized values. + * @returns {Array} List of serialized values. */ function serializeList( iterable, @@ -580,11 +580,11 @@ function serializeList( * Map of internal ids. * @param {Realm} realm * The Realm from which comes the value being serialized. - * @param {Object} options + * @param {object} options * @param {NodeCache} options.nodeCache * The cache containing DOM node references. * - * @return {Array} List of serialized values. + * @returns {Array} List of serialized values. */ function serializeMapping( iterable, @@ -637,11 +637,11 @@ function serializeMapping( * Map of internal ids. * @param {Realm} realm * The Realm from which comes the value being serialized. - * @param {Object} options + * @param {object} options * @param {NodeCache} options.nodeCache * The cache containing DOM node references. * - * @return {Object} Serialized value. + * @returns {object} Serialized value. */ function serializeNode( node, @@ -721,7 +721,7 @@ function serializeNode( * * @see https://w3c.github.io/webdriver-bidi/#serialize-as-a-remote-value * - * @param {Object} value + * @param {object} value * Value of any type to be serialized. * @param {number|null} maxDepth * Depth of a serialization. @@ -731,11 +731,11 @@ function serializeNode( * Map of internal ids. * @param {Realm} realm * The Realm from which comes the value being serialized. - * @param {Object} options + * @param {object} options * @param {NodeCache} options.nodeCache * The cache containing DOM node references. * - * @return {Object} Serialized representation of the value. + * @returns {object} Serialized representation of the value. */ export function serialize( value, @@ -900,9 +900,9 @@ export function serialize( * * @param {Map} serializationInternalMap * Map of objects to remote values. - * @param {Object} remoteValue + * @param {object} remoteValue * A serialized RemoteValue for the provided object. - * @param {Object} object + * @param {object} object * Object of any type to be serialized. */ function setInternalIdsIfNeeded(serializationInternalMap, remoteValue, object) { @@ -930,10 +930,10 @@ function setInternalIdsIfNeeded(serializationInternalMap, remoteValue, object) { /** * Safely stringify a value. * - * @param {Object} value + * @param {object} value * Value of any type to be stringified. * - * @return {string} String representation of the value. + * @returns {string} String representation of the value. */ export function stringify(obj) { let text; diff --git a/remote/webdriver-bidi/WebDriverBiDi.sys.mjs b/remote/webdriver-bidi/WebDriverBiDi.sys.mjs index 846f5174cbff..8d35ce8ebca3 100644 --- a/remote/webdriver-bidi/WebDriverBiDi.sys.mjs +++ b/remote/webdriver-bidi/WebDriverBiDi.sys.mjs @@ -60,7 +60,7 @@ export class WebDriverBiDi { /** * Create a new WebDriver session. * - * @param {Object.=} capabilities + * @param {Object=} capabilities * JSON Object containing any of the recognised capabilities as listed * on the `WebDriverSession` class. * @@ -68,7 +68,7 @@ export class WebDriverBiDi { * Optional connection that is not yet accociated with a WebDriver * session, and has to be associated with the new WebDriver session. * - * @return {Object} + * @returns {Object} * Object containing the current session ID, and all its capabilities. * * @throws {SessionNotCreatedError} @@ -149,7 +149,7 @@ export class WebDriverBiDi { * * See https://w3c.github.io/webdriver-bidi/#command-session-status * - * @return {Object} + * @returns {object} * The readiness state. */ getSessionReadinessStatus() { diff --git a/remote/webdriver-bidi/WebDriverBiDiConnection.sys.mjs b/remote/webdriver-bidi/WebDriverBiDiConnection.sys.mjs index 18905975954b..6668109a4e94 100644 --- a/remote/webdriver-bidi/WebDriverBiDiConnection.sys.mjs +++ b/remote/webdriver-bidi/WebDriverBiDiConnection.sys.mjs @@ -70,7 +70,7 @@ export class WebDriverBiDiConnection extends WebSocketConnection { /** * Send an error back to the WebDriver BiDi client. * - * @param {Number} id + * @param {number} id * Id of the packet which lead to an error. * @param {Error} err * Error object with `status`, `message` and `stack` attributes. @@ -89,10 +89,10 @@ export class WebDriverBiDiConnection extends WebSocketConnection { /** * Send an event coming from a module to the WebDriver BiDi client. * - * @param {String} method + * @param {string} method * The event name. This is composed by a module name, a dot character * followed by the event name, e.g. `log.entryAdded`. - * @param {Object} params + * @param {object} params * A JSON-serializable object, which is the payload of this event. */ sendEvent(method, params) { @@ -111,9 +111,9 @@ export class WebDriverBiDiConnection extends WebSocketConnection { * Send the result of a call to a module's method back to the * WebDriver BiDi client. * - * @param {Number} id + * @param {number} id * The request id being sent by the client to call the module's method. - * @param {Object} result + * @param {object} result * A JSON-serializable object, which is the actual result. */ sendResult(id, result) { @@ -196,10 +196,10 @@ export class WebDriverBiDiConnection extends WebSocketConnection { /** * Splits a WebDriver BiDi method into module and command components. * - * @param {String} method + * @param {string} method * Name of the method to split, e.g. "session.subscribe". * - * @returns {Object} + * @returns {Object} * Object with the module ("session") and command ("subscribe") * as properties. */ diff --git a/remote/webdriver-bidi/modules/ModuleRegistry.sys.mjs b/remote/webdriver-bidi/modules/ModuleRegistry.sys.mjs index 6ae6607f7c6d..3f86027d2b5f 100644 --- a/remote/webdriver-bidi/modules/ModuleRegistry.sys.mjs +++ b/remote/webdriver-bidi/modules/ModuleRegistry.sys.mjs @@ -45,16 +45,16 @@ ChromeUtils.defineESModuleGetters(modules.windowglobal, { * Retrieve the WebDriver BiDi module class matching the provided module name * and folder. * - * @param {String} moduleName + * @param {string} moduleName * The name of the module to get the class for. - * @param {String} moduleFolder + * @param {string} moduleFolder * A valid folder name for modules. - * @return {Class=} + * @returns {Class=} * The class corresponding to the module name and folder, null if no match * was found. * @throws {Error} * If the provided module folder is unexpected. - **/ + */ export const getModuleClass = function(moduleName, moduleFolder) { if (!modules[moduleFolder]) { throw new Error( diff --git a/remote/webdriver-bidi/modules/root/browsingContext.sys.mjs b/remote/webdriver-bidi/modules/root/browsingContext.sys.mjs index dca592c2f8e0..2e006040e101 100644 --- a/remote/webdriver-bidi/modules/root/browsingContext.sys.mjs +++ b/remote/webdriver-bidi/modules/root/browsingContext.sys.mjs @@ -34,15 +34,15 @@ XPCOMUtils.defineLazyGetter(lazy, "logger", () => ); /** - * @typedef {Object} CreateType - **/ + * @typedef {object} CreateType + */ /** * Enum of types supported by the browsingContext.create command. * * @readonly * @enum {CreateType} - **/ + */ const CreateType = { tab: "tab", window: "window", @@ -50,7 +50,7 @@ const CreateType = { /** * @typedef {string} WaitCondition - **/ + */ /** * Wait conditions supported by WebDriver BiDi for navigation. @@ -94,7 +94,7 @@ class BrowsingContextModule extends Module { /** * Capture a base64-encoded screenshot of the provided browsing context. * - * @param {Object=} options + * @param {object=} options * @param {string} context * Id of the browsing context to screenshot. * @@ -137,7 +137,7 @@ class BrowsingContextModule extends Module { /** * Close the provided browsing context. * - * @param {Object=} options + * @param {object=} options * @param {string} context * Id of the browsing context to close. * @@ -182,7 +182,7 @@ class BrowsingContextModule extends Module { /** * Create a new browsing context using the provided type "tab" or "window". * - * @param {Object=} options + * @param {object=} options * @param {string=} options.referenceContext * Id of the top-level browsing context to use as reference. * If options.type is "tab", the new tab will open in the same window as @@ -291,7 +291,7 @@ class BrowsingContextModule extends Module { * Returns a tree of all browsing contexts that are descendents of the * given context, or all top-level contexts when no root is provided. * - * @param {Object=} options + * @param {object=} options * @param {number=} maxDepth * Depth of the browsing context tree to traverse. If not specified * the whole tree is returned. @@ -341,16 +341,16 @@ class BrowsingContextModule extends Module { * * @typedef BrowsingContextNavigateResult * - * @property {String} navigation + * @property {string} navigation * Unique id for this navigation. - * @property {String} url + * @property {string} url * The requested or reached URL. */ /** * Navigate the given context to the provided url, with the provided wait condition. * - * @param {Object=} options + * @param {object=} options * @param {string} context * Id of the browsing context to navigate. * @param {string} url @@ -446,7 +446,7 @@ class BrowsingContextModule extends Module { * * @typedef BrowsingContextPrintResult * - * @property {String} data + * @property {string} data * Base64 encoded PDF representing printed document. */ @@ -455,7 +455,7 @@ class BrowsingContextModule extends Module { * of the provided browsing context, and returns it * as a Base64-encoded string. * - * @param {Object=} options + * @param {object=} options * @param {string} options.context * Id of the browsing context. * @param {boolean=} options.background @@ -568,7 +568,7 @@ class BrowsingContextModule extends Module { * The WebProgress instance to observe for this navigation. * @param {nsIURI} targetURI * The URI to navigate to. - * @param {Object} options + * @param {object} options * @param {WaitCondition} options.wait * The WaitCondition to use to wait for the navigation. */ @@ -655,7 +655,7 @@ class BrowsingContextModule extends Module { /** * Retrieves a browsing context based on its id. * - * @param {Number} contextId + * @param {number} contextId * Id of the browsing context. * @returns {BrowsingContext=} * The browsing context or null if contextId is null. @@ -684,7 +684,7 @@ class BrowsingContextModule extends Module { * * @param {BrowsingContext} context * The browsing context to get the information from. - * @param {Object=} options + * @param {object=} options * @param {boolean=} isRoot * Flag that indicates if this browsing context is the root of all the * browsing contexts to be returned. Defaults to true. diff --git a/remote/webdriver-bidi/modules/root/input.sys.mjs b/remote/webdriver-bidi/modules/root/input.sys.mjs index b3b9a1d7408e..a84f2aa6d46e 100644 --- a/remote/webdriver-bidi/modules/root/input.sys.mjs +++ b/remote/webdriver-bidi/modules/root/input.sys.mjs @@ -46,7 +46,7 @@ class InputModule extends Module { /** * Reset the input state in the provided browsing context. * - * @param {Object=} options + * @param {object=} options * @param {string} options.context * Id of the browsing context to reset the input state. * diff --git a/remote/webdriver-bidi/modules/root/network.sys.mjs b/remote/webdriver-bidi/modules/root/network.sys.mjs index 227fbc4fd7f8..29f478c7801d 100644 --- a/remote/webdriver-bidi/modules/root/network.sys.mjs +++ b/remote/webdriver-bidi/modules/root/network.sys.mjs @@ -15,7 +15,7 @@ ChromeUtils.defineESModuleGetters(lazy, { }); /** - * @typedef {Object} BaseParameters + * @typedef {object} BaseParameters * @property {string=} context * @property {Navigation=} navigation * @property {number} redirectCount @@ -24,7 +24,7 @@ ChromeUtils.defineESModuleGetters(lazy, { */ /** - * @typedef {Object} Cookie + * @typedef {object} Cookie * @property {Array=} binaryValue * @property {string} domain * @property {number=} expires @@ -38,7 +38,7 @@ ChromeUtils.defineESModuleGetters(lazy, { */ /** - * @typedef {Object} FetchTimingInfo + * @typedef {object} FetchTimingInfo * @property {number} originTime * @property {number} requestTime * @property {number} redirectStart @@ -55,7 +55,7 @@ ChromeUtils.defineESModuleGetters(lazy, { */ /** - * @typedef {Object} Header + * @typedef {object} Header * @property {Array=} binaryValue * @property {string} name * @property {string=} value @@ -63,14 +63,14 @@ ChromeUtils.defineESModuleGetters(lazy, { /** * @typedef {string} InitiatorType - **/ + */ /** * Enum of possible initiator types. * * @readonly * @enum {InitiatorType} - **/ + */ const InitiatorType = { Other: "other", Parser: "parser", @@ -78,7 +78,7 @@ const InitiatorType = { Script: "script", }; /** - * @typedef {Object} Initiator + * @typedef {object} Initiator * @property {InitiatorType} type * @property {number=} columnNumber * @property {number=} lineNumber @@ -87,7 +87,7 @@ const InitiatorType = { */ /** - * @typedef {Object} RequestData + * @typedef {object} RequestData * @property {number|null} bodySize * Defaults to null. * @property {Array} cookies @@ -100,7 +100,7 @@ const InitiatorType = { */ /** - * @typedef {Object} BeforeRequestSentParametersProperties + * @typedef {object} BeforeRequestSentParametersProperties * @property {Initiator} initiator */ @@ -111,13 +111,13 @@ const InitiatorType = { */ /** - * @typedef {Object} ResponseContent + * @typedef {object} ResponseContent * @property {number|null} size * Defaults to null. */ /** - * @typedef {Object} ResponseData + * @typedef {object} ResponseData * @property {string} url * @property {string} protocol * @property {number} status @@ -134,7 +134,7 @@ const InitiatorType = { */ /** - * @typedef {Object} ResponseStartedParametersProperties + * @typedef {object} ResponseStartedParametersProperties * @property {ResponseData} response */ @@ -145,7 +145,7 @@ const InitiatorType = { */ /** - * @typedef {Object} ResponseCompletedParametersProperties + * @typedef {object} ResponseCompletedParametersProperties * @property {ResponseData} response */ diff --git a/remote/webdriver-bidi/modules/root/script.sys.mjs b/remote/webdriver-bidi/modules/root/script.sys.mjs index 7b1aa98be9c4..312cd3d20c9e 100644 --- a/remote/webdriver-bidi/modules/root/script.sys.mjs +++ b/remote/webdriver-bidi/modules/root/script.sys.mjs @@ -27,14 +27,14 @@ function getUUID() { /** * @typedef {string} ScriptEvaluateResultType - **/ + */ /** * Enum of possible evaluation result types. * * @readonly * @enum {ScriptEvaluateResultType} - **/ + */ const ScriptEvaluateResultType = { Exception: "exception", Success: "success", @@ -80,7 +80,7 @@ class ScriptModule extends Module { * Adds a preload script, which runs on creation of a new Window, * before any author-defined script have run. * - * @param {Object=} options + * @param {object=} options * @param {Array=} arguments [unsupported] * The arguments to pass to the function call. * @param {string} functionDeclaration @@ -213,7 +213,7 @@ class ScriptModule extends Module { * Calls a provided function with given arguments and scope in the provided * target, which is either a realm or a browsing context. * - * @param {Object=} options + * @param {object=} options * @param {Array=} arguments * The arguments to pass to the function call. * @param {boolean} awaitPromise @@ -224,7 +224,7 @@ class ScriptModule extends Module { * @param {OwnershipModel=} resultOwnership * The ownership model to use for the results of this evaluation. Defaults * to `OwnershipModel.None`. - * @param {Object} target + * @param {object} target * The target for the evaluation, which either matches the definition for * a RealmTarget or for ContextTarget. * @param {RemoteValue=} this @@ -294,10 +294,10 @@ class ScriptModule extends Module { * guarantee the handled object will be garbage collected, as there can be * other handles or strong ECMAScript references. * - * @param {Object=} options + * @param {object=} options * @param {Array} handles * Array of handle ids to disown. - * @param {Object} target + * @param {object} target * The target owning the handles, which either matches the definition for * a RealmTarget or for ContextTarget. */ @@ -336,7 +336,7 @@ class ScriptModule extends Module { * Evaluate a provided expression in the provided target, which is either a * realm or a browsing context. * - * @param {Object=} options + * @param {object=} options * @param {boolean} awaitPromise * Determines if the command should wait for the return value of the * expression to resolve, if this return value is a Promise. @@ -345,7 +345,7 @@ class ScriptModule extends Module { * @param {OwnershipModel=} resultOwnership * The ownership model to use for the results of this evaluation. Defaults * to `OwnershipModel.None`. - * @param {Object} target + * @param {object} target * The target for the evaluation, which either matches the definition for * a RealmTarget or for ContextTarget. * @@ -447,7 +447,7 @@ class ScriptModule extends Module { * of a specific type, or to the realms associated with * a specified browsing context. * - * @param {Object=} options + * @param {object=} options * @param {string=} context * The id of the browsing context to filter * only realms associated with it. If not provided, return realms @@ -501,7 +501,7 @@ class ScriptModule extends Module { /** * Removes a preload script. * - * @param {Object=} options + * @param {object=} options * @param {string} script * The unique id associated with a preload script. * diff --git a/remote/webdriver-bidi/modules/root/session.sys.mjs b/remote/webdriver-bidi/modules/root/session.sys.mjs index 281b913f3230..c275825ffcd1 100644 --- a/remote/webdriver-bidi/modules/root/session.sys.mjs +++ b/remote/webdriver-bidi/modules/root/session.sys.mjs @@ -48,7 +48,7 @@ class SessionModule extends Module { /** * Enable certain events either globally, or for a list of browsing contexts. * - * @params {Object=} params + * @params {object=} params * @params {Array} events * List of events to subscribe to. * @params {Array=} contexts @@ -85,7 +85,7 @@ class SessionModule extends Module { /** * Disable certain events either globally, or for a list of browsing contexts. * - * @params {Object=} params + * @params {object=} params * @params {Array} events * List of events to unsubscribe from. * @params {Array=} contexts @@ -211,7 +211,7 @@ class SessionModule extends Module { * @param {string} eventName * The name of the event. * - * @return {Set} The set of browsing context. + * @returns {Set} The set of browsing context. */ #obtainEventEnabledBrowsingContextIds(eventName) { const contextIds = new Set(); @@ -247,7 +247,7 @@ class SessionModule extends Module { * @param {boolean} enabled * True, if events have to be enabled. Otherwise false. * - * @return {Array} subscriptions + * @returns {Array} subscriptions * The list of information to subscribe/unsubscribe to. * * @throws {InvalidArgumentError} diff --git a/remote/webdriver-bidi/modules/windowglobal/log.sys.mjs b/remote/webdriver-bidi/modules/windowglobal/log.sys.mjs index 2509dc4d1009..a02407becced 100644 --- a/remote/webdriver-bidi/modules/windowglobal/log.sys.mjs +++ b/remote/webdriver-bidi/modules/windowglobal/log.sys.mjs @@ -66,7 +66,7 @@ class LogModule extends Module { * @param {Array=} stackTrace * Stack frames to process. * - * @returns {Object=} Object, containing the list of frames as `callFrames`. + * @returns {object=} Object, containing the list of frames as `callFrames`. */ #buildStackTrace(stackTrace) { if (stackTrace == undefined) { diff --git a/remote/webdriver-bidi/modules/windowglobal/script.sys.mjs b/remote/webdriver-bidi/modules/windowglobal/script.sys.mjs index 18c6e2929997..9f2626bbe6c0 100644 --- a/remote/webdriver-bidi/modules/windowglobal/script.sys.mjs +++ b/remote/webdriver-bidi/modules/windowglobal/script.sys.mjs @@ -18,14 +18,14 @@ ChromeUtils.defineESModuleGetters(lazy, { /** * @typedef {string} EvaluationStatus - **/ + */ /** * Enum of possible evaluation states. * * @readonly * @enum {EvaluationStatus} - **/ + */ const EvaluationStatus = { Normal: "normal", Throw: "throw", @@ -288,7 +288,7 @@ class ScriptModule extends Module { /** * Call a function in the current window global. * - * @param {Object} options + * @param {object} options * @param {boolean} awaitPromise * Determines if the command should wait for the return value of the * expression to resolve, if this return value is a Promise. @@ -305,7 +305,7 @@ class ScriptModule extends Module { * @param {RemoteValue=} thisParameter * The value of the this keyword for the function call. * - * @return {Object} + * @returns {object} * - evaluationStatus {EvaluationStatus} One of "normal", "throw". * - exceptionDetails {ExceptionDetails=} the details of the exception if * the evaluation status was "throw". @@ -353,7 +353,7 @@ class ScriptModule extends Module { * Delete the provided handles from the realm corresponding to the provided * sandbox name. * - * @param {Object=} options + * @param {object=} options * @param {Array} handles * Array of handle ids to disown. * @param {string=} realmId @@ -372,7 +372,7 @@ class ScriptModule extends Module { /** * Evaluate a provided expression in the current window global. * - * @param {Object} options + * @param {object} options * @param {boolean} awaitPromise * Determines if the command should wait for the return value of the * expression to resolve, if this return value is a Promise. @@ -385,7 +385,7 @@ class ScriptModule extends Module { * @param {string=} sandbox * The name of the sandbox. * - * @return {Object} + * @returns {object} * - evaluationStatus {EvaluationStatus} One of "normal", "throw". * - exceptionDetails {ExceptionDetails=} the details of the exception if * the evaluation status was "throw". @@ -414,7 +414,7 @@ class ScriptModule extends Module { /** * Get realms for the current window global. * - * @return {Array} + * @returns {Array} * - context {BrowsingContext} The browsing context, associated with the realm. * - id {string} The realm unique identifier. * - origin {string} The serialization of an origin.