commit b38cd3110bddb6972adf11d9cf897c1a19ff0cc7 parent 3f2eb26df7e4e54e3366bdb6abb4cd25d14adc13 Author: Mark Banner <standard8@mozilla.com> Date: Fri, 21 Nov 2025 16:13:47 +0000 Bug 1999554 - Automatically fix ESLint rule jsdoc/check-types for devtools/. r=devtools-reviewers,devtools-backward-compat-reviewers,profiler-reviewers,canaltinova Differential Revision: https://phabricator.services.mozilla.com/D272173 Diffstat:
576 files changed, 4313 insertions(+), 4313 deletions(-)
diff --git a/devtools/client/aboutdebugging/src/modules/debug-target-collapsibilities.js b/devtools/client/aboutdebugging/src/modules/debug-target-collapsibilities.js @@ -15,7 +15,7 @@ const { */ /** - * @return {Object} + * @return {object} * { * key: constants.DEBUG_TARGET_PANE * value: true - collapsed diff --git a/devtools/client/aboutdebugging/src/modules/extensions-helper.js b/devtools/client/aboutdebugging/src/modules/extensions-helper.js @@ -43,7 +43,7 @@ exports.getExtensionUuid = function (extension) { * Note: We cannot use the global window object here because it is undefined if * this module is loaded from a file outside of devtools/client/aboutdebugging/. * See browser-loader.sys.mjs `uri.startsWith(baseURI)` for more details. - * @param {String} message + * @param {string} message * The help message that should be displayed to the user in the filepicker. * @return {Promise} returns a promise that resolves a File object corresponding to the * file selected by the user. diff --git a/devtools/client/aboutdebugging/src/reducers/runtimes-state.js b/devtools/client/aboutdebugging/src/reducers/runtimes-state.js @@ -49,13 +49,13 @@ function RuntimesState() { * Update the runtime matching the provided runtimeId with the content of updatedRuntime, * and return the new state. * - * @param {String} runtimeId + * @param {string} runtimeId * The id of the runtime to update - * @param {Object} updatedRuntime + * @param {object} updatedRuntime * Object used to update the runtime matching the idea using Object.assign. - * @param {Object} state + * @param {object} state * Current runtimes state. - * @return {Object} The updated state + * @return {object} The updated state */ function _updateRuntimeById(runtimeId, updatedRuntime, state) { // Find the array of runtimes that contains the updated runtime. diff --git a/devtools/client/aboutdebugging/test/browser/head.js b/devtools/client/aboutdebugging/test/browser/head.js @@ -436,7 +436,7 @@ function waitUntilUsbDeviceIsUnplugged(deviceName, aboutDebuggingDocument) { * The browser instance to update. * @param {XULTab} tab * The tab to select. - * @param {Object} store + * @param {object} store * The about:debugging redux store. */ async function updateSelectedTab(browser, tab, store) { @@ -468,7 +468,7 @@ async function updateSelectedTab(browser, tab, store) { * The DevToolsToolbox debugging the target. * @param {HTMLElement} inputEl * The <input> element to submit the URL with. - * @param {String} url + * @param {string} url * The URL to navigate to. */ async function synthesizeUrlKeyInput(toolbox, inputEl, url) { @@ -495,7 +495,7 @@ async function synthesizeUrlKeyInput(toolbox, inputEl, url) { * Click on a given add-on widget button so that its browser actor is fired. * Typically a popup would open, or a listener would be called in the background page. * - * @param {String} addonId + * @param {string} addonId * The ID of the add-on to click on. */ function clickOnAddonWidget(addonId) { diff --git a/devtools/client/aboutdebugging/test/browser/helper-mocks.js b/devtools/client/aboutdebugging/test/browser/helper-mocks.js @@ -133,9 +133,9 @@ class Mocks { /** * Creates a USB runtime for which a client conenction can be established. * - * @param {String} id + * @param {string} id * The id of the runtime. - * @param {Object} optional object used to create the fake runtime & device + * @param {object} optional object used to create the fake runtime & device * - channel: {String} Release channel, for instance "release", "nightly" * - clientWrapper: {ClientWrapper} optional ClientWrapper for this runtime * - deviceId: {String} Device id @@ -146,7 +146,7 @@ class Mocks { * - socketPath: {String} (should only be used for connecting, so not here) * - version: {String} Version, for instance "63.0a" * - versionName: {String} Version return by ADB "63.0a" - * @return {Object} Returns the mock client created for this runtime so that methods + * @return {object} Returns the mock client created for this runtime so that methods * can be overridden on it. */ createUSBRuntime(id, runtimeInfo = {}) { diff --git a/devtools/client/aboutdebugging/test/browser/helper-serviceworker.js b/devtools/client/aboutdebugging/test/browser/helper-serviceworker.js @@ -26,7 +26,7 @@ async function enableServiceWorkerDebugging() { * * @param {Tab} tab * The tab on which the message will be received. - * @param {String} message + * @param {string} message * The name of the expected message. */ function onServiceWorkerMessage(tab, message) { diff --git a/devtools/client/aboutdebugging/test/browser/mocks/helper-adb-mock.js b/devtools/client/aboutdebugging/test/browser/mocks/helper-adb-mock.js @@ -6,7 +6,7 @@ /** * Setup the loader to return the provided mock object instead of the regular adb module. * - * @param {Object} + * @param {object} * mock should implement the following methods: * - registerListener(listener) * - getRuntimes() diff --git a/devtools/client/aboutdebugging/test/browser/mocks/helper-runtime-client-factory-mock.js b/devtools/client/aboutdebugging/test/browser/mocks/helper-runtime-client-factory-mock.js @@ -7,7 +7,7 @@ * Setup the loader to return the provided mock object instead of the regular * runtime-client-factory module. * - * @param {Object} + * @param {object} * mock should implement the following methods: * - createClientForRuntime(runtime) */ diff --git a/devtools/client/accessibility/accessibility-proxy.js b/devtools/client/accessibility/accessibility-proxy.js @@ -85,7 +85,7 @@ class AccessibilityProxy { /** * Perform an audit for a given filter. * - * @param {String} filter + * @param {string} filter * Type of an audit to perform. * @param {Function} onProgress * Audit progress callback. @@ -174,7 +174,7 @@ class AccessibilityProxy { * Return the topmost level accessibility walker to be used as the root of * the accessibility tree view. * - * @return {Object} + * @return {object} * Topmost accessibility walker. */ getAccessibilityTreeRoot() { @@ -245,7 +245,7 @@ class AccessibilityProxy { /** * Start picking and add walker listeners. * - * @param {Boolean} doFocus + * @param {boolean} doFocus * If true, move keyboard focus into content. */ pick(doFocus, onHovered, onPicked, onPreviewed, onCanceled) { diff --git a/devtools/client/accessibility/accessibility-view.js b/devtools/client/accessibility/accessibility-view.js @@ -60,7 +60,7 @@ AccessibilityView.prototype = { * Initialize accessibility view, create its top level component and set the * data store. * - * @param {Object} + * @param {object} * Object that contains the following properties: * - supports {JSON} * a collection of flags indicating @@ -252,7 +252,7 @@ AccessibilityView.prototype = { /** * Process message from accessibility panel. * - * @param {Object} event message type and data. + * @param {object} event message type and data. */ onMessage(event) { const data = event.data; diff --git a/devtools/client/accessibility/actions/accessibles.js b/devtools/client/accessibility/actions/accessibles.js @@ -13,7 +13,7 @@ const { /** * Fetch child accessibles for a given accessible object. * - * @param {Object} accessible front + * @param {object} accessible front */ exports.fetchChildren = accessible => diff --git a/devtools/client/accessibility/actions/details.js b/devtools/client/accessibility/actions/details.js @@ -10,7 +10,7 @@ const { /** * Update details with the given accessible object. * - * @param {Object} accessible front + * @param {object} accessible front */ exports.updateDetails = accessible => diff --git a/devtools/client/accessibility/components/AccessibilityRow.js b/devtools/client/accessibility/components/AccessibilityRow.js @@ -202,7 +202,7 @@ class AccessibilityRow extends Component { /** * Scroll the node that corresponds to a current accessible object into view. * - * @param {Object} + * @param {object} * Accessible front that is rendered for this node. * * @returns {Promise} diff --git a/devtools/client/accessibility/components/AccessibilityTree.js b/devtools/client/accessibility/components/AccessibilityTree.js @@ -128,7 +128,7 @@ class AccessibilityTree extends Component { * within the accessibility tree, re-fetch its children and re-render the * corresponding subtree. * - * @param {Object} accessibleFront + * @param {object} accessibleFront * accessible front that had its subtree reordered. */ onReorder(accessibleFront) { @@ -161,9 +161,9 @@ class AccessibilityTree extends Component { * and that accessible is cached and rendered within the accessibility tree, * re-fetch its parent's children and re-render the corresponding subtree. * - * @param {Object} accessibleFront + * @param {object} accessibleFront * accessible front that had its name changed. - * @param {Object} parentFront + * @param {object} parentFront * optional parent accessible front. Note: if it parent is not * present, we assume that the top level document's name has changed * and use accessible walker as a parent. @@ -187,7 +187,7 @@ class AccessibilityTree extends Component { * accessibility tree, re-fetch its children and re-render the corresponding * subtree. * - * @param {Object} accessibleFront + * @param {object} accessibleFront * accessible front that had its child text changed. */ onTextChange(accessibleFront) { diff --git a/devtools/client/accessibility/components/Accessible.js b/devtools/client/accessibility/components/Accessible.js @@ -401,9 +401,9 @@ class Accessible extends Component { /** * Match accessibility object from relations targets to the grip that's being activated. * - * @param {Object} relations Object containing relations grouped by type and targets. - * @param {String} actorID Actor ID to match to the relation target. - * @return {Object} Accessible front that matches the relation target. + * @param {object} relations Object containing relations grouped by type and targets. + * @param {string} actorID Actor ID to match to the relation target. + * @return {object} Accessible front that matches the relation target. */ const findAccessibleTarget = (relations, actorID) => { for (const relationType in relations) { @@ -422,11 +422,11 @@ const findAccessibleTarget = (relations, actorID) => { /** * Find an item based on a given path. * - * @param {String} path + * @param {string} path * Key of the item to be looked up. * @param {Array} items * Accessibility properties array. - * @return {Object?} + * @return {object?} * Possibly found item. */ const findByPath = (path, items) => { @@ -446,16 +446,16 @@ const findByPath = (path, items) => { /** * Check if a given property is a DOMNode front. * - * @param {Object?} value A property to check for being a DOMNode. - * @return {Boolean} A flag that indicates whether a property is a DOMNode. + * @param {object?} value A property to check for being a DOMNode. + * @return {boolean} A flag that indicates whether a property is a DOMNode. */ const isNodeFront = value => value && value.typeName === "domnode"; /** * Check if a given property is an Accessible front. * - * @param {Object?} value A property to check for being an Accessible. - * @return {Boolean} A flag that indicates whether a property is an Accessible. + * @param {object?} value A property to check for being an Accessible. + * @return {boolean} A flag that indicates whether a property is an Accessible. */ const isAccessibleFront = value => value && value.typeName === "accessible"; @@ -466,7 +466,7 @@ const isAccessibleFront = value => value && value.typeName === "accessible"; * * @params {accessibleFront} accessibleFront * The AccessibleFront for which we want to create a grip-like object. - * @returns {Object} a grip-like object that can be used with Reps. + * @returns {object} a grip-like object that can be used with Reps. */ const translateAccessibleFrontToGrip = accessibleFront => ({ actor: accessibleFront.actorID, @@ -487,9 +487,9 @@ const translateNodeFrontToGripWrapper = nodeFront => ({ /** * Build props ingestible by VirtualizedTree component. * - * @param {Object} props Component properties to be processed. - * @param {String} parentPath Unique path that is used to identify a Tree Node. - * @return {Object} Processed properties. + * @param {object} props Component properties to be processed. + * @param {string} parentPath Unique path that is used to identify a Tree Node. + * @return {object} Processed properties. */ const makeItemsForDetails = (props, parentPath) => Object.getOwnPropertyNames(props).map(name => { diff --git a/devtools/client/accessibility/components/AuditProgressOverlay.js b/devtools/client/accessibility/components/AuditProgressOverlay.js @@ -17,7 +17,7 @@ const Localized = React.createFactory(FluentReact.Localized); /** * Helper functional component to render an accessible text progressbar. * - * @param {Object} props + * @param {object} props * - id for the progressbar element * - fluentId: localized string id */ diff --git a/devtools/client/accessibility/components/Check.js b/devtools/client/accessibility/components/Check.js @@ -79,7 +79,7 @@ const LearnMore = createFactory(LearnMoreClass); /** * Renders icon with text description for the accessibility check. * - * @param {Object} + * @param {object} * Options: * - score: value from SCORES from "devtools/shared/constants" */ @@ -95,7 +95,7 @@ function Icon({ score }) { /** * Renders text description of the accessibility check. * - * @param {Object} + * @param {object} * Options: * - args: arguments for fluent localized string * - href: url for the learn more link pointing to MDN diff --git a/devtools/client/accessibility/picker.js b/devtools/client/accessibility/picker.js @@ -49,7 +49,7 @@ class Picker { /** * Select accessible object in the tree. * - * @param {Object} accessible + * @param {object} accessible * Accessiblle object to be selected in the inspector tree. */ select(accessible) { @@ -59,7 +59,7 @@ class Picker { /** * Highlight accessible object in the tree. * - * @param {Object} accessible + * @param {object} accessible * Accessiblle object to be selected in the inspector tree. */ highlight(accessible) { @@ -86,7 +86,7 @@ class Picker { /** * Handle an event when a new accessible object is hovered over. * - * @param {Object} accessible + * @param {object} accessible * newly hovered accessible object */ onPickerAccessibleHovered(accessible) { @@ -99,7 +99,7 @@ class Picker { /** * Handle an event when a new accessible is picked by the user. * - * @param {Object} accessible + * @param {object} accessible * newly picked accessible object */ onPickerAccessiblePicked(accessible) { @@ -112,7 +112,7 @@ class Picker { /** * Handle an event when a new accessible is previewed by the user. * - * @param {Object} accessible + * @param {object} accessible * newly previewed accessible object */ onPickerAccessiblePreviewed(accessible) { @@ -155,7 +155,7 @@ class Picker { /** * Start picking. * - * @param {Boolean} doFocus + * @param {boolean} doFocus * If true, move keyboard focus into content. */ async start(doFocus = true) { @@ -181,7 +181,7 @@ class Picker { /** * Toggle between starting and canceling the picker. * - * @param {Boolean} doFocus + * @param {boolean} doFocus * If true, move keyboard focus into content. */ toggle(doFocus) { diff --git a/devtools/client/accessibility/provider.js b/devtools/client/accessibility/provider.js @@ -27,7 +27,7 @@ class Provider { * Get accessible's cached children if available, if not fetch them from * backend. * - * @param {Object} accessible accessible object whose children to get. + * @param {object} accessible accessible object whose children to get. * @returns {Array} arraof of accessible children. */ getChildren(accessible) { @@ -46,8 +46,8 @@ class Provider { /** * Return a flag indicating if an accessible object has any children. * - * @param {Object} accessible accessible object whose children to get. - * @returns {Boolean} idicator of whether accessible object has children. + * @param {object} accessible accessible object whose children to get. + * @returns {boolean} idicator of whether accessible object has children. */ hasChildren(accessible) { return accessible.childCount > 0; @@ -58,8 +58,8 @@ class Provider { * column of the accessible tree. Corresponds to an accesible object name, if * available. * - * @param {Object} accessible accessible object - * @returns {String} accessible object value. + * @param {object} accessible accessible object + * @returns {string} accessible object value. */ getValue(accessible) { return accessible.name || ""; @@ -69,8 +69,8 @@ class Provider { * Get a label for an accessible object. Used to render the first column of * the accessible tree. Corresponds to an accessible object role. * - * @param {Object} accessible accessible object - * @returns {String} accessible object label. + * @param {object} accessible accessible object + * @returns {string} accessible object label. */ getLabel(accessible) { return accessible.role; @@ -80,8 +80,8 @@ class Provider { * Get a unique key for an accessible object. Corresponds to an accessible * front's actorID. * - * @param {Object} accessible accessible object - * @returns {String} a key for an accessible object. + * @param {object} accessible accessible object + * @returns {string} a key for an accessible object. */ getKey(accessible) { return accessible.actorID; @@ -91,8 +91,8 @@ class Provider { * Get a type of an accesible object. Corresponds to the type of an accessible * front. * - * @param {Object} accessible accessible object - * @returns {String} accessible object type + * @param {object} accessible accessible object + * @returns {string} accessible object type */ getType(accessible) { return accessible.typeName; @@ -103,12 +103,12 @@ class Provider { * tree is filtered it is flattened and the level is set to 0. Otherwise use * internal TreeView level. * - * @param {Object} accessible + * @param {object} accessible * accessible object - * @param {Number} defaultLevel + * @param {number} defaultLevel * default level provided by the TreeView component. * - * @returns {null|Number} + * @returns {null | number} * depth level of the accessible object. */ getLevel(accessible, defaultLevel) { diff --git a/devtools/client/accessibility/reducers/accessibles.js b/devtools/client/accessibility/reducers/accessibles.js @@ -47,7 +47,7 @@ function getActorID(accessible) { * * @param {Map} cache Previous state maintaining a cache of previously * fetched accessibles. - * @param {Object} accessible Accessible object to remove from cache. + * @param {object} accessible Accessible object to remove from cache. */ function cleanupChild(cache, accessible) { const actorID = getActorID(accessible); @@ -70,7 +70,7 @@ function cleanupChild(cache, accessible) { * * @param {Map} cache Previous state maintaining a cache of previously * fetched accessibles. - * @param {Object} accessible Accessible object to test for staleness. + * @param {object} accessible Accessible object to test for staleness. */ function staleChildren(cache, accessible) { const cached = cache.get(getActorID(accessible)); @@ -116,8 +116,8 @@ function updateAncestry(cache, ancestry) { * * @param {Map} cache Previous state maintaining a cache of previously * fetched accessibles. - * @param {Object} action Redux action object. - * @return {Object} updated state + * @param {object} action Redux action object. + * @return {object} updated state */ function onReceiveChildren(cache, action) { const { error, accessible, response: children } = action; diff --git a/devtools/client/accessibility/reducers/details.js b/devtools/client/accessibility/reducers/details.js @@ -32,9 +32,9 @@ function details(state = getInitialState(), action) { /** * Handle details update for an accessible object * - * @param {Object} state Current accessible object details. - * @param {Object} action Redux action object - * @return {Object} updated state + * @param {object} state Current accessible object details. + * @param {object} action Redux action object + * @return {object} updated state */ function onUpdateDetails(state, action) { const { accessible, response, error } = action; diff --git a/devtools/client/accessibility/reducers/ui.js b/devtools/client/accessibility/reducers/ui.js @@ -143,9 +143,9 @@ function onSelect(state, { accessible, response: ancestry, error }) { /** * Handle "canBeDisabled" flag update for accessibility service * - * @param {Object} state Current ui state - * @param {Object} action Redux action object - * @return {Object} updated state + * @param {object} state Current ui state + * @param {object} action Redux action object + * @return {object} updated state */ function onCanBeDisabledChange(state, { canBeDisabled }) { return Object.assign({}, state, { canBeDisabled }); @@ -154,9 +154,9 @@ function onCanBeDisabledChange(state, { canBeDisabled }) { /** * Handle "canBeEnabled" flag update for accessibility service * - * @param {Object} state Current ui state. - * @param {Object} action Redux action object - * @return {Object} updated state + * @param {object} state Current ui state. + * @param {object} action Redux action object + * @return {object} updated state */ function onCanBeEnabledChange(state, { canBeEnabled }) { return Object.assign({}, state, { canBeEnabled }); @@ -165,9 +165,9 @@ function onCanBeEnabledChange(state, { canBeEnabled }) { /** * Handle pref update for accessibility panel. * - * @param {Object} state Current ui state. - * @param {Object} action Redux action object - * @return {Object} updated state + * @param {object} state Current ui state. + * @param {object} action Redux action object + * @return {object} updated state */ function onPrefChange(state, { name, value }) { return { @@ -179,9 +179,9 @@ function onPrefChange(state, { name, value }) { /** * Handle reset action for the accessibility panel UI. * - * @param {Object} state Current ui state. - * @param {Object} action Redux action object - * @return {Object} updated state + * @param {object} state Current ui state. + * @param {object} action Redux action object + * @return {object} updated state */ function onReset(state, { enabled, canBeDisabled, canBeEnabled, supports }) { const newState = { @@ -198,10 +198,10 @@ function onReset(state, { enabled, canBeDisabled, canBeEnabled, supports }) { /** * Handle accessibilty service enabling/disabling. * - * @param {Object} state Current accessibility services enabled state. - * @param {Object} action Redux action object - * @param {Boolean} enabled New enabled state. - * @return {Object} updated state + * @param {object} state Current accessibility services enabled state. + * @param {object} action Redux action object + * @param {boolean} enabled New enabled state. + * @return {object} updated state */ function onToggle(state, { error }, enabled) { if (error) { diff --git a/devtools/client/accessibility/test/browser/head.js b/devtools/client/accessibility/test/browser/head.js @@ -84,10 +84,10 @@ const EXPANDABLE_PROPS = ["actions", "states", "attributes"]; /** * Add a new test tab in the browser and load the given url. * - * @param {String} url + * @param {string} url * The url to be loaded in the new tab - * @param {Object} options - * @param {Boolean} options.waitUntilDocumentAccessibleInState + * @param {object} options + * @param {boolean} options.waitUntilDocumentAccessibleInState * Whether we should wait for the state to have the document accessible. * Defaults to true. * @return a promise that resolves to the tab object when @@ -184,7 +184,7 @@ function closestScrolledParent(node) { * @param {Element} element * Element to be checked whether it is visible and is not scrolled off. * - * @returns {Boolean} + * @returns {boolean} * True if the element is visible. */ function isVisible(element) { @@ -205,10 +205,10 @@ function isVisible(element) { * * @param {DOMNode} row * DOMNode for a given accessibility row. - * @param {Boolean} expected + * @param {boolean} expected * Expected selected state. * - * @returns {Boolean} + * @returns {boolean} * True if visibility and styling matches expected selected state. */ function checkSelected(row, expected) { @@ -228,10 +228,10 @@ function checkSelected(row, expected) { * * @param {DOMNode} row * DOMNode for a given accessibility row. - * @param {Boolean} expected + * @param {boolean} expected * Expected row level (aria-level). * - * @returns {Boolean} + * @returns {boolean} * True if the aria-level for the row is as expected. */ function checkLevel(row, expected) { @@ -275,9 +275,9 @@ async function checkTreeState(doc, expected) { * Check if relations object matches what is expected. Note: targets are matched by their * name and role. * - * @param {Object} relations Relations to test. - * @param {Object} expected Expected relations. - * @return {Boolean} True if relation types and their targers match what is + * @param {object} relations Relations to test. + * @param {object} expected Expected relations. + * @return {boolean} True if relation types and their targers match what is * expected. */ function relationsMatch(relations, expected) { @@ -308,7 +308,7 @@ function relationsMatch(relations, expected) { * When comparing numerical values (for example contrast), we only care about the 2 * decimal points. * - * @param {String} _ + * @param {string} _ * Key of the property that is parsed. * @param {Any} value * Value of the property that is parsed. @@ -326,9 +326,9 @@ function parseNumReplacer(_, value) { /** * Check the state of the accessibility sidebar audit(checks). * - * @param {Object} store React store for the panel (includes store for + * @param {object} store React store for the panel (includes store for * the audit). - * @param {Object} expectedState Expected state of the sidebar audit(checks). + * @param {object} expectedState Expected state of the sidebar audit(checks). */ async function checkAuditState(store, expectedState) { info("Checking audit state."); @@ -357,9 +357,9 @@ async function checkAuditState(store, expectedState) { /** * Check the state of the accessibility sidebar. * - * @param {Object} store React store for the panel (includes store for + * @param {object} store React store for the panel (includes store for * the sidebar). - * @param {Object} expectedState Expected state of the sidebar. + * @param {object} expectedState Expected state of the sidebar. */ async function checkSidebarState(store, expectedState) { info("Checking sidebar state."); @@ -395,11 +395,11 @@ async function checkSidebarState(store, expectedState) { * * @param {Document} doc * accessibility inspector panel document. - * @param {Object} toolbarPrefValues + * @param {object} toolbarPrefValues * Expected state of the panel prefs as well as the redux state that * keeps track of it. Includes: * - SCROLL_INTO_VIEW (devtools.accessibility.scroll-into-view) - * @param {Object} store + * @param {object} store * React store for the panel (includes store for the sidebar). */ async function checkToolbarPrefsState(doc, toolbarPrefValues, store) { @@ -431,9 +431,9 @@ async function checkToolbarPrefsState(doc, toolbarPrefValues, store) { /** * Check the state of the accessibility checks toolbar. * - * @param {Object} store + * @param {object} store * React store for the panel (includes store for the sidebar). - * @param {Object} activeToolbarFilters + * @param {object} activeToolbarFilters * Expected active state of the filters in the toolbar. */ async function checkToolbarState(doc, activeToolbarFilters) { @@ -456,12 +456,12 @@ async function checkToolbarState(doc, activeToolbarFilters) { /** * Check the state of the simulation button and menu components. * - * @param {Object} doc Panel document. - * @param {Object} toolboxDoc Toolbox document. - * @param {Object} expected Expected states of the simulation components: - * @param {Boolean} expected.buttonActive - * @param {Array<Number>} expected.checkedOptionIndices - * @param {Array<Number>} expected.colorMatrix + * @param {object} doc Panel document. + * @param {object} toolboxDoc Toolbox document. + * @param {object} expected Expected states of the simulation components: + * @param {boolean} expected.buttonActive + * @param {Array<number>} expected.checkedOptionIndices + * @param {Array<number>} expected.colorMatrix */ async function checkSimulationState(doc, toolboxDoc, expected) { const { buttonActive, checkedOptionIndices, colorMatrix } = expected; @@ -532,7 +532,7 @@ async function focusAccessibleProperties(doc) { * Select accessibility property in the sidebar. * * @param {Document} doc accessibility inspector panel document. - * @param {String} id id of the property to be selected. + * @param {string} id id of the property to be selected. * @return {DOMNode} Node that corresponds to the selected accessibility property. */ async function selectProperty(doc, id) { @@ -571,7 +571,7 @@ async function selectProperty(doc, id) { * Select tree row. * * @param {document} doc panel documnent. - * @param {Number} rowNumber number of the row/tree node to be selected. + * @param {number} rowNumber number of the row/tree node to be selected. */ function selectRow(doc, rowNumber) { info(`Selecting row ${rowNumber}.`); @@ -591,7 +591,7 @@ function selectRow(doc, rowNumber) { * Toggle an expandable tree row. * * @param {document} doc panel documnent. - * @param {Number} rowNumber number of the row/tree node to be toggled. + * @param {number} rowNumber number of the row/tree node to be toggled. */ async function toggleRow(doc, rowNumber) { const win = doc.defaultView; @@ -623,9 +623,9 @@ async function toggleRow(doc, rowNumber) { * toolbox document. * @param {document} doc * panel document. - * @param {String} menuId + * @param {string} menuId * The id of the menu (menuId passed to the MenuButton component) - * @param {Number} menuItemIndex + * @param {number} menuItemIndex * index of the menu item to be toggled. */ async function toggleMenuItem(doc, toolboxDoc, menuId, menuItemIndex) { @@ -686,7 +686,7 @@ async function openSimulationMenu(doc, toolboxDoc) { * * @param {document} toolboxDoc * toolbox document. - * @param {Number} + * @param {number} * index of the option in the menu */ async function toggleSimulationOption(toolboxDoc, optionIndex) { @@ -756,7 +756,7 @@ async function selectAccessibleForNode(env, selector) { * - activeToolbarFilters: state of the accessibility panel * toolbar filters. * } - * @param {Object} env + * @param {object} env * contains all relevant environment objects (same structure as the * return value of 'addTestTab' funciton) */ @@ -805,9 +805,9 @@ async function runA11yPanelTests(tests, env) { /** * Build a valid URL from an HTML snippet. * - * @param {String} uri HTML snippet - * @param {Object} options options for the test - * @return {String} built URL + * @param {string} uri HTML snippet + * @param {object} options options for the test + * @return {string} built URL */ function buildURL(uri, options = {}) { if (options.remoteIframe) { @@ -833,16 +833,16 @@ function buildURL(uri, options = {}) { * * @param {JSON} tests test data that has the format of: * { - * desc {String} description for better logging + * desc {string} description for better logging * setup {Function} An optional setup that needs to be * performed before the state of the * tree and the sidebar can be checked * expected {JSON} An expected states for the tree and * the sidebar * } - * @param {String} uri test URL - * @param {String} msg a message that is printed for the test - * @param {Object} options options for the test + * @param {string} uri test URL + * @param {string} msg a message that is printed for the test + * @param {object} options options for the test */ function addA11yPanelTestsTask(tests, uri, msg, options) { addA11YPanelTask(msg, uri, env => runA11yPanelTests(tests, env), options); @@ -871,10 +871,10 @@ async function closeTabToolboxAccessibility(tab = gBrowser.selectedTab) { * A wrapper function around add_task that sets up the test environment, runs * the test and then disables accessibility tools. * - * @param {String} msg a message that is printed for the test - * @param {String} uri absolute test URL or HTML snippet + * @param {string} msg a message that is printed for the test + * @param {string} uri absolute test URL or HTML snippet * @param {Function} task task function containing the tests. - * @param {Object} options options for the test + * @param {object} options options for the test */ function addA11YPanelTask(msg, uri, task, options = {}) { add_task(async function a11YPanelTask() { diff --git a/devtools/client/accessibility/test/node/helpers.js b/devtools/client/accessibility/test/node/helpers.js @@ -25,7 +25,7 @@ function setupStore({ preloadedState } = {}) { /** * Build a mock accessible object. * - * @param {Object} form + * @param {object} form * Data similar to what accessible actor passes to accessible front. */ function mockAccessible(form) { @@ -42,7 +42,7 @@ function mockAccessible(form) { * * @param {DOMNode} * DOMNode that corresponds to a menu item in a menu list - * @param {Object} + * @param {object} * Expected properties: * - role: optional ARIA role for the menu item * - checked: optional checked state for the menu item @@ -80,7 +80,7 @@ function checkMenuItem(menuItem, expected) { * * @param {ReactWrapper} * React wrapper for the top level check component. - * @param {Object} + * @param {object} * Expected audit properties: * - score: audit score * - issue: audit issue type @@ -97,7 +97,7 @@ function testCustomCheck(wrapper, props) { * * @param {ReactWrapper} * React wrapper for the check component. - * @param {Object} + * @param {object} * Expected audit properties: * - score: audit score * - issue: audit issue type diff --git a/devtools/client/anti-tracking/debugger-fsm-context.js b/devtools/client/anti-tracking/debugger-fsm-context.js @@ -13,7 +13,7 @@ class DebuggerFSMContext { * Creates an instance of DebuggerFSMContext. * * @param {Array} allTrackers - A non-empty list of all trackers to be managed by the FSM context. - * @param {Object} callbacks - An object containing optional callback functions. + * @param {object} callbacks - An object containing optional callback functions. * @param {Function} [callbacks.onPromptTextUpdate] - Callback invoked when the prompt text is updated. * @param {Function} [callbacks.onButtonStateUpdate] - Callback invoked when the button state is updated. * @param {Function} [callbacks.onTrackersBlockedStateUpdate] - Callback invoked when the trackers blocked state is updated. diff --git a/devtools/client/anti-tracking/panel.js b/devtools/client/anti-tracking/panel.js @@ -12,7 +12,7 @@ class AntiTrackingPanel { * The frame/window dedicated to this panel. * @param {Toolbox} toolbox * The toolbox instance responsible for this panel. - * @param {Object} commands + * @param {object} commands * The commands object with all interfaces defined from devtools/shared/commands/ */ constructor(panelWin, toolbox, commands) { diff --git a/devtools/client/anti-tracking/webcompat-tracker-debugger.js b/devtools/client/anti-tracking/webcompat-tracker-debugger.js @@ -280,7 +280,7 @@ class WebcompatTrackerDebugger { * Create a row for a tracker. * * @param {string} hostname - The hostname of the tracker. - * @param {Object} trackerData - The data associated with the tracker. + * @param {object} trackerData - The data associated with the tracker. * @param {string} trackerData.trackerType - The type of tracker (e.g., "tracking", "fingerprinting"). * @returns {HTMLTableRowElement} The tracker row element. */ diff --git a/devtools/client/application/panel.js b/devtools/client/application/panel.js @@ -16,7 +16,7 @@ class ApplicationPanel { * The frame/window dedicated to this panel. * @param {Toolbox} toolbox * The toolbox instance responsible for this panel. - * @param {Object} commands + * @param {object} commands * The commands object with all interfaces defined from devtools/shared/commands/ */ constructor(panelWin, toolbox, commands) { diff --git a/devtools/client/debugger/dist/parser-worker.js b/devtools/client/debugger/dist/parser-worker.js @@ -30106,11 +30106,11 @@ /** * Create a new scope object and link the scope to it parent. * - * @param {String} type - scope type - * @param {String} displayName - The scope display name - * @param {Object} parent - The parent object scope - * @param {Object} loc - The start and end postions (line/columns) of the scope - * @returns {Object} The newly created scope + * @param {string} type - scope type + * @param {string} displayName - The scope display name + * @param {object} parent - The parent object scope + * @param {object} loc - The start and end postions (line/columns) of the scope + * @returns {object} The newly created scope */ function createTempScope(type, displayName, parent, loc) { const scope = { diff --git a/devtools/client/debugger/dist/pretty-print-worker.js b/devtools/client/debugger/dist/pretty-print-worker.js @@ -9457,12 +9457,12 @@ class PrettyFast { /** - * @param {Object} options: Provides configurability of the pretty printing. - * @param {String} options.url: The URL string of the ugly JS code. - * @param {String} options.indent: The string to indent code by. + * @param {object} options: Provides configurability of the pretty printing. + * @param {string} options.url: The URL string of the ugly JS code. + * @param {string} options.indent: The string to indent code by. * @param {SourceMapGenerator} options.sourceMapGenerator: An optional sourceMapGenerator * the mappings will be added to. - * @param {Boolean} options.prefixWithNewLine: When true, the pretty printed code will start + * @param {boolean} options.prefixWithNewLine: When true, the pretty printed code will start * with a line break * @param {Integer} options.originalStartLine: The line the passed script starts at (1-based). * This is used for inline scripts where we need to account for the lines @@ -9554,8 +9554,8 @@ #stack = []; /** - * @param {String} input: The ugly JS code we want to pretty print. - * @returns {Object} + * @param {string} input: The ugly JS code we want to pretty print. + * @returns {object} * An object with the following properties: * - code: The pretty printed code string. * - map: A SourceMapGenerator instance. @@ -9765,7 +9765,7 @@ * * @param Object token * The token we are currently handling. - * @param {Object|undefined} nextToken + * @param {object | undefined} nextToken * The next token, might not exist if we're on the last token */ #handleToken(token, nextToken) { @@ -10092,9 +10092,9 @@ /** * Determines if we think that the given token starts a long parenthesis * - * @param {Object} token + * @param {object} token * The token we want to determine if it is the beginning of a long paren. - * @param {Array<Object>} tokenQueue + * @param {Array<object>} tokenQueue * The whole list of tokens parsed by acorn * @param {Integer} currentTokenIndex * The index of `token` in `tokenQueue` @@ -10655,7 +10655,7 @@ * Get the source map for a pretty-print task * * @param {Integer} taskId: The taskId that was used to call prettyPrint - * @returns {Object} A source map object + * @returns {object} A source map object */ function getSourceMapForTask(taskId) { if (!sourceMapGeneratorByTaskId.has(taskId)) { diff --git a/devtools/client/debugger/panel.js b/devtools/client/debugger/panel.js @@ -235,7 +235,7 @@ class DebuggerPanel { /** * Return the source-mapped variables for the current scope. * - * @returns {{[String]: String} | null} A dictionary mapping original variable names to generated + * @returns {{[string]: string} | null} A dictionary mapping original variable names to generated * variable names if map scopes is enabled, otherwise null. */ getMappedVariables() { @@ -259,17 +259,17 @@ class DebuggerPanel { * This is called when some other panels wants to open a given source * in the debugger at a precise line/column. * - * @param {String} generatedURL - * @param {Number} generatedLine - * @param {Number} generatedColumn - * @param {String} sourceActorId (optional) + * @param {string} generatedURL + * @param {number} generatedLine + * @param {number} generatedColumn + * @param {string} sourceActorId (optional) * If the callsite knows about a particular sourceActorId, * or if the source doesn't have a URL, you have to pass a sourceActorId. - * @param {String} reason + * @param {string} reason * A telemetry identifier to record when opening the debugger. * This help differentiate why we opened the debugger. * - * @return {Boolean} + * @return {boolean} * Returns true if the location is known by the debugger * and the debugger opens it. */ diff --git a/devtools/client/debugger/src/actions/ast/setInScopeLines.js b/devtools/client/debugger/src/actions/ast/setInScopeLines.js @@ -13,7 +13,7 @@ import { isFulfilled } from "../../utils/async-value"; /** * Get and store the in scope lines in the reducer * - * @param {Object} editor - The editor provides an API to retrieve the in scope location + * @param {object} editor - The editor provides an API to retrieve the in scope location * details based on lezer in CM6. * @returns */ diff --git a/devtools/client/debugger/src/actions/breakpoints/breakpointPositions.js b/devtools/client/debugger/src/actions/breakpoints/breakpointPositions.js @@ -21,17 +21,17 @@ import { validateSource } from "../../utils/context"; * and map them to location objects. * During this process, the SourceMapLoader will be queried to map the positions from generated to original locations. * - * @param {Object} breakpointPositions + * @param {object} breakpointPositions * The positions to map related to the generated source: * { * 1: [ 2, 6 ], // Line 1 is breakable on column 2 and 6 * 2: [ 2 ], // Line 2 is only breakable on column 2 * } - * @param {Object} generatedSource - * @param {Object} location + * @param {object} generatedSource + * @param {object} location * The current location we are computing breakable positions. - * @param {Object} thunk arguments - * @return {Object} + * @param {object} thunk arguments + * @return {object} * The mapped breakable locations in the original source: * { * 1: [ { source, line: 1, column: 2} , { source, line: 1, column 6 } ], // Line 1 is not mapped as location are same as breakpointPositions. diff --git a/devtools/client/debugger/src/actions/breakpoints/index.js b/devtools/client/debugger/src/actions/breakpoints/index.js @@ -170,7 +170,7 @@ export function removeBreakpointsInSource(source) { * non-pretty-printed (generated) source to the related pretty-printed * (original) source by querying the SourceMap service. * - * @param {String} source - the generated source + * @param {string} source - the generated source */ export function updateBreakpointsForNewPrettyPrintedSource(source) { return async thunkArgs => { diff --git a/devtools/client/debugger/src/actions/breakpoints/modify.js b/devtools/client/debugger/src/actions/breakpoints/modify.js @@ -218,7 +218,7 @@ export function removeBreakpoint(initialBreakpoint) { * Remove all installed, pending, and client breakpoints associated with a * target generated location. * - * @param {Object} target + * @param {object} target * Location object where to remove breakpoints. */ export function removeBreakpointAtGeneratedLocation(target) { @@ -296,7 +296,7 @@ export function disableBreakpoint(initialBreakpoint) { * @static * @param {SourceLocation} location * @see DebuggerController.Breakpoints.addBreakpoint - * @param {Object} options + * @param {object} options * Any options to set on the breakpoint */ export function setBreakpointOptions(location, options = {}) { diff --git a/devtools/client/debugger/src/actions/pause/inlinePreview.js b/devtools/client/debugger/src/actions/pause/inlinePreview.js @@ -65,9 +65,9 @@ export function generateInlinePreview(selectedFrame) { /** * Creates all the previews * - * @param {Object} selectedFrame - * @param {Object} scope - Scope from the platform - * @param {Object} thunkArgs + * @param {object} selectedFrame + * @param {object} scope - Scope from the platform + * @param {object} thunkArgs * @returns */ async function getPreviews(selectedFrame, scope, thunkArgs) { @@ -119,11 +119,11 @@ async function getPreviews(selectedFrame, scope, thunkArgs) { /** * Generates the previews from the binding information * - * @param {Object} bindingData - Scope binding data from the AST about a particular variable/argument at a particular level in the scope. - * @param {Number} pausedOnLine - The current line we are paused on - * @param {String} name - Name of binding from the platfom scopes - * @param {Object} client - Client object for loading properties - * @param {Object} thread - Thread used to get the expressions values + * @param {object} bindingData - Scope binding data from the AST about a particular variable/argument at a particular level in the scope. + * @param {number} pausedOnLine - The current line we are paused on + * @param {string} name - Name of binding from the platfom scopes + * @param {object} client - Client object for loading properties + * @param {object} thread - Thread used to get the expressions values * @returns */ async function generatePreviewsForBinding( @@ -187,11 +187,11 @@ async function generatePreviewsForBinding( /** * Get the name and value details to be displayed in the inline preview * - * @param {String} name - Binding name - * @param {String} value - Binding value which is the Enviroment object actor form - * @param {Object} ref - Binding reference - * @param {Object} client - Client object for loading properties - * @param {String} thread - Thread used to get the expression values + * @param {string} name - Binding name + * @param {string} value - Binding value which is the Enviroment object actor form + * @param {object} ref - Binding reference + * @param {object} client - Client object for loading properties + * @param {string} thread - Thread used to get the expression values * @returns */ async function getExpressionNameAndValue(name, value, ref, client, thread) { diff --git a/devtools/client/debugger/src/actions/pause/mapFrames.js b/devtools/client/debugger/src/actions/pause/mapFrames.js @@ -140,7 +140,7 @@ async function updateFrameDisplayName(frame, thunkArgs) { /** * Update the display names of the mapped original frames * - * @param {Object} thread + * @param {object} thread * @returns */ export function updateAllFrameDisplayNames(thread) { diff --git a/devtools/client/debugger/src/actions/preview.js b/devtools/client/debugger/src/actions/preview.js @@ -33,11 +33,11 @@ async function findExpressionMatches(state, editor, tokenPos) { /** * Get a preview object for the currently selected frame in the JS Tracer. * - * @param {Object} target + * @param {object} target * The hovered DOM Element within CodeMirror rendering. - * @param {Object} tokenPos + * @param {object} tokenPos * The CodeMirror position object for the hovered token. - * @param {Object} editor + * @param {object} editor * The CodeMirror editor object. */ export function getTracerPreview(target, tokenPos, editor) { @@ -114,11 +114,11 @@ export function getTracerPreview(target, tokenPos, editor) { /** * Get a preview object for the currently paused frame, if paused. * - * @param {Object} target + * @param {object} target * The hovered DOM Element within CodeMirror rendering. - * @param {Object} tokenPos + * @param {object} tokenPos * The CodeMirror position object for the hovered token. - * @param {Object} editor + * @param {object} editor * The CodeMirror editor object. */ export function getPausedPreview(target, tokenPos, editor) { diff --git a/devtools/client/debugger/src/actions/sources/blackbox.js b/devtools/client/debugger/src/actions/sources/blackbox.js @@ -56,8 +56,8 @@ export async function blackboxSourceActorsForSource( /** * Toggle blackboxing for the whole source or for specific lines in a source * - * @param {Object} source - The source to be blackboxed/unblackboxed. - * @param {Boolean} [shouldBlackBox] - Specifies if the source should be blackboxed (true + * @param {object} source - The source to be blackboxed/unblackboxed. + * @param {boolean} [shouldBlackBox] - Specifies if the source should be blackboxed (true * or unblackboxed (false). When this is not provided * option is decided based on the blackboxed state * of the source. @@ -173,7 +173,7 @@ async function toggleBreakpointsInBlackboxedSources({ * Blackboxes a group of sources together * * @param {Array} sourcesToBlackBox - The list of sources to blackbox - * @param {Boolean} shouldBlackbox - Specifies if the sources should blackboxed (true) + * @param {boolean} shouldBlackbox - Specifies if the sources should blackboxed (true) * or unblackboxed (false). */ export function blackBoxSources(sourcesToBlackBox, shouldBlackBox) { diff --git a/devtools/client/debugger/src/actions/sources/loadSourceText.js b/devtools/client/debugger/src/actions/sources/loadSourceText.js @@ -115,10 +115,10 @@ async function loadOriginalSourceTextPromise(source, thunkArgs) { * Function called everytime a new original or generated source gets its text content * fetched from the server and registered in the reducer. * - * @param {Object} source - * @param {Object} sourceActor (optional) + * @param {object} source + * @param {object} sourceActor (optional) * If this is a generated source, we expect a precise source actor. - * @param {Object} thunkArgs + * @param {object} thunkArgs */ async function onSourceTextContentAvailable( source, @@ -162,7 +162,7 @@ async function onSourceTextContentAvailable( /** * Loads the source text for the generated source based of the source actor * - * @param {Object} sourceActor + * @param {object} sourceActor * There can be more than one source actor per source * so the source actor needs to be specified. This is * required for generated sources but will be null for @@ -203,7 +203,7 @@ export const loadGeneratedSourceText = memoizeableAction( /** * Loads the source text for an original source and source actor * - * @param {Object} source + * @param {object} source * The original source to load the source text */ export const loadOriginalSourceText = memoizeableAction( diff --git a/devtools/client/debugger/src/actions/sources/prettyPrint.js b/devtools/client/debugger/src/actions/sources/prettyPrint.js @@ -125,10 +125,10 @@ export async function prettyPrintSourceTextContent( /** * Pretty print inline script inside an HTML file * - * @param {Object} options + * @param {object} options * @param {PrettyPrintDispatcher} options.prettyPrintWorker: The prettyPrint worker - * @param {Object} options.generatedSource: The HTML source we want to pretty print - * @param {Object} options.content + * @param {object} options.generatedSource: The HTML source we want to pretty print + * @param {object} options.content * @param {Array} options.actors: An array of the HTML file inline script sources data * * @returns Promise<Object> A promise that resolves with an object of the following shape: diff --git a/devtools/client/debugger/src/actions/sources/select.js b/devtools/client/debugger/src/actions/sources/select.js @@ -92,9 +92,9 @@ export function selectSourceURL(url, options) { * Note that it ignores the currently selected source and will select * the precise generated/original source passed as argument. * - * @param {String} source + * @param {string} source * The precise source to select. - * @param {String} sourceActor + * @param {string} sourceActor * The specific source actor of the source to * select the source text. This is optional. */ @@ -113,12 +113,12 @@ export function selectSource(source, sourceActor) { * Based on `keepContext` argument passed to `selectLocation`, * this will automatically select the related mapped source (original or generated). * - * @param {Object} location + * @param {object} location * The location to select. - * @param {Boolean} keepContext + * @param {boolean} keepContext * If true, will try to select a mapped source. - * @param {Object} thunkArgs - * @return {Object} + * @param {object} thunkArgs + * @return {object} * Object with two attributes: * - `shouldSelectOriginalLocation`, to know if we should keep trying to select the original location * - `newLocation`, for the final location to select @@ -224,8 +224,8 @@ async function mayBeSelectMappedSource(location, keepContext, thunkArgs) { * Note that by default, this may map your passed location to the original * or generated location based on the selected source state. (see keepContext) * - * @param {Object} location - * @param {Object} options + * @param {object} location + * @param {object} options * @param {boolean} options.keepContext * If false, this will ignore the currently selected source * and select the generated or original location, even if we @@ -385,7 +385,7 @@ export function selectLocation( * This will select the generated location even if the currently * select source is an original source. And the other way around. * - * @param {Object} location + * @param {object} location * The location to select, object which includes enough * information to specify a precise source, line and column. */ @@ -402,7 +402,7 @@ export function selectSpecificLocation(location) { * after reload, because the source objects are new on each new page load, but source * with the same URL may still exist. * - * @param {Object} location + * @param {object} location * The location to select. * @return {function} * The action will return true if a matching source was found. diff --git a/devtools/client/debugger/src/actions/tabs.js b/devtools/client/debugger/src/actions/tabs.js @@ -58,7 +58,7 @@ export function closeTabsForSources(sources) { /** * Compute the potential new source to select while closing tabs for a given set of sources. * - * @param {Object} state + * @param {object} state * Redux state object. * @param {Array<Source>} closedSources * Ordered list of sources which should be closed. diff --git a/devtools/client/debugger/src/actions/ui.js b/devtools/client/debugger/src/actions/ui.js @@ -147,12 +147,12 @@ export function togglePaneCollapse(position, paneCollapsed) { /** * Highlight one or many lines in CodeMirror for a given source. * - * @param {Object} location - * @param {String} location.sourceId + * @param {object} location + * @param {string} location.sourceId * The precise source to highlight. - * @param {Number} location.start + * @param {number} location.start * The 1-based index of first line to highlight. - * @param {Number} location.end + * @param {number} location.end * The 1-based index of last line to highlight. */ export function highlightLineRange(location) { diff --git a/devtools/client/debugger/src/client/firefox/commands.js b/devtools/client/debugger/src/client/firefox/commands.js @@ -29,8 +29,8 @@ function currentThreadFront() { /** * Create an object front for the passed grip * - * @param {Object} grip - * @param {Object} frame: An optional frame that will manage the created object front. + * @param {object} grip + * @param {object} frame: An optional frame that will manage the created object front. * if not passed, the current thread front will manage the object. * @returns {ObjectFront} */ @@ -278,18 +278,18 @@ async function evaluateExpressions(expressions, options) { /** * Evaluate some JS expression in a given thread. * - * @param {String} expression - * @param {Object} options - * @param {String} options.frameId + * @param {string} expression + * @param {object} options + * @param {string} options.frameId * Optional frame actor ID into which the expression should be evaluated. - * @param {String} options.threadId + * @param {string} options.threadId * Optional thread actor ID into which the expression should be evaluated. - * @param {String} options.selectedNodeActor + * @param {string} options.selectedNodeActor * Optional node actor ID which related to "$0" in the evaluated expression. - * @param {Boolean} options.evalInTracer + * @param {boolean} options.evalInTracer * To be set to true, if the object actors created during the evaluation * should be registered in the tracer actor Pool. - * @return {Object} + * @return {object} * See ScriptCommand.execute JS Doc. */ async function evaluate( diff --git a/devtools/client/debugger/src/client/firefox/create.js b/devtools/client/debugger/src/client/firefox/create.js @@ -26,8 +26,8 @@ let store; * and allow having access to any instances of classes that are * useful for this module * - * @param {Object} dependencies - * @param {Object} dependencies.store + * @param {object} dependencies + * @param {object} dependencies.store * The redux store object of the debugger frontend. */ export function setupCreate(dependencies) { @@ -67,11 +67,11 @@ export async function createFrame(thread, frame, index = 0) { * For example, location and generatedLocation will be different. * * @param {Function} getState - * @param {Object} frame + * @param {object} frame * The frame for the generated location, i.e. WASM binary code. - * @param {String} id + * @param {string} id * The new ID to use for the new frame object. - * @param {Object} originalFrame + * @param {object} originalFrame * An object crafted by the SourceMap Worker with additional information * about the original source code. i.e. the Rust, C++, whatever original source code. * See XScope.search() for definition of this object. @@ -104,7 +104,7 @@ export function createWasmOriginalFrame( /** * This method wait for the given source actor to be registered in Redux store. * - * @param {String} sourceActorId + * @param {string} sourceActorId * Actor ID of the source to be waiting for. */ async function waitForSourceActorToBeRegisteredInStore(sourceActorId) { @@ -132,7 +132,7 @@ async function waitForSourceActorToBeRegisteredInStore(sourceActorId) { /** * This method wait for the given source to be registered in Redux store. * - * @param {String} sourceId + * @param {string} sourceId * The id of the source to be waiting for. */ export async function waitForSourceToBeRegisteredInStore(sourceId) { @@ -317,11 +317,11 @@ function createSourceObject({ * on the server side. It is associated with a generated source for the related bundle file * which itself relates to an actual code that runs in the runtime. * - * @param {String} id + * @param {string} id * The ID of the source, computed by source map codebase. - * @param {String} url + * @param {string} url * The URL of the original source file. - * @param {Object} generatedSource + * @param {object} generatedSource * The Source object for the related generated source this original source maps to. */ export function createSourceMapOriginalSource(id, url, generatedSource) { @@ -340,12 +340,12 @@ export function createSourceMapOriginalSource(id, url, generatedSource) { * It is associated with a generated source for the non-pretty-printed file * which itself relates to an actual code that runs in the runtime. * - * @param {String} id + * @param {string} id * The ID of the source, computed by pretty print. - * @param {String} url + * @param {string} url * The URL of the pretty-printed source file. * This URL doesn't work. It is the URL of the non-pretty-printed file with ":formated" suffix. - * @param {Object} generatedSource + * @param {object} generatedSource * The Source object for the related minimized source that related to this pretty printed source. */ export function createPrettyPrintOriginalSource(id, url, generatedSource) { @@ -365,7 +365,7 @@ export function createPrettyPrintOriginalSource(id, url, generatedSource) { * @param {SOURCE} sourceResource * SOURCE resource coming from the ResourceCommand API. * This represents the `SourceActor` from the server codebase. - * @param {Object} sourceObject + * @param {object} sourceObject * Source object stored in redux, i.e. created via createSourceObject. */ export function createSourceActor(sourceResource, sourceObject) { diff --git a/devtools/client/debugger/src/components/Editor/ConditionalPanel.js b/devtools/client/debugger/src/components/Editor/ConditionalPanel.js @@ -101,9 +101,9 @@ export class ConditionalPanel extends PureComponent { /** * Set the breakpoint/logpoint if expression isn't empty, and close the panel. * - * @param {String} expression: The expression that will be used for setting the + * @param {string} expression: The expression that will be used for setting the * conditional breakpoint/logpoint - * @param {Boolean} showStacktrace: Whether to show the stacktrace for the logpoint + * @param {boolean} showStacktrace: Whether to show the stacktrace for the logpoint */ saveAndClose = (expression = null, showStacktrace = false) => { if (typeof expression === "string") { diff --git a/devtools/client/debugger/src/components/Editor/SearchInFileBar.js b/devtools/client/debugger/src/components/Editor/SearchInFileBar.js @@ -224,7 +224,7 @@ class SearchInFileBar extends Component { * Update the state with the results and matches from the search. * This will also scroll to result's location in CodeMirror. * - * @param {Object} results + * @param {object} results * @param {Array} matches * @returns */ @@ -270,9 +270,9 @@ class SearchInFileBar extends Component { * Ensure showing the search result in CodeMirror editor, * and setting the cursor at the end of the matched string. * - * @param {Number} line - * @param {Number} ch - * @param {String} matchContent + * @param {number} line + * @param {number} ch + * @param {string} matchContent */ setCursorLocation = (line, ch, matchContent) => { this.props.selectLocation( diff --git a/devtools/client/debugger/src/components/PrimaryPanes/Tracer.js b/devtools/client/debugger/src/components/PrimaryPanes/Tracer.js @@ -785,7 +785,7 @@ export class Tracer extends Component { /** * Select the next or previous trace according to the current search string * - * @param {Boolean} goForward + * @param {boolean} goForward * Select the next matching trace if true, * otherwise select the previous one. */ @@ -957,9 +957,9 @@ export class Tracer extends Component { * Walk through the call tree to find the very last children frame * and return its trace index. * - * @param {Object} traceChildren + * @param {object} traceChildren * The reducer data containing children trace indexes for all the traces. - * @param {Number} traceIndex + * @param {number} traceIndex */ function findLastTraceIndex(traceChildren, traceIndex) { const children = traceChildren[traceIndex]; @@ -973,11 +973,11 @@ function findLastTraceIndex(traceChildren, traceIndex) { * Store in the `results` attribute all following siblings for a given trace, * as well as for its parents, that, recursively up to the top traces. * - * @param {Object} traceParents + * @param {object} traceParents * The reducer data containing parent trace index for all the traces. - * @param {Object} traceChildren + * @param {object} traceChildren * The reducer data containing children trace indexes for all the traces. - * @param {Number} traceIndex + * @param {number} traceIndex * @param {Array} results */ function collectAllSiblings(traceParents, traceChildren, traceIndex, results) { @@ -997,7 +997,7 @@ function collectAllSiblings(traceParents, traceChildren, traceIndex, results) { * Given the TRACER_FIELDS_INDEXES.EVENT_NAME field of a trace, * return the classname to use for a given event trace. * - * @param {String} eventName + * @param {string} eventName */ function getEventClassNameFromTraceEventName(eventName) { let eventType = "other"; @@ -1021,10 +1021,10 @@ function getEventClassNameFromTraceEventName(eventName) { /** * Return the index of the top-most parent frame for a given trace index. * - * @param {Object} traceParents + * @param {object} traceParents * The reducer data containing parent trace index for all the traces. - * @param {Number} traceIndex - * @return {Number} The top-most parent trace index + * @param {number} traceIndex + * @return {number} The top-most parent trace index */ function getTraceParentIndex(traceParents, index) { const parentIndex = traceParents[index]; diff --git a/devtools/client/debugger/src/reducers/pending-breakpoints.js b/devtools/client/debugger/src/reducers/pending-breakpoints.js @@ -84,7 +84,7 @@ function removePendingBreakpoint(state, pendingBreakpoint) { * using its original location, or for pretty-printed sources, * its generated location. * - * @param {Object} breakpoint + * @param {object} breakpoint */ function makeIdFromBreakpoint(breakpoint) { const location = breakpoint.location.source.isPrettyPrinted diff --git a/devtools/client/debugger/src/reducers/sources-tree.js b/devtools/client/debugger/src/reducers/sources-tree.js @@ -502,7 +502,7 @@ function addSource(threadItems, source, sourceActor) { /** * Find all the source items in tree * - * @param {Object} item - Current item node in the tree + * @param {object} item - Current item node in the tree * @param {Function} callback */ function findSourceInThreadItem(source, threadItem) { @@ -618,7 +618,7 @@ export function sortThreads(a, b) { * * @param {GroupItem} groupItem * The Group Item for the group where the path should be displayed. - * @param {String} path + * @param {string} path * Path of the directory for which we want a Directory Item. * @return {GroupItem|DirectoryItem} * The parent Item where this path should be inserted. @@ -768,8 +768,8 @@ function createSourceTreeItem(source, sourceActor, parent) { * Update `expanded` and `focusedItem` so that we show and focus * the new selected source. * - * @param {Object} state - * @param {Object} selectedLocation + * @param {object} state + * @param {object} selectedLocation * The new location being selected. */ function updateSelectedLocation(state, selectedLocation) { @@ -795,8 +795,8 @@ function updateSelectedLocation(state, selectedLocation) { /** * Get the SourceItem displayed in the SourceTree for the currently selected location. * - * @param {Object} state - * @param {Object} selectedLocation + * @param {object} state + * @param {object} selectedLocation * @return {SourceItem} * The directory source item where the given source is displayed. */ diff --git a/devtools/client/debugger/src/reducers/tabs.js b/devtools/client/debugger/src/reducers/tabs.js @@ -108,14 +108,14 @@ function removePrettyPrintedSource(state, source) { * Either when the user adds a tab (forceAdding will be true), * or when sources are registered (forceAdding will be false). * - * @param {Object} state + * @param {object} state * @param {Array<Source>} sources - * @param {Boolean} forceAdding + * @param {boolean} forceAdding * If true, a tab should be opened for all the passed sources, * even if the source has no url. * If false, only sources matching a previously opened URL * will be restored. - * @return {Object} Modified state object + * @return {object} Modified state object */ function updateTabsWithNewActiveSource(state, sources, forceAdding = false) { let { urls, openedSources, prettyPrintedURLs, prettyPrintedDisabledURLs } = diff --git a/devtools/client/debugger/src/reducers/tracer-frames.js b/devtools/client/debugger/src/reducers/tracer-frames.js @@ -485,8 +485,8 @@ const UNCLASSIFIED_CATEGORY = { id: "unclassified", name: "Unclassified" }; /** * Register this possibly new event type in data set used to display EventListener React component. * - * @param {Object} state - * @param {String} eventName + * @param {object} state + * @param {string} eventName */ function registerDOMEvent(state, eventName) { if (state.mutableEventNames.has(eventName)) { @@ -551,7 +551,7 @@ function locationMatchTrace(location, trace) { /** * Reports if a given trace matches the current searched argument value. * - * @param {Object} trace + * @param {object} trace * The trace object communicated by the backend. * @param {any primitive|ObjectActor's form} searchValueOrGrip * Either a primitive value (string, number, boolean, …) to match directly, @@ -580,10 +580,10 @@ function isTraceMatchingSearch(trace, searchValueOrGrip) { /** * Generate the previews object consumed by InlinePreviews React component. * - * @param {Object} state - * @param {Object} trace + * @param {object} state + * @param {object} trace * Trace reducer object. - * @return {Object} + * @return {object} * Previews consumed by InlinePreviews. */ function generatePreviewsForTrace(state, trace) { diff --git a/devtools/client/debugger/src/selectors/breakpoints.js b/devtools/client/debugger/src/selectors/breakpoints.js @@ -32,9 +32,9 @@ export function getBreakpoint(state, location) { /** * Gets the breakpoints on a line or within a range of lines * - * @param {Object} state - * @param {Number} source - * @param {Number|Object} lines - line or an object with a start and end range of lines + * @param {object} state + * @param {number} source + * @param {number | object} lines - line or an object with a start and end range of lines * @returns {Array} breakpoints */ export function getBreakpointsForSource(state, source, lines) { diff --git a/devtools/client/debugger/src/selectors/source-actors.js b/devtools/client/debugger/src/selectors/source-actors.js @@ -5,10 +5,10 @@ /** * Tells if a given Source Actor is registered in the redux store * - * @param {Object} state - * @param {String} sourceActorId + * @param {object} state + * @param {string} sourceActorId * Source Actor ID - * @return {Boolean} + * @return {boolean} */ export function hasSourceActor(state, sourceActorId) { return state.sourceActors.mutableSourceActors.has(sourceActorId); @@ -17,10 +17,10 @@ export function hasSourceActor(state, sourceActorId) { /** * Get the Source Actor object. See create.js:createSourceActor() * - * @param {Object} state - * @param {String} sourceActorId + * @param {object} state + * @param {string} sourceActorId * Source Actor ID - * @return {Object} + * @return {object} * The Source Actor object (if registered) */ export function getSourceActor(state, sourceActorId) { @@ -30,10 +30,10 @@ export function getSourceActor(state, sourceActorId) { /** * Reports if the Source Actor relates to a valid source map / original source. * - * @param {Object} state - * @param {String} sourceActorId + * @param {object} state + * @param {string} sourceActorId * Source Actor ID - * @return {Boolean} + * @return {boolean} * True if it has a valid source map/original object. */ export function isSourceActorWithSourceMap(state, sourceActorId) { @@ -52,10 +52,10 @@ export function getSourceMapResolvedURL(state, sourceActorId) { /** * Get all Source Actor objects for a given thread. See create.js:createSourceActor() * - * @param {Object} state - * @param {Array<String>} threadActorIDs + * @param {object} state + * @param {Array<string>} threadActorIDs * List of Thread IDs - * @return {Array<Object>} + * @return {Array<object>} */ export function getSourceActorsForThread(state, threadActorIDs) { if (!Array.isArray(threadActorIDs)) { @@ -73,8 +73,8 @@ export function getSourceActorsForThread(state, threadActorIDs) { /** * Get the list of all breakable lines for a given source actor. * - * @param {Object} state - * @param {String} sourceActorId + * @param {object} state + * @param {string} sourceActorId * Source Actor ID * @return {Promise<Array<Number>> | <Array<Number> | null} * - null when the breakable lines have not been requested yet @@ -92,15 +92,15 @@ export function getSourceActorBreakableLines(state, sourceActorId) { * This is typically used to fetch the breakable lines of HTML sources * which are made of multiple source actors (one per inline script). * - * @param {Object} state - * @param {Array<String>} sourceActors + * @param {object} state + * @param {Array<string>} sourceActors * List of Source Actors - * @param {Boolean} isHTML + * @param {boolean} isHTML * True, if we are fetching the breakable lines for an HTML source. * For them, we have to aggregate the lines of each source actors. * Otherwise, we might still have many source actors, but one per thread. * In this case, we simply return the first source actor to have the lines ready. - * @return {Array<Number>} + * @return {Array<number>} * List of all the breakable lines. */ export function getBreakableLinesForSourceActors(state, sourceActors, isHTML) { diff --git a/devtools/client/debugger/src/selectors/sources.js b/devtools/client/debugger/src/selectors/sources.js @@ -197,12 +197,12 @@ export function getShouldScrollToSelectedLocation(state) { * Gets the first source actor for the source and/or thread * provided. * - * @param {Object} state - * @param {String} sourceId + * @param {object} state + * @param {string} sourceId * The source used - * @param {String} [threadId] + * @param {string} [threadId] * The thread to check, this is optional. - * @param {Object} sourceActor + * @param {object} sourceActor */ export function getFirstSourceActorForGeneratedSource( state, @@ -227,10 +227,10 @@ export function getFirstSourceActorForGeneratedSource( /** * Get the source actor of the source * - * @param {Object} state - * @param {String} id + * @param {object} state + * @param {string} id * The source id - * @return {Array<Object>} + * @return {Array<object>} * List of source actors */ export function getSourceActorsForSource(state, id) { @@ -367,9 +367,9 @@ export function isSourceOverridden(toolboxState, source) { * Compute the list of source actors and source objects to be removed * when removing a given target/thread. * - * @param {String} threadActorID + * @param {string} threadActorID * The thread to be removed. - * @return {Object} + * @return {object} * An object with two arrays: * - actors: list of source actor objects to remove * - sources: list of source objects to remove diff --git a/devtools/client/debugger/src/selectors/tabs.js b/devtools/client/debugger/src/selectors/tabs.js @@ -22,7 +22,7 @@ export function tabExists(state, source) { * For a given non-original source, returns true only if this source has been pretty printed * and has a tab currently opened with pretty printing enabled. * - * @return {Boolean} + * @return {boolean} */ export function isPrettyPrinted(state, source) { return source.url && state.tabs.prettyPrintedURLs.has(source.url); diff --git a/devtools/client/debugger/src/utils/bootstrap.js b/devtools/client/debugger/src/utils/bootstrap.js @@ -83,7 +83,7 @@ export function teardownWorkers() { * * @param {ReduxStore} store * @param {ReduxStore} toolboxStore - * @param {Object} appComponentAttributes + * @param {object} appComponentAttributes * @param {Array} appComponentAttributes.fluentBundles * @param {Document} appComponentAttributes.toolboxDoc */ diff --git a/devtools/client/debugger/src/utils/editor/create-editor.js b/devtools/client/debugger/src/utils/editor/create-editor.js @@ -8,7 +8,7 @@ import { features, prefs } from "../prefs"; /** * Create a SourceEditor * - * @param {Object} config: SourceEditor config object + * @param {object} config: SourceEditor config object * @returns */ export function createEditor(config = { cm6: false }) { diff --git a/devtools/client/debugger/src/utils/editor/index.js b/devtools/client/debugger/src/utils/editor/index.js @@ -40,8 +40,8 @@ export function toWasmSourceLine(offset) { /** * Convert source lines / WASM line offsets to Codemirror lines * - * @param {Object} source - * @param {Number} lineOrOffset + * @param {object} source + * @param {number} lineOrOffset * @returns */ export function toEditorLine(source, lineOrOffset) { diff --git a/devtools/client/debugger/src/utils/editor/tokens.js b/devtools/client/debugger/src/utils/editor/tokens.js @@ -99,7 +99,7 @@ function _invalidLeaveTarget(target) { /** * Wraps the codemirror mouse events to generate token events * - * @param {Object} editor + * @param {object} editor * @returns {Function} */ export function onMouseOver(editor) { @@ -156,9 +156,9 @@ export function onMouseOver(editor) { * Gets the end position of a token at a specific line/column * * @param {*} codeMirror - * @param {Number} line - * @param {Number} column - * @returns {Number} + * @param {number} line + * @param {number} column + * @returns {number} */ export function getTokenEnd(codeMirror, line, column) { const token = codeMirror.getTokenAt({ @@ -175,7 +175,7 @@ export function getTokenEnd(codeMirror, line, column) { * * @param {*} editor * @param {*} tokenEl - * @returns {Object} An object of the form { line, column } + * @returns {object} An object of the form { line, column } */ export function getTokenLocation(editor, tokenEl) { // Get the quad (and not the bounding rect), as the span could wrap on multiple lines diff --git a/devtools/client/debugger/src/utils/expressions.js b/devtools/client/debugger/src/utils/expressions.js @@ -33,12 +33,12 @@ function isUnavailable(value) { /** * - * @param {Object} expression: Expression item as stored in state.expressions in reducers/expressions.js - * @param {String} expression.input: evaluated expression string - * @param {Object} expression.value: evaluated expression result object as returned from ScriptCommand#execute - * @param {Object} expression.value.result: expression result, might be a primitive, a grip or a front - * @param {Object} expression.value.exception: expression result error, might be a primitive, a grip or a front - * @returns {Object} an object of the following shape: + * @param {object} expression: Expression item as stored in state.expressions in reducers/expressions.js + * @param {string} expression.input: evaluated expression string + * @param {object} expression.value: evaluated expression result object as returned from ScriptCommand#execute + * @param {object} expression.value.result: expression result, might be a primitive, a grip or a front + * @param {object} expression.value.exception: expression result error, might be a primitive, a grip or a front + * @returns {object} an object of the following shape: * - expressionResultGrip: A primitive or a grip * - expressionResultFront: An object front if it exists, or undefined */ diff --git a/devtools/client/debugger/src/utils/location.js b/devtools/client/debugger/src/utils/location.js @@ -79,7 +79,7 @@ export function debuggerToSourceMapLocation(location) { * Pending location only need these three attributes, * and especially doesn't need the large source and sourceActor objects of the regular location objects. * - * @param {Object} location + * @param {object} location */ export function createPendingSelectedLocation(location) { return { diff --git a/devtools/client/debugger/src/utils/pause/frames/annotateFrames.js b/devtools/client/debugger/src/utils/pause/frames/annotateFrames.js @@ -22,7 +22,7 @@ export function annotateFramesWithLibrary(frames) { /** * Returns all the indexes that are part of a babel async call stack. * - * @param {Array<Object>} frames + * @param {Array<object>} frames * @returns Array<Integer> */ function getBabelFrameIndexes(frames) { diff --git a/devtools/client/debugger/src/utils/pause/frames/displayName.js b/devtools/client/debugger/src/utils/pause/frames/displayName.js @@ -61,14 +61,14 @@ const displayNameLibraryMap = { /** * Compute the typical way to show a frame or function to the user. * - * @param {Object} frameOrFunc + * @param {object} frameOrFunc * Either a frame or a func object. * Frame object is typically created via create.js::createFrame * Func object comes from ast reducer. - * @param {Boolean} shouldMapDisplayName + * @param {boolean} shouldMapDisplayName * True by default, will try to translate internal framework function name * into a most explicit and simplier name. - * @param {Object} l10n + * @param {object} l10n * The localization object. */ export function formatDisplayName( diff --git a/devtools/client/debugger/src/utils/pause/scopes.js b/devtools/client/debugger/src/utils/pause/scopes.js @@ -48,7 +48,7 @@ function _getThisVariable(this_, path) { * Each binding argument => [name: string, contents: BindingContents] * * @param {Array} bindings - * @param {String} parentName + * @param {string} parentName * @returns */ function _getBindingVariables(bindings, parentName) { @@ -176,7 +176,7 @@ export function _mergeLexicalScopesBindings( * Returns a string path for an scope item which can be used * in different pauses for a thread. * - * @param {Object} item + * @param {object} item * @returns */ diff --git a/devtools/client/debugger/src/utils/source-maps.js b/devtools/client/debugger/src/utils/source-maps.js @@ -15,10 +15,10 @@ import { waitForSourceToBeRegisteredInStore } from "../client/firefox/create"; * In additional to `SourceMapLoader.getGeneratedLocation`, * this asserts that the related source is still registered in the reducer current state. * - * @param {Object} location - * @param {Object} thunkArgs + * @param {object} location + * @param {object} thunkArgs * Redux action thunk arguments - * @param {Object} + * @param {object} * The matching generated location. */ export async function getGeneratedLocation(location, thunkArgs) { @@ -45,10 +45,10 @@ export async function getGeneratedLocation(location, thunkArgs) { * this automatically fetches the original source object in order to build * the original location object. * - * @param {Object} location - * @param {Object} thunkArgs + * @param {object} location + * @param {object} thunkArgs * Redux action thunk arguments - * @param {Object} options + * @param {object} options * @param {boolean} options.waitForSource * Default to false. If true is passed, this function will * ensure waiting, possibly asynchronously for the related original source @@ -57,7 +57,7 @@ export async function getGeneratedLocation(location, thunkArgs) { * Default to false. If true, this won't query an exact mapping, * but will also lookup for a loose match at the first column and next lines. * - * @param {Object} + * @param {object} * The matching original location. */ export async function getOriginalLocation( diff --git a/devtools/client/debugger/src/utils/source.js b/devtools/client/debugger/src/utils/source.js @@ -68,11 +68,11 @@ export function shouldBlackbox(source) { * Checks if the frame is within a line ranges which are blackboxed * in the source. * - * @param {Object} frame + * @param {object} frame * The current frame - * @param {Object} blackboxedRanges + * @param {object} blackboxedRanges * The currently blackboxedRanges for all the sources. - * @param {Boolean} isFrameBlackBoxed + * @param {boolean} isFrameBlackBoxed * If the frame is within the blackboxed range * or not. */ @@ -93,13 +93,13 @@ export function isFrameBlackBoxed(frame, blackboxedRanges) { * That is if any start and end lines overlap any of the * blackbox ranges * - * @param {Object} source + * @param {object} source * The current selected source - * @param {Object} blackboxedRanges + * @param {object} blackboxedRanges * The store of blackboxedRanges - * @param {Object} lineRange + * @param {object} lineRange * The start/end line range `{ start: <Number>, end: <Number> }` - * @return {Object} blackboxRange + * @return {object} blackboxRange * The first matching blackbox range that all or part of the * specified lineRange sits within. */ @@ -121,8 +121,8 @@ export function findBlackBoxRange(source, blackboxedRanges, lineRange) { * Checks if a source line is blackboxed * * @param {Array} ranges - Line ranges that are blackboxed - * @param {Number} line - * @param {Boolean} isSourceOnIgnoreList - is the line in a source that is on + * @param {number} line + * @param {boolean} isSourceOnIgnoreList - is the line in a source that is on * the sourcemap ignore lists then the line is blackboxed. * @returns boolean */ @@ -338,9 +338,9 @@ export function getTextAtPosition(sourceId, asyncContent, location) { /** * Compute the CSS classname string to use for the icon of a given source. * - * @param {Object} source + * @param {object} source * The reducer source object. - * @param {Boolean} isBlackBoxed + * @param {boolean} isBlackBoxed * To be set to true, when the given source is blackboxed. * but another tab for that source is opened pretty printed. * @return String @@ -383,8 +383,8 @@ export function isUrlExtension(url) { /** * Checks that source url matches one of the glob patterns * -* @param {Object} source -* @param {String} excludePatterns +* @param {object} source +* @param {string} excludePatterns String of comma-seperated glob patterns * @return {return} Boolean value specifies if the string matches any of the patterns. diff --git a/devtools/client/debugger/src/utils/sources-tree/getURL.js b/devtools/client/debugger/src/utils/sources-tree/getURL.js @@ -50,9 +50,9 @@ const def = { /** * Compute the URL which may be displayed in the Source Tree. * - * @param {String} url + * @param {string} url * The source absolute URL as a string - * @param {String} extensionName + * @param {string} extensionName * Optional, but mandatory when passing a moz-extension URL. * Name of the extension serving this moz-extension source. * @return URL Object diff --git a/devtools/client/debugger/src/utils/text.js b/devtools/client/debugger/src/utils/text.js @@ -13,8 +13,8 @@ * Original: 'this is a very long text and ends here' * Truncated: 'this is a ver...and ends here' * - * @param {String} sourceText - Source text - * @param {Number} maxLength - Max allowed length + * @param {string} sourceText - Source text + * @param {number} maxLength - Max allowed length * @memberof utils/text * @static */ diff --git a/devtools/client/debugger/src/workers/parser/getScopes/visitor.js b/devtools/client/debugger/src/workers/parser/getScopes/visitor.js @@ -123,11 +123,11 @@ function toParsedScopes(children, sourceId) { /** * Create a new scope object and link the scope to it parent. * - * @param {String} type - scope type - * @param {String} displayName - The scope display name - * @param {Object} parent - The parent object scope - * @param {Object} loc - The start and end postions (line/columns) of the scope - * @returns {Object} The newly created scope + * @param {string} type - scope type + * @param {string} displayName - The scope display name + * @param {object} parent - The parent object scope + * @param {object} loc - The start and end postions (line/columns) of the scope + * @returns {object} The newly created scope */ function createTempScope(type, displayName, parent, loc) { const scope = { diff --git a/devtools/client/debugger/src/workers/parser/utils/helpers.js b/devtools/client/debugger/src/workers/parser/utils/helpers.js @@ -88,12 +88,12 @@ export function getVariables(dec) { /** * Add the identifiers for a given object pattern. * - * @param {Array.<Object>} identifiers + * @param {Array.<object>} identifiers * the current list of identifiers where to push the new identifiers * related to this path. - * @param {Set<String>} identifiersKeys + * @param {Set<string>} identifiersKeys * List of currently registered identifier location key. - * @param {Object} pattern + * @param {object} pattern */ export function addPatternIdentifiers(identifiers, identifiersKeys, pattern) { let items; diff --git a/devtools/client/debugger/src/workers/pretty-print/pretty-fast.js b/devtools/client/debugger/src/workers/pretty-print/pretty-fast.js @@ -103,12 +103,12 @@ const PRE_OBJECT_LITERAL_TOKENS = new Set([ class PrettyFast { /** - * @param {Object} options: Provides configurability of the pretty printing. - * @param {String} options.url: The URL string of the ugly JS code. - * @param {String} options.indent: The string to indent code by. + * @param {object} options: Provides configurability of the pretty printing. + * @param {string} options.url: The URL string of the ugly JS code. + * @param {string} options.indent: The string to indent code by. * @param {SourceMapGenerator} options.sourceMapGenerator: An optional sourceMapGenerator * the mappings will be added to. - * @param {Boolean} options.prefixWithNewLine: When true, the pretty printed code will start + * @param {boolean} options.prefixWithNewLine: When true, the pretty printed code will start * with a line break * @param {Integer} options.originalStartLine: The line the passed script starts at (1-based). * This is used for inline scripts where we need to account for the lines @@ -200,8 +200,8 @@ class PrettyFast { #stack = []; /** - * @param {String} input: The ugly JS code we want to pretty print. - * @returns {Object} + * @param {string} input: The ugly JS code we want to pretty print. + * @returns {object} * An object with the following properties: * - code: The pretty printed code string. * - map: A SourceMapGenerator instance. @@ -411,7 +411,7 @@ class PrettyFast { * * @param Object token * The token we are currently handling. - * @param {Object|undefined} nextToken + * @param {object | undefined} nextToken * The next token, might not exist if we're on the last token */ #handleToken(token, nextToken) { @@ -738,9 +738,9 @@ function isObjectLiteral(token, previousToken) { /** * Determines if we think that the given token starts a long parenthesis * - * @param {Object} token + * @param {object} token * The token we want to determine if it is the beginning of a long paren. - * @param {Array<Object>} tokenQueue + * @param {Array<object>} tokenQueue * The whole list of tokens parsed by acorn * @param {Integer} currentTokenIndex * The index of `token` in `tokenQueue` diff --git a/devtools/client/debugger/src/workers/pretty-print/worker.js b/devtools/client/debugger/src/workers/pretty-print/worker.js @@ -79,7 +79,7 @@ function prettyPrintInlineScript({ * Get the source map for a pretty-print task * * @param {Integer} taskId: The taskId that was used to call prettyPrint - * @returns {Object} A source map object + * @returns {object} A source map object */ function getSourceMapForTask(taskId) { if (!sourceMapGeneratorByTaskId.has(taskId)) { diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-blackbox.js b/devtools/client/debugger/test/mochitest/browser_dbg-blackbox.js @@ -508,7 +508,7 @@ async function assertContextMenuDisabled(dbg, selector, shouldBeDisabled) { /** * Asserts that the gutter blackbox context menu items which are visible are correct * - * @params {Object} dbg + * @params {object} dbg * @params {Array} testFixtures * Details needed for the assertion. Any blackboxed/nonBlackboxed lines * and any blackboxed/nonBlackboxed sources @@ -566,7 +566,7 @@ async function assertGutterBlackBoxBoxContextMenuItems(dbg, testFixtures) { /** * Asserts that the source tree blackbox context menu items which are visible are correct * - * @params {Object} dbg + * @params {object} dbg * @params {Array} testFixtures * Details needed for the assertion. Any blackboxed/nonBlackboxed sources */ @@ -599,7 +599,7 @@ async function assertSourceTreeBlackBoxBoxContextMenuItems(dbg, testFixtures) { /** * Asserts that the editor blackbox context menu items which are visible are correct * - * @params {Object} dbg + * @params {object} dbg * @params {Array} testFixtures * Details needed for the assertion. Any blackboxed/nonBlackboxed lines * and any blackboxed/nonBlackboxed sources diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-pretty-print-inline-scripts.js b/devtools/client/debugger/test/mochitest/browser_dbg-pretty-print-inline-scripts.js @@ -200,7 +200,7 @@ add_task(async function prettyPrintHtmlWithSurrogatePairCharacters() { * Return the expected pretty-printed HTML. Lines starting with ➤ indicate breakable * lines for easier maintenance. * - * @returns {String} + * @returns {string} */ function getExpectedPrettyPrintedHtml() { return `<!-- This Source Code Form is subject to the terms of the Mozilla Public diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-tabs-without-urls.js b/devtools/client/debugger/test/mochitest/browser_dbg-tabs-without-urls.js @@ -38,7 +38,7 @@ add_task(async function () { /** * Get the tab content for the specific tab * - * @param {Number} index - index of the tab to get the source content + * @param {number} index - index of the tab to get the source content */ function getTabContent(dbg, index) { const tabs = findElement(dbg, "sourceTabs").children; diff --git a/devtools/client/debugger/test/mochitest/head.js b/devtools/client/debugger/test/mochitest/head.js @@ -85,8 +85,8 @@ async function installAndStartContentScriptExtension() { /** * Return the text content for a given line in the Source Tree. * - * @param {Object} dbg - * @param {Number} index + * @param {object} dbg + * @param {number} index * Line number in the source tree */ function getSourceTreeLabel(dbg, index) { @@ -102,8 +102,8 @@ function getSourceTreeLabel(dbg, index) { * Find and assert the source tree node with the specified text * exists on the source tree. * - * @param {Object} dbg - * @param {String} text The node text displayed + * @param {object} dbg + * @param {string} text The node text displayed */ async function assertSourceTreeNode(dbg, text) { let node = null; @@ -117,12 +117,12 @@ async function assertSourceTreeNode(dbg, text) { /** * Assert precisely the list of all breakable line for a given source * - * @param {Object} dbg - * @param {Object|String} file + * @param {object} dbg + * @param {object | string} file * The source name or source object to review - * @param {Number} numberOfLines + * @param {number} numberOfLines * The expected number of lines for this source. - * @param {Array<Number>} breakableLines + * @param {Array<number>} breakableLines * This list of all breakable line numbers */ async function assertBreakableLines( @@ -150,9 +150,9 @@ async function assertBreakableLines( /** * Helper alongside assertBreakable lines to ease defining list of breakable lines. * - * @param {Number} start - * @param {Number} end - * @return {Array<Number>} + * @param {number} start + * @param {number} end + * @return {Array<number>} * Returns an array of decimal numbers starting from `start` and ending with `end`. */ function getRange(start, end) { diff --git a/devtools/client/debugger/test/mochitest/integration/browser_dbg-features-source-tree.js b/devtools/client/debugger/test/mochitest/integration/browser_dbg-features-source-tree.js @@ -564,10 +564,10 @@ add_task(async function testSourceTreeWithEncodedPaths() { /** * Assert the location displayed in the breakpoint list, in the right sidebar. * - * @param {Object} dbg - * @param {String} label + * @param {object} dbg + * @param {string} label * The expected displayed location - * @param {Number} index + * @param {number} index * The position of the breakpoint in the list to verify */ function assertBreakpointHeading(dbg, label, index) { diff --git a/devtools/client/debugger/test/mochitest/integration/head.js b/devtools/client/debugger/test/mochitest/integration/head.js @@ -56,11 +56,11 @@ function _loadAllIntegrationTests() { * run all the "integration tasks" implemented in files from the "integration-tests" folder. * These files should call the `addIntegrationTask()` method to register something to run. * - * @param {String} testFolder + * @param {string} testFolder * Define what folder in "examples" folder to load before opening the debugger. * This is meant to be a versionized test folder with v1, v2, v3 folders. * (See createVersionizedHttpTestServer()) - * @param {Object} env + * @param {object} env * Environment object passed down to each task to better know * which particular integration test is being run. */ diff --git a/devtools/client/debugger/test/mochitest/shared-head.js b/devtools/client/debugger/test/mochitest/shared-head.js @@ -68,9 +68,9 @@ const DEBUGGER_L10N = new LocalizationHelper( /** * Waits for `predicate()` to be true. `state` is the redux app state. * - * @param {Object} dbg + * @param {object} dbg * @param {Function} predicate - * @param {String} msg + * @param {string} msg * @return {Promise} */ function waitForState(dbg, predicate, msg = "") { @@ -105,7 +105,7 @@ function waitForState(dbg, predicate, msg = "") { * Waits for sources to be loaded. * * @memberof mochitest/waits - * @param {Object} dbg + * @param {object} dbg * @param {Array} sources * @return {Promise} * @static @@ -136,8 +136,8 @@ async function waitForSources(dbg, ...sources) { * Waits for a source to be loaded. * * @memberof mochitest/waits - * @param {Object} dbg - * @param {String} source + * @param {object} dbg + * @param {string} source * @return {Promise} * @static */ @@ -159,9 +159,9 @@ async function waitForElement(dbg, name, ...args) { * Wait for a count of given elements to be rendered on screen. * * @param {DebuggerPanel} dbg - * @param {String} name + * @param {string} name * @param {Integer} count: Number of elements to match. Defaults to 1. - * @param {Boolean} countStrictlyEqual: When set to true, will wait until the exact number + * @param {boolean} countStrictlyEqual: When set to true, will wait until the exact number * of elements is displayed on screen. When undefined or false, will wait * until there's at least `${count}` elements on screen (e.g. if count * is 1, it will resolve if there are 2 elements rendered). @@ -232,7 +232,7 @@ async function waitForSelectedLocation(dbg, line, column) { * Wait for a given source to be selected and ready. * * @memberof mochitest/waits - * @param {Object} dbg + * @param {object} dbg * @param {null|string|Source} sourceOrUrl Optional. Either a source URL (string) or a source object (typically fetched via `findSource`) * @return {Promise} * @static @@ -343,9 +343,9 @@ async function assertLineIsBreakable(dbg, file, line, shouldBeBreakable) { * Assert that the debugger is highlighting the correct location. * * @memberof mochitest/asserts - * @param {Object} dbg - * @param {String} source - * @param {Number} line + * @param {object} dbg + * @param {string} source + * @param {number} line * @static */ function assertHighlightLocation(dbg, source, line) { @@ -447,10 +447,10 @@ async function _assertDebugLine(dbg, line, column) { /** * Make sure the debugger is paused at a certain source ID and line. * - * @param {Object} dbg - * @param {String} expectedSourceId - * @param {Number} expectedLine - * @param {Number} [expectedColumn] + * @param {object} dbg + * @param {string} expectedSourceId + * @param {number} expectedLine + * @param {number} [expectedColumn] */ async function assertPausedAtSourceAndLine( dbg, @@ -553,7 +553,7 @@ function waitForBreakpointRemoved(dbg, url, line) { /** * Returns boolean for whether the debugger is paused. * - * @param {Object} dbg + * @param {object} dbg */ function isPaused(dbg) { return dbg.selectors.getIsCurrentThreadPaused(); @@ -562,8 +562,8 @@ function isPaused(dbg) { /** * Assert that the debugger is not currently paused. * - * @param {Object} dbg - * @param {String} msg + * @param {object} dbg + * @param {string} msg * Optional assertion message */ function assertNotPaused(dbg, msg = "client is not paused") { @@ -573,7 +573,7 @@ function assertNotPaused(dbg, msg = "client is not paused") { /** * Assert that the debugger is currently paused. * - * @param {Object} dbg + * @param {object} dbg */ function assertPaused(dbg, msg = "client is paused") { ok(isPaused(dbg), msg); @@ -582,10 +582,10 @@ function assertPaused(dbg, msg = "client is paused") { /** * Waits for the debugger to be fully paused. * - * @param {Object} dbg - * @param {String} url + * @param {object} dbg + * @param {string} url * Optional URL of the script we should be pausing on. - * @param {Object} options + * @param {object} options * {Boolean} shouldWaitForLoadScopes * When paused in original files with original variable mapping disabled, scopes are * not going to exist, lets not wait for it. defaults to true @@ -673,9 +673,9 @@ function isSelectedFrameSelected(dbg) { /** * Checks to see if the frame is selected and the displayed title is correct. * - * @param {Object} dbg + * @param {object} dbg * @param {DOM Node} frameElement - * @param {String} expectedTitle + * @param {string} expectedTitle */ function assertFrameIsSelected(dbg, frameElement, expectedTitle) { const selectedFrame = dbg.selectors.getSelectedFrame(); @@ -696,9 +696,9 @@ function assertFrameIsSelected(dbg, frameElement, expectedTitle) { /** * Checks to see if the frame is not selected. * - * @param {Object} dbg + * @param {object} dbg * @param {DOM Node} frameElement - * @param {String} expectedTitle + * @param {string} expectedTitle */ function assertFrameIsNotSelected(dbg, frameElement, expectedTitle) { const selectedFrame = dbg.selectors.getSelectedFrame(); @@ -736,7 +736,7 @@ async function clearDebuggerPreferences(prefs = []) { * Intilializes the debugger. * * @memberof mochitest - * @param {String} url + * @param {string} url * @return {Promise} dbg * @static */ @@ -766,15 +766,15 @@ async function initPane(url, pane, prefs) { * Returns a source that matches a given filename, or a URL. * This also accept a source as input argument, in such case it just returns it. * - * @param {Object} dbg - * @param {String} filenameOrUrlOrSource + * @param {object} dbg + * @param {string} filenameOrUrlOrSource * The typical case will be to pass only a filename, * but you may also pass a full URL to match sources without filesnames like data: URL * or pass the source itself, which is just returned. - * @param {Object} options - * @param {Boolean} options.silent + * @param {object} options + * @param {boolean} options.silent * If true, won't throw if the source is missing. - * @return {Object} source + * @return {object} source */ function findSource( dbg, @@ -861,8 +861,8 @@ function waitForLoadedSource(dbg, url) { * Selects the source node for a specific source * from the source tree. * - * @param {Object} dbg - * @param {String} filename - The filename for the specific source + * @param {object} dbg + * @param {string} filename - The filename for the specific source */ async function selectSourceFromSourceTree(dbg, fileName) { info(`Selecting '${fileName}' source from source tree`); @@ -899,10 +899,10 @@ async function selectSourceFromSourceTreeWithIndex( /** * Trigger a context menu in the debugger source tree * - * @param {Object} dbg + * @param {object} dbg * @param {Obejct} sourceTreeNode - The node in the source tree which the context menu * item needs to be triggered on. - * @param {String} contextMenuItem - The id for the context menu item to be selected + * @param {string} contextMenuItem - The id for the context menu item to be selected */ async function triggerSourceTreeContextMenu( dbg, @@ -923,10 +923,10 @@ async function triggerSourceTreeContextMenu( * Selects the source. * * @memberof mochitest/actions - * @param {Object} dbg - * @param {String} url - * @param {Number} line - * @param {Number} column + * @param {object} dbg + * @param {string} url + * @param {number} line + * @param {number} column * @return {Promise} * @static */ @@ -954,8 +954,8 @@ function countTabs(dbg) { * Steps over. * * @memberof mochitest/actions - * @param {Object} dbg - * @param {Object} pauseOptions + * @param {object} dbg + * @param {object} pauseOptions * @return {Promise} * @static */ @@ -970,7 +970,7 @@ async function stepOver(dbg, pauseOptions) { * Steps in. * * @memberof mochitest/actions - * @param {Object} dbg + * @param {object} dbg * @return {Promise} * @static */ @@ -985,7 +985,7 @@ async function stepIn(dbg) { * Steps out. * * @memberof mochitest/actions - * @param {Object} dbg + * @param {object} dbg * @return {Promise} * @static */ @@ -1000,7 +1000,7 @@ async function stepOut(dbg) { * Resumes. * * @memberof mochitest/actions - * @param {Object} dbg + * @param {object} dbg * @return {Promise} * @static */ @@ -1021,7 +1021,7 @@ function deleteExpression(dbg, input) { * Reloads the debuggee. * * @memberof mochitest/actions - * @param {Object} dbg + * @param {object} dbg * @param {Array} sources * @return {Promise} * @static @@ -1062,8 +1062,8 @@ async function reloadWhenPausedBeforePageLoaded(dbg, ...sources) { * Navigates the debuggee to another url. * * @memberof mochitest/actions - * @param {Object} dbg - * @param {String} url + * @param {object} dbg + * @param {string} url * @param {Array} sources * @return {Promise} * @static @@ -1076,8 +1076,8 @@ async function navigate(dbg, url, ...sources) { * Navigates the debuggee to another absolute url. * * @memberof mochitest/actions - * @param {Object} dbg - * @param {String} url + * @param {object} dbg + * @param {string} url * @param {Array} sources * @return {Promise} * @static @@ -1122,10 +1122,10 @@ function getBreakpointForLocation(dbg, location) { * Adds a breakpoint to a source at line/col. * * @memberof mochitest/actions - * @param {Object} dbg - * @param {String} source - * @param {Number} line - * @param {Number} col + * @param {object} dbg + * @param {string} source + * @param {number} line + * @param {number} col * @return {Promise} * @static */ @@ -1345,10 +1345,10 @@ function findSourceNodeWithText(dbg, text) { /** * Assert the icon type used in the SourceTree for a given source * - * @param {Object} dbg - * @param {String} sourceName + * @param {object} dbg + * @param {string} sourceName * Name of the source displayed in the source tree - * @param {String} icon + * @param {string} icon * Expected icon CSS classname */ function assertSourceIcon(dbg, sourceName, icon) { @@ -1381,10 +1381,10 @@ async function expandAllSourceNodes(dbg, treeNode) { * Removes a breakpoint from a source at line/col. * * @memberof mochitest/actions - * @param {Object} dbg - * @param {String} source - * @param {Number} line - * @param {Number} col + * @param {object} dbg + * @param {string} source + * @param {number} line + * @param {number} col * @return {Promise} * @static */ @@ -1405,9 +1405,9 @@ function removeBreakpoint(dbg, sourceId, line, column) { * Toggles the Pause on exceptions feature in the debugger. * * @memberof mochitest/actions - * @param {Object} dbg - * @param {Boolean} pauseOnExceptions - * @param {Boolean} pauseOnCaughtExceptions + * @param {object} dbg + * @param {boolean} pauseOnExceptions + * @param {boolean} pauseOnCaughtExceptions * @return {Promise} * @static */ @@ -1428,7 +1428,7 @@ async function togglePauseOnExceptions( * Invokes a global function in the debuggee tab. * * @memberof mochitest/helpers - * @param {String} fnc The name of a global function on the content window to + * @param {string} fnc The name of a global function on the content window to * call. This is applied to structured clones of the * remaining arguments to invokeInTab. * @param {Any} ...args Remaining args to serialize and pass to fnc. @@ -1532,8 +1532,8 @@ const keyMappings = { * Simulates a key press in the debugger window. * * @memberof mochitest/helpers - * @param {Object} dbg - * @param {String} keyName + * @param {object} dbg + * @param {string} keyName * @return {Promise} * @static */ @@ -1552,7 +1552,7 @@ function type(dbg, string) { * Checks to see if the inner element is visible inside the editor. * * @memberof mochitest/helpers - * @param {Object} dbg + * @param {object} dbg * @param {HTMLElement} inner element * @return {boolean} * @static @@ -1621,7 +1621,7 @@ async function scrollAndGetEditorLineGutterElement(dbg, line) { * Gets node at a specific line in the editor * * @param {*} dbg - * @param {Number} line + * @param {number} line * @returns {Element} DOM Element */ async function getNodeAtEditorLine(dbg, line) { @@ -1633,7 +1633,7 @@ async function getNodeAtEditorLine(dbg, line) { * Gets node at a specific line in the gutter * * @param {*} dbg - * @param {Number} line + * @param {number} line * @returns {Element} DOM Element */ async function getNodeAtEditorGutterLine(dbg, line) { @@ -1658,10 +1658,10 @@ async function waitForConditionalPanelFocus(dbg) { * Opens the debugger editor context menu in either codemirror or the * the debugger gutter. * - * @param {Object} dbg - * @param {String} elementName + * @param {object} dbg + * @param {string} elementName * The element to select - * @param {Number} line + * @param {number} line * The line to open the context menu on. */ async function openContextMenuInDebugger(dbg, elementName, line) { @@ -1674,9 +1674,9 @@ async function openContextMenuInDebugger(dbg, elementName, line) { /** * Select a range of lines in the editor and open the contextmenu * - * @param {Object} dbg - * @param {Object} lines - * @param {String} elementName + * @param {object} dbg + * @param {object} lines + * @param {string} elementName * @returns */ async function selectEditorLinesAndOpenContextMenu( @@ -1692,8 +1692,8 @@ async function selectEditorLinesAndOpenContextMenu( /** * Asserts that the styling for ignored lines are applied * - * @param {Object} dbg - * @param {Object} options + * @param {object} dbg + * @param {object} options * lines {null | Number[]} [lines] Line(s) to assert. * - If null is passed, the assertion is on all the blackboxed lines * - If an array of one item (start line) is passed, the assertion is on the specified line @@ -1734,9 +1734,9 @@ async function assertIgnoredStyleInSourceLines( * Assert the text content on the line matches what is * expected. * - * @param {Object} dbg - * @param {Number} line - * @param {String} expectedTextContent + * @param {object} dbg + * @param {number} line + * @param {string} expectedTextContent */ function assertTextContentOnLine(dbg, line, expectedTextContent) { const lineInfo = getCMEditor(dbg).lineInfo(line); @@ -1749,8 +1749,8 @@ function assertTextContentOnLine(dbg, line, expectedTextContent) { * the currently selected source in the editor. * * @memberof mochitest/helpers - * @param {Object} dbg - * @param {Number} line Line where to check for a breakpoint in the editor + * @param {object} dbg + * @param {number} line Line where to check for a breakpoint in the editor * @static */ async function assertNoBreakpoint(dbg, line) { @@ -1765,8 +1765,8 @@ async function assertNoBreakpoint(dbg, line) { * selected source in the editor. (no conditional, nor log breakpoint) * * @memberof mochitest/helpers - * @param {Object} dbg - * @param {Number} line Line where to check for a breakpoint + * @param {object} dbg + * @param {number} line Line where to check for a breakpoint * @static */ async function assertBreakpoint(dbg, line) { @@ -1790,8 +1790,8 @@ async function assertBreakpoint(dbg, line) { * Assert that a conditionnal breakpoint is set. * * @memberof mochitest/helpers - * @param {Object} dbg - * @param {Number} line Line where to check for a breakpoint + * @param {object} dbg + * @param {number} line Line where to check for a breakpoint * @static */ async function assertConditionBreakpoint(dbg, line) { @@ -1816,8 +1816,8 @@ async function assertConditionBreakpoint(dbg, line) { * Assert that a log breakpoint is set. * * @memberof mochitest/helpers - * @param {Object} dbg - * @param {Number} line Line where to check for a breakpoint + * @param {object} dbg + * @param {number} line Line where to check for a breakpoint * @static */ async function assertLogBreakpoint(dbg, line) { @@ -2025,8 +2025,8 @@ function getSourceNodeLabel(dbg, index) { * Simulates a mouse click in the debugger DOM. * * @memberof mochitest/helpers - * @param {Object} dbg - * @param {String} elementName + * @param {object} dbg + * @param {string} elementName * @param {Array} args * @return {Promise} * @static @@ -2149,8 +2149,8 @@ async function waitForContextMenu(dbg) { * Closes and open context menu popup. * * @memberof mochitest/helpers - * @param {Object} dbg - * @param {String} popup - The currently opened popup returned by + * @param {object} dbg + * @param {string} popup - The currently opened popup returned by * `waitForContextMenu`. * @return {Promise} */ @@ -2335,7 +2335,7 @@ function getEditorContent(dbg) { * "conditionalPanelInput" to retrieve the codemirror instances specific to * those panels. * - * @param {Object} dbg + * @param {object} dbg * @param {string} panelName * @returns {CodeMirror} * The codemirror instance corresponding to the provided debugger and panel name. @@ -2368,8 +2368,8 @@ async function waitForCursorPosition(dbg, expectedLine) { * Set the cursor at a specific location in the editor * * @param {*} dbg - * @param {Number} line - * @param {Number} column + * @param {number} line + * @param {number} column * @returns {Promise} */ async function setEditorCursorAt(dbg, line, column) { @@ -2382,9 +2382,9 @@ async function setEditorCursorAt(dbg, line, column) { * Scrolls a specific line and column into view in the editor * * @param {*} dbg - * @param {Number} line - * @param {Number} column - * @param {String|null} yAlign + * @param {number} line + * @param {number} column + * @param {string | null} yAlign * @returns */ async function scrollEditorIntoView(dbg, line, column, yAlign) { @@ -2400,8 +2400,8 @@ async function scrollEditorIntoView(dbg, line, column, yAlign) { * Wrapper around source editor api to check if a scrolled position is visible * * @param {*} dbg - * @param {Number} line 1-based - * @param {Number} column + * @param {number} line 1-based + * @param {number} column * @returns */ function isScrolledPositionVisible(dbg, line, column = 0) { @@ -2442,8 +2442,8 @@ async function getTokenFromPosition(dbg, { line, column = 0 }) { * Waits for the currently triggered scroll to complete * * @param {*} dbg - * @param {Object} options - * @param {Boolean} options.useTimeoutFallback - defaults to true. When set to false + * @param {object} options + * @param {boolean} options.useTimeoutFallback - defaults to true. When set to false * a scroll must happen for the wait for scrolling to complete * @returns */ @@ -2533,10 +2533,10 @@ function hoverToken(tokenEl) { /** * Helper to close a variable preview popup. * - * @param {Object} dbg + * @param {object} dbg * @param {DOM Element} tokenEl * The DOM element on which we hovered to display the popup. - * @param {String} previewType + * @param {string} previewType * Based on the actual JS value being hovered we may have two different kinds * of popups: popup (for js objects) or previewPopup (for primitives) */ @@ -2606,7 +2606,7 @@ async function closePreviewForToken( * @param {Debugger} dbg * @param {Integer} line: The line we want to hover over * @param {Integer} column: The column we want to hover over - * @param {String} elementName: "Selector" string that will be passed to waitForElement, + * @param {string} elementName: "Selector" string that will be passed to waitForElement, * describing the element that should be displayed on hover. * @returns Promise<{element, tokenEl}> * element is the DOM element matching the passed elementName @@ -2630,10 +2630,10 @@ async function tryHovering(dbg, line, column, elementName) { * CodeMirror internal method for this (and which might suffer from bugs / outdated internal state) * * @param {Debugger} dbg - * @param {String} expression: The text of the token we want to hover + * @param {string} expression: The text of the token we want to hover * @param {Integer} line: The line the token should be at * @param {Integer} column: The column the token should be at - * @param {String} elementName: "Selector" string that will be passed to waitForElement, + * @param {string} elementName: "Selector" string that will be passed to waitForElement, * describing the element that should be displayed on hover. * @returns Promise<{element, tokenEl}> * element is the DOM element matching the passed elementName @@ -2670,7 +2670,7 @@ async function tryHoverToken(dbg, tokenEl, elementName) { * Retrieve the token element matching `expression` at line `line`, from the DOM. * * @param {Debugger} dbg - * @param {String} expression: The text of the token we want to hover + * @param {string} expression: The text of the token we want to hover * @param {Integer} line: The line the token should be at * @param {Integer} column: The column the token should be at * @returns {Element} the token element, or null if not found @@ -2710,12 +2710,12 @@ async function assertNoTooltip(dbg) { * Hovers and asserts tooltip previews with simple text expressions (i.e numbers and strings) * * @param {*} dbg - * @param {Number} line - * @param {Number} column - * @param {Object} options - * @param {String} options.result - Expected text shown in the preview - * @param {String} options.expression - The expression hovered over - * @param {Boolean} options.doNotClose - Set to true to not close the tooltip + * @param {number} line + * @param {number} column + * @param {object} options + * @param {string} options.result - Expected text shown in the preview + * @param {string} options.expression - The expression hovered over + * @param {boolean} options.doNotClose - Set to true to not close the tooltip */ async function assertPreviewTextValue( dbg, @@ -2832,10 +2832,10 @@ async function assertPreviews(dbg, previews) { * Asserts the inline expression preview value * * @param {*} dbg - * @param {Number} line - * @param {Number} column - * @param {Object} options - * @param {String} options.result - Expected text shown in the preview + * @param {number} line + * @param {number} column + * @param {object} options + * @param {string} options.result - Expected text shown in the preview * @param {Array} options.fields - The expected stacktrace information */ async function assertInlineExceptionPreview( @@ -2894,7 +2894,7 @@ async function assertInlineExceptionPreview( * Wait until a preview popup containing the given result is shown * * @param {*} dbg - * @param {String} result + * @param {string} result */ async function waitForPreviewWithResult(dbg, result) { info(`Wait for preview popup with result ${result}`); @@ -2908,7 +2908,7 @@ async function waitForPreviewWithResult(dbg, result) { * Expand or collapse a node in the preview popup * * @param {*} dbg - * @param {Number} index + * @param {number} index */ async function toggleExpanded(dbg, index) { let initialNodesLength; @@ -3108,9 +3108,9 @@ async function editExpression(dbg, input) { /** * Get the text representation of a watch expression label given its position in the panel * - * @param {Object} dbg - * @param {Number} index: Position in the panel of the expression we want the label of - * @returns {String} + * @param {object} dbg + * @param {number} index: Position in the panel of the expression we want the label of + * @returns {string} */ function getWatchExpressionLabel(dbg, index) { return findElement(dbg, "expressionNode", index).innerText; @@ -3119,9 +3119,9 @@ function getWatchExpressionLabel(dbg, index) { /** * Get the text representation of a watch expression value given its position in the panel * - * @param {Object} dbg - * @param {Number} index: Position in the panel of the expression we want the value of - * @returns {String} + * @param {object} dbg + * @param {number} index: Position in the panel of the expression we want the value of + * @returns {string} */ function getWatchExpressionValue(dbg, index) { return findElement(dbg, "expressionValue", index).innerText; @@ -3310,8 +3310,8 @@ async function toggleSourcesTreeSettingsMenuItem( * and wait for its context menu to be rendered before clicking * on one menuitem of it. * - * @param {Object} dbg - * @param {String} className + * @param {object} dbg + * @param {string} className * The class name of the menuitem to click in the context menu. */ async function clickOnSourceMapMenuItem(dbg, className) { @@ -3365,8 +3365,8 @@ async function setLogPoint(dbg, index, value, showStacktrace = false) { /** * Opens the project search panel * - * @param {Object} dbg - * @return {Boolean} The project search is open + * @param {object} dbg + * @return {boolean} The project search is open */ function openProjectSearch(dbg) { info("Opening the project search panel"); @@ -3377,9 +3377,9 @@ function openProjectSearch(dbg) { /** * Starts a project search based on the specified search term * - * @param {Object} dbg - * @param {String} searchTerm - The test to search for - * @param {Number} expectedResults - The expected no of results to wait for. + * @param {object} dbg + * @param {string} searchTerm - The test to search for + * @param {number} expectedResults - The expected no of results to wait for. * This is the number of file results and not the numer of matches in all files. * When falsy value is passed, expects no match. * @return {Array} List of search results element nodes @@ -3394,8 +3394,8 @@ async function doProjectSearch(dbg, searchTerm, expectedResults) { /** * Waits for the search results node to render * - * @param {Object} dbg - * @param {Number} expectedResults - The expected no of results to wait for + * @param {object} dbg + * @param {number} expectedResults - The expected no of results to wait for * This is the number of file results and not the numer of matches in all files. * @return (Array) List of search result element nodes */ @@ -3427,8 +3427,8 @@ async function waitForSearchResults(dbg, expectedResults) { /** * Get the no of expanded search results * - * @param {Object} dbg - * @return {Number} No of expanded results + * @param {object} dbg + * @return {number} No of expanded results */ function getExpandedResultsCount(dbg) { return findAllElements(dbg, "projectSearchExpandedResults").length; @@ -3457,8 +3457,8 @@ if (protocolHandler.hasSubstitution("testing-common")) { /** * Selects the specific black box context menu item * - * @param {Object} dbg - * @param {String} itemName + * @param {object} dbg + * @param {string} itemName * The name of the context menu item. */ async function selectBlackBoxContextMenuItem(dbg, itemName) { @@ -3529,8 +3529,8 @@ function findFooterNotificationMessage(dbg) { /** * Toggle a JavaScript Tracer settings via the toolbox toolbar button's context menu. * - * @param {Object} dbg - * @param {String} selector + * @param {object} dbg + * @param {string} selector * Selector for the menu item of the settings defined in devtools/client/framework/definitions.js. */ async function toggleJsTracerMenuItem(dbg, selector) { @@ -3550,9 +3550,9 @@ async function toggleJsTracerMenuItem(dbg, selector) { * Asserts that the number of displayed inline previews, the contents of the inline previews and the lines * that they are displayed on, are accurate * - * @param {Object} dbg + * @param {object} dbg * @param {Array} expectedInlinePreviews - * @param {String} fnName + * @param {string} fnName */ async function assertInlinePreviews(dbg, expectedInlinePreviews, fnName) { // Accumulate all the previews over the various lines diff --git a/devtools/client/devtools-client.js b/devtools/client/devtools-client.js @@ -840,7 +840,7 @@ DevToolsClient.prototype = { /** * Return the Front for the Actor whose ID is the one passed in argument. * - * @param {String} actorID: The actor ID to look for. + * @param {string} actorID: The actor ID to look for. */ getFrontByID(actorID) { const pool = this.poolFor(actorID); @@ -859,7 +859,7 @@ DevToolsClient.prototype = { /** * Creates an object front for this DevToolsClient and the grip in parameter, * - * @param {Object} grip: The grip to create the ObjectFront for. + * @param {object} grip: The grip to create the ObjectFront for. * @param {ThreadFront} threadFront * @param {Front} parentFront: Optional front that will manage the object front. * Defaults to threadFront. diff --git a/devtools/client/dom/test/head.js b/devtools/client/dom/test/head.js @@ -19,7 +19,7 @@ const constants = require("resource://devtools/client/dom/content/constants.js") /** * Add a new test tab in the browser and load the given url. * - * @param {String} url + * @param {string} url * The url to be loaded in the new tab * @return a promise that resolves to the tab object when * the url is loaded @@ -144,9 +144,9 @@ function getAllRowsForLabel(panel, text) { * Strings in the tree are in the form ""a"" and numbers in the form "1". We * normalize these values by converting ""a"" to "a" and "1" to 1. * - * @param {String} value + * @param {string} value * The value to normalize. - * @return {String|Number} + * @return {string | number} * The normalized value. */ function normalizeTreeValue(value) { diff --git a/devtools/client/framework/browser-menus.js b/devtools/client/framework/browser-menus.js @@ -50,16 +50,16 @@ function l10n(key) { * * @param {HTMLDocument} doc * The document to which menus are to be added. - * @param {String} id + * @param {string} id * Element id. - * @param {String} label + * @param {string} label * Menu label. - * @param {String} accesskey (optional) + * @param {string} accesskey (optional) * Access key of the menuitem, used as shortcut while opening the menu. - * @param {Boolean} isCheckbox (optional) + * @param {boolean} isCheckbox (optional) * If true, the menuitem will act as a checkbox and have an optional * tick on its left. - * @param {String} appMenuL10nId (optional) + * @param {string} appMenuL10nId (optional) * A Fluent key to set the appmenu-data-l10n-id attribute of the menuitem * to. This can then be used to show a different string when cloning the * menuitem to show in the AppMenu or panel contexts. @@ -93,7 +93,7 @@ function createMenuItem({ /** * Add a menu entry for a tool definition * - * @param {Object} toolDefinition + * @param {object} toolDefinition * Tool definition of the tool to add a menu entry. * @param {HTMLDocument} doc * The document to which the tool menu item is to be added. @@ -161,9 +161,9 @@ function sendEntryPointTelemetry(window) { * * @param {HTMLDocument} doc * The document to which the tool is to be registered. - * @param {Object} toolDefinition + * @param {object} toolDefinition * Tool definition of the tool to register. - * @param {Object} prevDef + * @param {object} prevDef * The tool definition after which the tool menu item is to be added. */ function insertToolMenuElements(doc, toolDefinition, prevDef) { diff --git a/devtools/client/framework/browser-toolbox/Launcher.sys.mjs b/devtools/client/framework/browser-toolbox/Launcher.sys.mjs @@ -40,7 +40,7 @@ const EventEmitter = require("resource://devtools/shared/event-emitter.js"); const processes = new Set(); /** - * @typedef {Object} BrowserToolboxLauncherArgs + * @typedef {object} BrowserToolboxLauncherArgs * @property {function} onRun - A function called when the process starts running. * @property {boolean} overwritePreferences - Set to force overwriting the toolbox * profile's preferences with the current set of preferences. @@ -274,7 +274,7 @@ export class BrowserToolboxLauncher extends EventEmitter { /** * Creates and initializes the profile & process for the remote debugger. * - * @param {Object} options + * @param {object} options * @param {boolean} options.forceMultiprocess: Set to true to force the Browser Toolbox to be in * multiprocess mode. */ diff --git a/devtools/client/framework/browser-toolbox/test/helpers-browser-toolbox.js b/devtools/client/framework/browser-toolbox/test/helpers-browser-toolbox.js @@ -25,7 +25,7 @@ const { * * Destroy the browser toolbox and make sure it exits cleanly. * - * @param {Object}: + * @param {object}: * - {Function} existingProcessClose: if truth-y, connect to an existing * browser toolbox process rather than launching a new one and * connecting to it. The given function is expected to return an diff --git a/devtools/client/framework/components/ToolboxToolbar.js b/devtools/client/framework/components/ToolboxToolbar.js @@ -195,7 +195,7 @@ class ToolboxToolbar extends Component { * See Toolbox.prototype._createButtonState in devtools/client/framework/toolbox.js for * documentation on this object. * - * @param {String} focusedButton - The id of the focused button. + * @param {string} focusedButton - The id of the focused button. * @param {Array} toolboxButtons - Array of objects that define the command buttons. * @param {Function} focusButton - Keep a record of the currently focused button. * @param {boolean} isStart - Render either the starting buttons, or ending buttons. @@ -411,7 +411,7 @@ class ToolboxToolbar extends Component { * The id of the focused button. * @param {string} props.currentToolId * The id of the currently selected tool, e.g. "inspector". - * @param {Object[]} props.hostTypes + * @param {object[]} props.hostTypes * Array of host type objects. * @param {string} props.hostTypes[].position * Position name. @@ -446,12 +446,12 @@ class ToolboxToolbar extends Component { * Completely close the toolbox. * @param {Function} props.focusButton * Keep a record of the currently focused button. - * @param {Object} props.L10N + * @param {object} props.L10N * Localization interface. - * @param {Object} props.toolbox + * @param {object} props.toolbox * The devtools toolbox. Used by the MenuButton component to display * the menu popup. - * @param {Object} refs + * @param {object} refs * The components refs object. Used to keep a reference to the MenuButton * for the meatball menu so that we can tell it to resize its contents * when they change. diff --git a/devtools/client/framework/devtools-browser.js b/devtools/client/framework/devtools-browser.js @@ -244,13 +244,13 @@ var gDevToolsBrowser = (exports.gDevToolsBrowser = { * * @param {Window} window * The top level browser window from which the key shortcut is pressed. - * @param {Object} key + * @param {object} key * Key object describing the key shortcut being pressed. It comes * from devtools-startup.js's KeyShortcuts array. The useful fields here * are: * - `toolId` used to identify a toolbox's panel like inspector or webconsole, * - `id` used to identify any other key shortcuts like about:debugging - * @param {Number} startTime + * @param {number} startTime * Optional, indicates the time at which the key event fired. This is a * `ChromeUtils.now()` timing. */ diff --git a/devtools/client/framework/devtools.js b/devtools/client/framework/devtools.js @@ -455,7 +455,7 @@ DevTools.prototype = { /** * Called from SessionStore.sys.mjs in mozilla-central when saving the current state. * - * @param {Object} state + * @param {object} state * A SessionStore state object that gets modified by reference */ saveDevToolsSession(state) { @@ -498,16 +498,16 @@ DevTools.prototype = { * * @param {Commands Object} commands * The commands object which designates which context the toolbox will debug - * @param {Object} options - * @param {String} options.toolId + * @param {object} options + * @param {string} options.toolId * The id of the tool to show - * @param {Object} options.toolOptions + * @param {object} options.toolOptions * Options that will be passed to the tool init function * @param {Toolbox.HostType}options. hostType * The type of host (bottom, window, left, right) * @param {object} options.hostOptions * Options for host specifically - * @param {Number} options.startTime + * @param {number} options.startTime * Indicates the time at which the user event related to * this toolbox opening started. This is a `ChromeUtils.now()` timing. * @param {string} options.reason @@ -600,7 +600,7 @@ DevTools.prototype = { * * @param {XULTab} tab * The tab the toolbox will debug - * @param {Object} options + * @param {object} options * Various options that will be forwarded to `showToolbox`. See the * JSDoc on this method. */ @@ -652,9 +652,9 @@ DevTools.prototype = { * * Note that this will spawn a new DevToolsClient. * - * @param {String} extensionId + * @param {string} extensionId * ID of the extension to debug. - * @param {Object} (optional) + * @param {object} (optional) * - {String} toolId * The id of the tool to show */ @@ -690,9 +690,9 @@ DevTools.prototype = { * subsequent toolbox opening, which should all be faster. * These two probes are indexed by Tool ID. * - * @param {String} toolbox + * @param {string} toolbox * Toolbox instance. - * @param {Number} startTime + * @param {number} startTime * Indicates the time at which the user event related to the toolbox * opening started. This is a `ChromeUtils.now()` timing. */ @@ -859,7 +859,7 @@ DevTools.prototype = { * @param {ElementIdentifier} domReference * Identifier generated by ContentDOMReference. It is a unique pair of * BrowsingContext ID and a numeric ID. - * @param {Number} startTime + * @param {number} startTime * Optional, indicates the time at which the user event related to this node * inspection started. This is a `ChromeUtils.now()` timing. * @return {Promise} a promise that resolves when the node is selected in the inspector @@ -916,7 +916,7 @@ DevTools.prototype = { * @param {ElementIdentifier} domReference * Identifier generated by ContentDOMReference. It is a unique pair of * BrowsingContext ID and a numeric ID. - * @param {Number} startTime + * @param {number} startTime * Optional, indicates the time at which the user event related to this * node inspection started. This is a `ChromeUtils.now()` timing. * @return {Promise} a promise that resolves when the accessible object is diff --git a/devtools/client/framework/selection.js b/devtools/client/framework/selection.js @@ -179,12 +179,12 @@ class Selection extends EventEmitter { * * @param {NodeFront} nodeFront * The NodeFront being selected. - * @param {Object} options (optional) - * @param {String} options.reason: Reason that triggered the selection, will be fired with + * @param {object} options (optional) + * @param {string} options.reason: Reason that triggered the selection, will be fired with * the "new-node-front" event. - * @param {Boolean} options.isSlotted: Is the selection representing the slotted version + * @param {boolean} options.isSlotted: Is the selection representing the slotted version * of the node. - * @param {String} options.searchQuery: If the selection was triggered by a search, the + * @param {string} options.searchQuery: If the selection was triggered by a search, the * query of said search */ setNodeFront( diff --git a/devtools/client/framework/test/browser_toolbox_zoom_popup.js b/devtools/client/framework/test/browser_toolbox_zoom_popup.js @@ -133,11 +133,11 @@ function convertScreenToDoc(popup, doc) { * measured by clicking the menu button and looking for its panel (and then * hiding it again). * - * @param {Object} doc + * @param {object} doc * The toolbox document to query. - * @param {Object} menuButton + * @param {object} menuButton * The button whose size and popup size we should measure. - * @return {Object} + * @return {object} * An object with the following properties: * - buttonBounds {DOMRect} Bounds of the button. * - menuType {string} Type of the menu, "native" or "doorhanger". diff --git a/devtools/client/framework/test/head.js b/devtools/client/framework/test/head.js @@ -18,7 +18,7 @@ const EventEmitter = require("resource://devtools/shared/event-emitter.js"); * * @param {XULTab} tab * The tab for which we want to get the list of supported toolIds - * @return {Array<String>} array of tool ids + * @return {Array<string>} array of tool ids */ async function getSupportedToolIds(tab) { info("Getting the entire list of tools supported in this tab"); @@ -115,7 +115,7 @@ function checkHostType(toolbox, hostType, previousHostType) { * Create a new <script> referencing URL. Return a promise that * resolves when this has happened * - * @param {String} url + * @param {string} url * the url * @return {Promise} a promise that resolves when the element has been created */ @@ -134,7 +134,7 @@ function createScript(url) { * Wait for the toolbox to notice that a given source is loaded * * @param {Toolbox} toolbox - * @param {String} url + * @param {string} url * the url to wait for * @return {Promise} a promise that is resolved when the source is loaded */ @@ -427,7 +427,7 @@ async function openAboutToolbox(params) { * * @param {Toolbox} toolbox * Toolbox instance. - * @param {String} path + * @param {string} path * Path to the FTL file. */ function loadFTL(toolbox, path) { @@ -442,7 +442,7 @@ function loadFTL(toolbox, path) { * Emit a reload key shortcut from a given toolbox, and wait for the reload to * be completed. * - * @param {String} shortcut + * @param {string} shortcut * The key shortcut to send, as expected by the devtools shortcuts * helpers (eg. "CmdOrCtrl+F5"). * @param {Toolbox} toolbox diff --git a/devtools/client/framework/test/metrics/head.js b/devtools/client/framework/test/metrics/head.js @@ -34,7 +34,7 @@ function countCharsInModules(modules) { /** * Record module loading data. * - * @param {Object} + * @param {object} * - filterString {String} path to use to filter modules specific to the current panel * - loaders {Array} Array of Loaders to check for modules * - panelName {String} reused in identifiers for perfherder data diff --git a/devtools/client/framework/toolbox-context-menu.js b/devtools/client/framework/toolbox-context-menu.js @@ -33,7 +33,7 @@ function loadEditMenuStrings(win) { * You'll need to call menu.popup() yourself, this just returns the Menu instance. * * @param {Window} win parent window reference - * @param {String} id menu ID + * @param {string} id menu ID * * @returns {Menu} */ diff --git a/devtools/client/framework/toolbox-host-manager.js b/devtools/client/framework/toolbox-host-manager.js @@ -92,9 +92,9 @@ ToolboxHostManager.prototype = { /** * Create a Toolbox * - * @param {String} toolId + * @param {string} toolId * The id of the tool to show - * @param {Object} toolOptions + * @param {object} toolOptions * Options that will be passed to the tool init function * @returns {Toolbox} */ @@ -243,9 +243,9 @@ ToolboxHostManager.prototype = { * Migrate the toolbox to a new host, while keeping it fully functional. * The toolbox's iframe will be moved as-is to the new host. * - * @param {String} hostType + * @param {string} hostType * The new type of host to spawn - * @param {Boolean} destroyPreviousHost + * @param {boolean} destroyPreviousHost * Defaults to true. If false is passed, we will avoid destroying * the previous host. This is helpful for popup debugging, * where we migrate the toolbox between two tabs. In this scenario @@ -333,7 +333,7 @@ ToolboxHostManager.prototype = { * and popup tabs. This method will only move the host to a new tab, while * keeping the same host type. * - * @param {String} tabBrowsingContextID + * @param {string} tabBrowsingContextID * The ID of the browsing context of the tab we want to move to. */ async switchHostToTab(tabBrowsingContextID) { diff --git a/devtools/client/framework/toolbox-hosts.js b/devtools/client/framework/toolbox-hosts.js @@ -44,7 +44,7 @@ class BaseInBrowserHost { /** * @param {Tab} hostTab * The web page's tab where DevTools are displayed. - * @param {String} type + * @param {string} type * The host type: left, bottom, right. */ constructor(hostTab, type) { diff --git a/devtools/client/framework/toolbox.js b/devtools/client/framework/toolbox.js @@ -539,7 +539,7 @@ Toolbox.prototype = { * Note that this does not open the tool, use selectTool if you'd * like to select the tool right away. * - * @param {String} id + * @param {string} id * The id of the panel, for example "jsdebugger". * @returns Promise * A promise that resolves once the panel is ready. @@ -661,7 +661,7 @@ Toolbox.prototype = { /** * Set a given target as selected (which may impact the console evaluation context selector). * - * @param {String} targetActorID: The actorID of the target we want to select. + * @param {string} targetActorID: The actorID of the target we want to select. */ selectTarget(targetActorID) { if (this.getSelectedTargetFront()?.actorID !== targetActorID) { @@ -711,7 +711,7 @@ Toolbox.prototype = { /** * Called on each new THREAD_STATE resource * - * @param {Object} resource The THREAD_STATE resource + * @param {object} resource The THREAD_STATE resource */ _onThreadStateChanged(resource) { if (resource.state == "paused") { @@ -746,7 +746,7 @@ Toolbox.prototype = { /** * Called on each new JSTRACER_STATE resource * - * @param {Object} resource The JSTRACER_STATE resource + * @param {object} resource The JSTRACER_STATE resource */ async _onTracingStateChanged(resource) { const { profile } = resource; @@ -1322,7 +1322,7 @@ Toolbox.prototype = { /** * Reload the debugged context. * - * @param {Boolean} bypassCache + * @param {boolean} bypassCache * If true, bypass any cache when reloading. */ async reload(bypassCache) { @@ -1657,17 +1657,17 @@ Toolbox.prototype = { * "updatechecked" event any time the isChecked value is updated, allowing any consuming * components to listen and respond to updates. * - * @param {Object} options: + * @param {object} options: * - * @property {String} id - The id of the button or command. - * @property {String} className - An optional additional className for the button. - * @property {String} description - The value that will display as a tooltip and in + * @property {string} id - The id of the button or command. + * @property {string} className - An optional additional className for the button. + * @property {string} description - The value that will display as a tooltip and in * the options panel for enabling/disabling. - * @property {Boolean} disabled - An optional disabled state for the button. + * @property {boolean} disabled - An optional disabled state for the button. * @property {Function} onClick - The function to run when the button is activated by * click or keyboard shortcut. First argument will be the 'click' * event, and second argument is the toolbox instance. - * @property {Boolean} isInStartContainer - Buttons can either be placed at the start + * @property {boolean} isInStartContainer - Buttons can either be placed at the start * of the toolbar, or at the end. * @property {Function} setup - Function run immediately to listen for events changing * whenever the button is checked or unchecked. The toolbox object @@ -1799,11 +1799,11 @@ Toolbox.prototype = { * Add a shortcut key that should work when a split console * has focus to the toolbox. * - * @param {String} key + * @param {string} key * The electron key shortcut. * @param {Function} handler * The callback that should be called when the provided key shortcut is pressed. - * @param {String} whichTool + * @param {string} whichTool * The tool the key belongs to. The corresponding handler will only be triggered * if this tool is active. */ @@ -2315,8 +2315,8 @@ Toolbox.prototype = { * needs to know when the picker is active or not. * This method communicates with the RDM Manager if it exists. * - * @param {Boolean} state - * @param {String} pickerType + * @param {boolean} state + * @param {string} pickerType * One of devtools/shared/picker-constants */ async tellRDMAboutPickerState(state, pickerType) { @@ -2361,7 +2361,7 @@ Toolbox.prototype = { * Get the tooltip for the element picker button. * It has multiple possible keyboard shortcuts for macOS. * - * @return {String} + * @return {string} */ _getPickerTooltip() { let shortcut = L10N.getStr("toolbox.elementPicker.key"); @@ -2432,9 +2432,9 @@ Toolbox.prototype = { * changes. * This is used to communicate the new setting's value to the server. * - * @param {String} subject - * @param {String} topic - * @param {String} prefName + * @param {string} subject + * @param {string} topic + * @param {string} prefName * The preference name which changed */ async _onBooleanConfigurationPrefChange(subject, topic, prefName) { @@ -2709,10 +2709,10 @@ Toolbox.prototype = { /** * Register an extension sidebar for the inspector panel. * - * @param {String} id + * @param {string} id * An unique sidebar id - * @param {Object} options - * @param {String} options.title + * @param {object} options + * @param {string} options.title * A title for the sidebar */ async registerInspectorExtensionSidebar(id, options) { @@ -2736,7 +2736,7 @@ Toolbox.prototype = { /** * Unregister an extension sidebar for the inspector panel. * - * @param {String} id + * @param {string} id * An unique sidebar id */ unregisterInspectorExtensionSidebar(id) { @@ -2794,7 +2794,7 @@ Toolbox.prototype = { * * @param {string} id * The id of the tool to load. - * @param {Object} options + * @param {object} options * Object that will be passed to the panel `open` method. */ loadTool(id, options) { @@ -3026,7 +3026,7 @@ Toolbox.prototype = { * The id of the tool to switch to * @param {string} reason * Reason the tool was opened - * @param {Object} options + * @param {object} options * Object that will be passed to the panel */ selectTool(id, reason = "unknown", options) { @@ -3525,8 +3525,8 @@ Toolbox.prototype = { * For a given URL, return its pathname. * This is handy for Web Extension as it should be the addon ID. * - * @param {String} url - * @return {String} pathname + * @param {string} url + * @return {string} pathname */ getExtensionPathName(url) { const parsedURL = URL.parse(url); @@ -3663,7 +3663,7 @@ Toolbox.prototype = { /** * Called by the iframe picker when the user selected a frame. * - * @param {String} frameIdOrTargetActorId + * @param {string} frameIdOrTargetActorId */ onIframePickerFrameSelected(frameIdOrTargetActorId) { if (!this.frameMap.has(frameIdOrTargetActorId)) { @@ -3691,7 +3691,7 @@ Toolbox.prototype = { /** * Highlight a frame in the page * - * @param {String} frameIdOrTargetActorId + * @param {string} frameIdOrTargetActorId */ async onHighlightFrame(frameIdOrTargetActorId) { // Only enable frame highlighting when the top level document is targeted @@ -3721,19 +3721,19 @@ Toolbox.prototype = { /** * Handles changes in document frames. * - * @param {Object} data - * @param {Boolean} data.destroyAll: All frames have been destroyed. - * @param {Number} data.selected: A frame has been selected - * @param {Object} data.frameData: Some frame data were updated - * @param {String} data.frameData.url: new frame URL (it might have been blank or about:blank) - * @param {String} data.frameData.title: new frame title - * @param {Number|String} data.frameData.id: frame ID / targetFront actorID when EFT is enabled. - * @param {Array<Object>} data.frames: List of frames. Every frame can have: - * @param {Number|String} data.frames[].id: frame ID / targetFront actorID when EFT is enabled. - * @param {String} data.frames[].url: frame URL - * @param {String} data.frames[].title: frame title - * @param {Boolean} data.frames[].destroy: Set to true if destroyed - * @param {Boolean} data.frames[].isTopLevel: true for top level window + * @param {object} data + * @param {boolean} data.destroyAll: All frames have been destroyed. + * @param {number} data.selected: A frame has been selected + * @param {object} data.frameData: Some frame data were updated + * @param {string} data.frameData.url: new frame URL (it might have been blank or about:blank) + * @param {string} data.frameData.title: new frame title + * @param {number | string} data.frameData.id: frame ID / targetFront actorID when EFT is enabled. + * @param {Array<object>} data.frames: List of frames. Every frame can have: + * @param {number | string} data.frames[].id: frame ID / targetFront actorID when EFT is enabled. + * @param {string} data.frames[].url: frame URL + * @param {string} data.frames[].title: frame title + * @param {boolean} data.frames[].destroy: Set to true if destroyed + * @param {boolean} data.frames[].isTopLevel: true for top level window */ _updateFrames(data) { // At the moment, frames `id` can either be outerWindowID (a Number), @@ -3892,7 +3892,7 @@ Toolbox.prototype = { * This is used when we move a toolbox to a new popup opened by the tab we were currently debugging. * We also move the toolbox back to the original tab we were debugging if we select it via Firefox tabs. * - * @param {String} tabBrowsingContextID + * @param {string} tabBrowsingContextID * The BrowsingContext ID of the tab we want to move to. * @returns {Promise<undefined>} * This will resolve only once we moved to the new tab. @@ -3931,7 +3931,7 @@ Toolbox.prototype = { * This fires when the toolbox itself requests to be moved to another tab, * but also when we select the original tab where the toolbox originally was. * - * @param {String} browsingContextID + * @param {string} browsingContextID * The BrowsingContext ID of the tab the toolbox has been moved to. */ _onSwitchedHostToTab(browsingContextID) { @@ -4093,7 +4093,7 @@ Toolbox.prototype = { * higligher show and hide events. The event helpers are used in tests where it is * cumbersome to load the Inspector panel in order to listen to highlighter events. * - * @returns {Object} an object of the following shape: + * @returns {object} an object of the following shape: * - {AsyncFunction} highlight: A function that will show a Box Model Highlighter * for the provided NodeFront or node grip. * - {AsyncFunction} unhighlight: A function that will hide any Box Model Highlighter @@ -4112,7 +4112,7 @@ Toolbox.prototype = { /** * Return a promise wich resolves with a reference to the Inspector panel. * - * @param {Object} options: Options that will be passed to the inspector initialization + * @param {object} options: Options that will be passed to the inspector initialization */ const _getInspector = async options => { const inspector = this.getPanel("inspector"); @@ -4126,7 +4126,7 @@ Toolbox.prototype = { /** * Returns a promise which resolves when a Box Model Highlighter emits the given event * - * @param {String} eventName + * @param {string} eventName * Name of the event to listen to. * @return {Promise} * Promise which resolves when the highlighter event occurs. @@ -4555,8 +4555,8 @@ Toolbox.prototype = { * Panels in the toolbox can call this on contextmenu events with event.screenX/Y * instead of having to implement their own copy/paste/selectAll menu. * - * @param {Number} x - * @param {Number} y + * @param {number} x + * @param {number} y */ openTextBoxContextMenu(x, y) { const menu = createEditContextMenu(this.topWindow, "toolbox-menu"); @@ -4812,7 +4812,7 @@ Toolbox.prototype = { /** * Add listener for `onRequestFinished` events. * - * @param {Object} listener + * @param {object} listener * The listener to be called it's expected to be * a function that takes ({harEntry, requestId}) * as first argument. @@ -4843,7 +4843,7 @@ Toolbox.prototype = { * Used to lazily fetch HTTP response content within * `onRequestFinished` event listener. * - * @param {String} requestId + * @param {string} requestId * Id of the request for which the response content * should be fetched. */ @@ -4919,7 +4919,7 @@ Toolbox.prototype = { * the permitted length of event telemetry property values and what we actually * want to see in our telemetry. * - * @param {String} id + * @param {string} id * The panel id we would like to process. */ getTelemetryPanelNameOrOther(id) { @@ -5060,7 +5060,7 @@ Toolbox.prototype = { /** * Set the number of errors in the toolbar icon. * - * @param {Number} count + * @param {number} count */ setErrorCount(count) { // Don't re-render if the number of errors changed diff --git a/devtools/client/fronts/accessibility.js b/devtools/client/fronts/accessibility.js @@ -294,7 +294,7 @@ class AccessibleWalkerFront extends FrontClassWithSpec(accessibleWalkerSpec) { * Get the accessible object ancestry starting from the given accessible to * the top level document. The top level document is in the top level content process. * - * @param {Object} accessible + * @param {object} accessible * Accessible front to determine the ancestry for. * * @return {Array} ancestry @@ -348,7 +348,7 @@ class AccessibleWalkerFront extends FrontClassWithSpec(accessibleWalkerSpec) { * relative ancestries of audited accessible objects all the way up to the top * level document for the toolbox. * - * @param {Object} options + * @param {object} options * - {Array} types * types of the accessibility issues to audit for * - {Function} onProgress @@ -425,10 +425,10 @@ class AccessibleWalkerFront extends FrontClassWithSpec(accessibleWalkerSpec) { * The only additional work done is resolving domnode front from a * ContentDOMReference received from a remote target. * - * @param {Object} startElm + * @param {object} startElm * domnode front to be used as the starting point for generating the * tabbing order. - * @param {Number} startIndex + * @param {number} startIndex * Starting index for the tabbing order. */ async _showTabbingOrder(startElm, startIndex) { @@ -451,10 +451,10 @@ class AccessibleWalkerFront extends FrontClassWithSpec(accessibleWalkerSpec) { /** * Show tabbing order overlay for a given target. * - * @param {Object} startElm + * @param {object} startElm * domnode front to be used as the starting point for generating the * tabbing order. - * @param {Number} startIndex + * @param {number} startIndex * Starting index for the tabbing order. * * @return {JSON} diff --git a/devtools/client/fronts/css-properties.js b/devtools/client/fronts/css-properties.js @@ -62,9 +62,9 @@ class CssPropertiesFront extends FrontClassWithSpec(cssPropertiesSpec) { * Prototype functions are bound to 'this' so they can be passed around as helper * functions. * - * @param {Object} db + * @param {object} db * A database of CSS properties - * @param {Object} inheritedList + * @param {object} inheritedList * The key is the property name, the value is whether or not * that property is inherited. */ @@ -81,8 +81,8 @@ CssProperties.prototype = { * Checks to see if the property is known by the browser. This function has * `this` already bound so that it can be passed around by reference. * - * @param {String} property The property name to be checked. - * @return {Boolean} + * @param {string} property The property name to be checked. + * @return {boolean} */ isKnown(property) { // Custom Property Names (aka CSS Variables) are case-sensitive; do not lowercase. @@ -93,8 +93,8 @@ CssProperties.prototype = { /** * Checks to see if the property is an inherited one. * - * @param {String} property The property name to be checked. - * @return {Boolean} + * @param {string} property The property name to be checked. + * @return {boolean} */ isInherited(property) { return this.properties[property]?.isInherited; @@ -103,9 +103,9 @@ CssProperties.prototype = { /** * Checks if the property supports the given CSS type. * - * @param {String} property The property to be checked. - * @param {String} type One of the values from InspectorPropertyType. - * @return {Boolean} + * @param {string} property The property to be checked. + * @param {string} type One of the values from InspectorPropertyType. + * @return {boolean} */ supportsType(property, type) { const id = CSS_TYPES[type]; @@ -119,7 +119,7 @@ CssProperties.prototype = { /** * Gets the CSS values for a given property name. * - * @param {String} property The property to use. + * @param {string} property The property to use. * @return {Array} An array of strings. */ getValues(property) { @@ -141,7 +141,7 @@ CssProperties.prototype = { * the property is not a shorthand property, then array containing * just the property itself is returned. * - * @param {String} name The property to query + * @param {string} name The property to query * @return {Array} An array of subproperty names. */ getSubproperties(name) { @@ -162,7 +162,7 @@ CssProperties.prototype = { * same shape or have all of the data we need. This normalizes the data and fills in * any missing information like color values. * - * @return {Object} The normalized CSS database. + * @return {object} The normalized CSS database. */ function normalizeCssData(db) { // If there is a `from` attributes, it means that it comes from RDP @@ -179,7 +179,7 @@ function normalizeCssData(db) { /** * Color values are omitted to save on space. Add them back here. * - * @param {Object} The CSS database. + * @param {object} The CSS database. */ function reattachCssColorValues(db) { if (db.properties.color.values[0] === "COLOR") { diff --git a/devtools/client/fronts/inspector.js b/devtools/client/fronts/inspector.js @@ -173,7 +173,7 @@ class InspectorFront extends FrontClassWithSpec(inspectorSpec) { * comes in before that promise is resolved, wait for it to resolve and return the * highlighter instance it resolved with instead of creating a new request. * - * @param {String} type + * @param {string} type * Highlighter type * @return {Promise} * Promise which resolves with a highlighter instance of the given type @@ -243,7 +243,7 @@ class InspectorFront extends FrontClassWithSpec(inspectorSpec) { /** * Given a node grip, return a NodeFront on the right context. * - * @param {Object} grip: The node grip. + * @param {object} grip: The node grip. * @returns {Promise<NodeFront|null>} A promise that resolves with a NodeFront or null * if the NodeFront couldn't be created/retrieved. */ diff --git a/devtools/client/fronts/inspector/rule-rewriter.js b/devtools/client/fronts/inspector/rule-rewriter.js @@ -79,7 +79,7 @@ class RuleRewriter { * @param {StyleRuleFront} rule The style rule to use. Note that this * is only needed by the |apply| and |getDefaultIndentation| methods; * and in particular for testing it can be |null|. - * @param {String} inputString The CSS source text to parse and modify. + * @param {string} inputString The CSS source text to parse and modify. */ constructor(win, isCssPropertyKnown, rule, inputString) { this.win = win; @@ -111,7 +111,7 @@ class RuleRewriter { * An internal function to initialize the rewriter with a given * input string. * - * @param {String} inputString the input to use + * @param {string} inputString the input to use */ startInitialization(inputString) { this.inputString = inputString; @@ -131,7 +131,7 @@ class RuleRewriter { * An internal function to complete initialization and set some * properties for further processing. * - * @param {Number} index The index of the property to modify + * @param {number} index The index of the property to modify */ completeInitialization(index) { if (index < 0) { @@ -155,9 +155,9 @@ class RuleRewriter { * unlike |getDefaultIndentation|, which examines the entire style * sheet. * - * @param {String} string the input text - * @param {Number} offset the offset at which to compute the indentation - * @return {String} the indentation at the indicated position + * @param {string} string the input text + * @param {number} offset the offset at which to compute the indentation + * @return {string} the indentation at the indicated position */ getIndentation(string, offset) { let originalOffset = offset; @@ -185,7 +185,7 @@ class RuleRewriter { * sheet will not cause unwanted changes to other rules or * declarations. * - * @param {String} text The input text. This should include the trailing ";". + * @param {string} text The input text. This should include the trailing ";". * @return {Array} An array of the form [anySanitized, text], where * |anySanitized| is a boolean that indicates * whether anything substantive has changed; and @@ -311,9 +311,9 @@ class RuleRewriter { * non-whitespace character, or -1 if the entire string was * whitespace. * - * @param {String} string the input string - * @param {Number} index the index at which to start - * @return {Number} index of the first non-whitespace character, or -1 + * @param {string} string the input string + * @param {number} index the index at which to start + * @return {number} index of the first non-whitespace character, or -1 */ skipWhitespaceBackward(string, index) { for ( @@ -329,7 +329,7 @@ class RuleRewriter { /** * Terminate a given declaration, if needed. * - * @param {Number} index The index of the rule to possibly + * @param {number} index The index of the rule to possibly * terminate. It might be invalid, so this * function must check for that. */ @@ -380,9 +380,9 @@ class RuleRewriter { * If the property is rewritten during sanitization, make a note in * |changedDeclarations|. * - * @param {String} text The property text. - * @param {Number} index The index of the property. - * @return {String} The sanitized text. + * @param {string} text The property text. + * @param {number} index The index of the property. + * @return {string} The sanitized text. */ sanitizeText(text, index) { const [anySanitized, sanitizedText] = this.sanitizePropertyValue(text); @@ -395,9 +395,9 @@ class RuleRewriter { /** * Rename a declaration. * - * @param {Number} index index of the property in the rule. - * @param {String} name current name of the property - * @param {String} newName new name of the property + * @param {number} index index of the property in the rule. + * @param {string} name current name of the property + * @param {string} newName new name of the property */ renameProperty(index, name, newName) { this.completeInitialization(index); @@ -411,9 +411,9 @@ class RuleRewriter { /** * Enable or disable a declaration * - * @param {Number} index index of the property in the rule. - * @param {String} name current name of the property - * @param {Boolean} isEnabled true if the property should be enabled; + * @param {number} index index of the property in the rule. + * @param {string} name current name of the property + * @param {boolean} isEnabled true if the property should be enabled; * false if it should be disabled */ setPropertyEnabled(index, name, isEnabled) { @@ -533,12 +533,12 @@ class RuleRewriter { * An internal function to create a new declaration. This does all * the work of |createProperty|. * - * @param {Number} index index of the property in the rule. - * @param {String} name name of the new property - * @param {String} value value of the new property - * @param {String} priority priority of the new property; either + * @param {number} index index of the property in the rule. + * @param {string} name name of the new property + * @param {string} value value of the new property + * @param {string} priority priority of the new property; either * the empty string or "important" - * @param {Boolean} enabled True if the new property should be + * @param {boolean} enabled True if the new property should be * enabled, false if disabled * @return {Promise} a promise that is resolved when the edit has * completed @@ -654,12 +654,12 @@ class RuleRewriter { /** * Create a new declaration. * - * @param {Number} index index of the property in the rule. - * @param {String} name name of the new property - * @param {String} value value of the new property - * @param {String} priority priority of the new property; either + * @param {number} index index of the property in the rule. + * @param {string} name name of the new property + * @param {string} value value of the new property + * @param {string} priority priority of the new property; either * the empty string or "important" - * @param {Boolean} enabled True if the new property should be + * @param {boolean} enabled True if the new property should be * enabled, false if disabled */ createProperty(index, name, value, priority, enabled) { @@ -679,14 +679,14 @@ class RuleRewriter { /** * Set a declaration's value. * - * @param {Number} index index of the property in the rule. + * @param {number} index index of the property in the rule. * This can be -1 in the case where * the rule does not support setRuleText; * generally for setting properties * on an element's style. - * @param {String} name the property's name - * @param {String} value the property's value - * @param {String} priority the property's priority, either the empty + * @param {string} name the property's name + * @param {string} value the property's value + * @param {string} priority the property's priority, either the empty * string or "important" */ setProperty(index, name, value, priority) { @@ -717,8 +717,8 @@ class RuleRewriter { /** * Remove a declaration. * - * @param {Number} index index of the property in the rule. - * @param {String} name the name of the property to remove + * @param {number} index index of the property in the rule. + * @param {string} name the name of the property to remove */ removeProperty(index, name) { this.completeInitialization(index); @@ -770,7 +770,7 @@ class RuleRewriter { * An internal function to copy any trailing text to the output * string. * - * @param {Number} copyOffset Offset into |inputString| of the + * @param {number} copyOffset Offset into |inputString| of the * final text to copy to the output string. */ completeCopying(copyOffset) { diff --git a/devtools/client/fronts/memory.js b/devtools/client/fronts/memory.js @@ -41,7 +41,7 @@ class MemoryFront extends FrontClassWithSpec(memorySpec) { * Always force a bulk data copy of the saved heap snapshot, even when * the server and client share a file system. * - * @params {Object|undefined} options.boundaries + * @params {object | undefined} options.boundaries * The boundaries for the heap snapshot. See * ChromeUtils.webidl for more details. * @@ -65,7 +65,7 @@ class MemoryFront extends FrontClassWithSpec(memorySpec) { * heap snapshot file to the client. The path to the client's local file is * returned. * - * @param {String} snapshotId + * @param {string} snapshotId * * @returns Promise<String> */ diff --git a/devtools/client/fronts/object.js b/devtools/client/fronts/object.js @@ -339,10 +339,10 @@ class ObjectFront extends FrontClassWithSpec(objectSpec) { * In the case an ObjectFront is created, we also check if the object has properties * that should be turned into fronts as well. * - * @param {String|Number|Object} options: The packet returned by the server. + * @param {string | number | object} options: The packet returned by the server. * @param {Front} parentFront * - * @returns {Number|String|Object|LongStringFront|ObjectFront} + * @returns {number | string | object | LongStringFront | ObjectFront} */ function getAdHocFrontOrPrimitiveGrip(packet, parentFront) { // We only want to try to create a front when it makes sense, i.e when it has an @@ -425,7 +425,7 @@ function getAdHocFrontOrPrimitiveGrip(packet, parentFront) { * values, …). * * @param {ObjectFront} objectFront - * @param {String|Number|Object} packet: The packet returned by the server + * @param {string | number | object} packet: The packet returned by the server */ function createChildFronts(objectFront, packet) { if (packet.preview) { diff --git a/devtools/client/fronts/page-style.js b/devtools/client/fronts/page-style.js @@ -75,11 +75,11 @@ class PageStyleFront extends FrontClassWithSpec(pageStyleSpec) { /** * Get an array of existing attribute values in a node document, given an attribute type. * - * @param {String} search: A string to filter attribute value on. - * @param {String} attributeType: The type of attribute we want to retrieve the values. + * @param {string} search: A string to filter attribute value on. + * @param {string} attributeType: The type of attribute we want to retrieve the values. * @param {Element} node: The element we want to get possible attributes for. This will * be used to get the document where the search is happening. - * @returns {Array<String>} An array of strings + * @returns {Array<string>} An array of strings */ async getAttributesInOwnerDocument(search, attributeType, node) { if (!attributeType) { diff --git a/devtools/client/fronts/root.js b/devtools/client/fronts/root.js @@ -52,7 +52,7 @@ class RootFront extends FrontClassWithSpec(rootSpec) { * @param {Array} [workerTargets] (optional) * Array containing the result of a call to `listAllWorkerTargets`. * (this exists to avoid duplication of calls to that method) - * @return {Object[]} result - An Array of Objects with the following format + * @return {object[]} result - An Array of Objects with the following format * - {result[].registration} - The registration front * - {result[].workers} Array of form-like objects for service workers */ @@ -107,7 +107,7 @@ class RootFront extends FrontClassWithSpec(rootSpec) { * unified array of serviceWorkers. If you are only interested in other workers, use * listWorkers. * - * @return {Object} + * @return {object} * - {Array} service * array of form-like objects for serviceworkers * - {Array} shared @@ -322,10 +322,10 @@ class RootFront extends FrontClassWithSpec(rootSpec) { * This function returns true if the root actor has a registered global actor * with a given name. * - * @param {String} actorName + * @param {string} actorName * The name of a global actor. * - * @return {Boolean} + * @return {boolean} */ async hasActor(actorName) { const rootForm = await this.rootForm; diff --git a/devtools/client/fronts/style-rule.js b/devtools/client/fronts/style-rule.js @@ -109,7 +109,7 @@ class StyleRuleFront extends FrontClassWithSpec(styleRuleSpec) { * This is used for the selector highlighter, where we need to know what's * being highlighted. * - * @returns {String} + * @returns {string} */ get computedSelector() { let selector = ""; @@ -239,14 +239,14 @@ class RuleModificationList { /** * Add a "set" entry to the modification list. * - * @param {Number} index index of the property in the rule. + * @param {number} index index of the property in the rule. * This can be -1 in the case where * the rule does not support setRuleText; * generally for setting properties * on an element's style. - * @param {String} name the property's name - * @param {String} value the property's value - * @param {String} priority the property's priority, either the empty + * @param {string} name the property's name + * @param {string} value the property's value + * @param {string} priority the property's priority, either the empty * string or "important" */ setProperty(index, name, value, priority) { @@ -256,12 +256,12 @@ class RuleModificationList { /** * Add a "remove" entry to the modification list. * - * @param {Number} index index of the property in the rule. + * @param {number} index index of the property in the rule. * This can be -1 in the case where * the rule does not support setRuleText; * generally for setting properties * on an element's style. - * @param {String} name the name of the property to remove + * @param {string} name the name of the property to remove */ removeProperty(index, name) { this.modifications.push({ type: "remove", index, name }); @@ -271,17 +271,17 @@ class RuleModificationList { * Rename a property. This implementation acts like * |removeProperty|, because |setRuleText| is not available. * - * @param {Number} index index of the property in the rule. + * @param {number} index index of the property in the rule. * This can be -1 in the case where * the rule does not support setRuleText; * generally for setting properties * on an element's style. - * @param {String} name current name of the property + * @param {string} name current name of the property * * This parameter is also passed, but as it is not used in this * implementation, it is omitted. It is documented here as this * code also defined the interface implemented by @see RuleRewriter. - * @param {String} newName new name of the property + * @param {string} newName new name of the property */ renameProperty(index, name) { this.removeProperty(index, name); @@ -291,13 +291,13 @@ class RuleModificationList { * Enable or disable a property. This implementation acts like * a no-op when enabling, because |setRuleText| is not available. * - * @param {Number} index index of the property in the rule. + * @param {number} index index of the property in the rule. * This can be -1 in the case where * the rule does not support setRuleText; * generally for setting properties * on an element's style. - * @param {String} name current name of the property - * @param {Boolean} isEnabled true if the property should be enabled; + * @param {string} name current name of the property + * @param {boolean} isEnabled true if the property should be enabled; * false if it should be disabled */ setPropertyEnabled(index, name, isEnabled) { @@ -315,16 +315,16 @@ class RuleModificationList { * this code also defined the interface implemented by @see * RuleRewriter. * - * @param {Number} index index of the property in the rule. + * @param {number} index index of the property in the rule. * This can be -1 in the case where * the rule does not support setRuleText; * generally for setting properties * on an element's style. - * @param {String} name name of the new property - * @param {String} value value of the new property - * @param {String} priority priority of the new property; either + * @param {string} name name of the new property + * @param {string} value value of the new property + * @param {string} priority priority of the new property; either * the empty string or "important" - * @param {Boolean} enabled True if the new property should be + * @param {boolean} enabled True if the new property should be * enabled, false if disabled */ createProperty() { diff --git a/devtools/client/fronts/targets/target-mixin.js b/devtools/client/fronts/targets/target-mixin.js @@ -197,8 +197,8 @@ function TargetMixin(parentClass) { * Returns a boolean indicating whether or not the specific actor * type exists. * - * @param {String} actorName - * @return {Boolean} + * @param {string} actorName + * @return {boolean} */ hasActor(actorName) { if (this.targetForm) { @@ -211,7 +211,7 @@ function TargetMixin(parentClass) { * Returns a trait from the target actor if it exists, * if not it will fallback to that on the root actor. * - * @param {String} traitName + * @param {string} traitName * @return {Mixed} */ getTrait(traitName) { @@ -500,7 +500,7 @@ function TargetMixin(parentClass) { * * @param {Error} e * The real error object. - * @param {String} targetType + * @param {string} targetType * The type of the target front ("worker", "browsing-context", ...) */ logDetachError(e, targetType) { @@ -554,9 +554,9 @@ function TargetMixin(parentClass) { /** * Log an error of some kind to the tab's console. * - * @param {String} text + * @param {string} text * The text to log. - * @param {String} category + * @param {string} category * The category of the message. @see nsIScriptError. * @returns {Promise} */ @@ -571,9 +571,9 @@ function TargetMixin(parentClass) { /** * Log a warning of some kind to the tab's console. * - * @param {String} text + * @param {string} text * The text to log. - * @param {String} category + * @param {string} category * The category of the message. @see nsIScriptError. * @returns {Promise} */ diff --git a/devtools/client/fronts/walker.js b/devtools/client/fronts/walker.js @@ -437,7 +437,7 @@ class WalkerFront extends FrontClassWithSpec(walkerSpec) { /** * Start the element picker on the debuggee target. * - * @param {Boolean} doFocus - Optionally focus the content area once the picker is + * @param {boolean} doFocus - Optionally focus the content area once the picker is * activated. */ pick(doFocus) { diff --git a/devtools/client/inspector/animation/animation.js b/devtools/client/inspector/animation/animation.js @@ -222,7 +222,7 @@ class AnimationInspector { /** * This function calls AnimationsFront.setCurrentTimes with considering the createdTime. * - * @param {Number} currentTime + * @param {number} currentTime */ async doSetCurrentTimes(currentTime) { const { animations, timeScale } = this.state; @@ -235,7 +235,7 @@ class AnimationInspector { /** * Return a map of animated property from given animation actor. * - * @param {Object} animation + * @param {object} animation * @return {Map} A map of animated property * key: {String} Animated property name * value: {Array} Array of keyframe object @@ -273,11 +273,11 @@ class AnimationInspector { * Return the computed style of the specified property after setting the given styles * to the simulated element. * - * @param {String} property + * @param {string} property * CSS property name (e.g. text-align). - * @param {Object} styles + * @param {object} styles * Map of CSS property name and value. - * @return {String} + * @return {string} * Computed style of property. */ getComputedStyle(property, styles) { @@ -323,7 +323,7 @@ class AnimationInspector { * Then, dispatches the current time to listeners that are registered * by addAnimationsCurrentTimeListener. * - * @param {Number} currentTime + * @param {number} currentTime */ onAnimationsCurrentTimeUpdated(currentTime) { this.currentTime = currentTime; @@ -336,7 +336,7 @@ class AnimationInspector { /** * This method is called when the current time proceed by CurrentTimeTimer. * - * @param {Number} currentTime + * @param {number} currentTime * @param {Bool} shouldStop */ onCurrentTimeTimerUpdated(currentTime, shouldStop) { @@ -629,9 +629,9 @@ class AnimationInspector { * * @param {Array} keyframes * e.g. [{ opacity: 0 }, { opacity: 1 }] - * @param {Object} effectTiming + * @param {object} effectTiming * e.g. { duration: 1000, fill: "both" } - * @param {Boolean} isElementNeeded + * @param {boolean} isElementNeeded * true: create animation with an element. * If want to know computed value of the element, turn on. * false: create animation without an element, @@ -677,7 +677,7 @@ class AnimationInspector { * The returned animation is implementing Animation interface of Web Animation API. * https://drafts.csswg.org/web-animations/#the-animation-interface * - * @param {Object} effectTiming + * @param {object} effectTiming * e.g. { duration: 1000, fill: "both" } * @return {Animation} * https://drafts.csswg.org/web-animations/#the-animation-interface diff --git a/devtools/client/inspector/animation/components/CurrentTimeLabel.js b/devtools/client/inspector/animation/components/CurrentTimeLabel.js @@ -53,8 +53,8 @@ class CurrentTimeLabel extends PureComponent { /** * Format a timestamp (in ms) as a mm:ss.mmm string. * - * @param {Number} time - * @return {String} + * @param {number} time + * @return {string} */ function formatStopwatchTime(time) { // Format falsy values as 0 diff --git a/devtools/client/inspector/animation/components/graph/SummaryGraphPath.js b/devtools/client/inspector/animation/components/graph/SummaryGraphPath.js @@ -146,7 +146,7 @@ class SummaryGraphPath extends Component { * * @param {Array} keyframes1 * @param {Array} keyframes2 - * @return {Boolean} true: equals + * @return {boolean} true: equals */ isOffsetAndEasingKeyframesEqual(keyframes1, keyframes2) { if (keyframes1.length !== keyframes2.length) { diff --git a/devtools/client/inspector/animation/components/graph/TimingPath.js b/devtools/client/inspector/animation/components/graph/TimingPath.js @@ -17,7 +17,7 @@ class TimingPath extends PureComponent { /** * Render a graph of given parameters and return as <path> element list. * - * @param {Object} state + * @param {object} state * State of animation. * @param {SummaryGraphHelper} helper * Instance of SummaryGraphHelper. @@ -148,7 +148,7 @@ class TimingPath extends PureComponent { * * @param {Array} pathList * Add rendered <path> element to this array. - * @param {Object} state + * @param {object} state * State of animation. * @param {SummaryGraphHelper} helper * Instance of SummaryGraphHelper. @@ -171,11 +171,11 @@ class TimingPath extends PureComponent { * * @param {Array} pathList * Add rendered <path> element to this array. - * @param {Object} state + * @param {object} state * State of animation. - * @param {Number} mainIterationStartTime + * @param {number} mainIterationStartTime * Start time of main iteration. - * @param {Number} firstSectionCount + * @param {number} firstSectionCount * Iteration count of first section. * @param {SummaryGraphHelper} helper * Instance of SummaryGraphHelper. @@ -203,13 +203,13 @@ class TimingPath extends PureComponent { * * @param {Array} pathList * Add rendered <path> elements to this array. - * @param {Object} state + * @param {object} state * State of animation. - * @param {Number} mainIterationStartTime + * @param {number} mainIterationStartTime * Starting time of main iteration. - * @param {Number} firstSectionCount + * @param {number} firstSectionCount * Iteration count of first section. - * @param {Number} middleSectionCount + * @param {number} middleSectionCount * Iteration count of middle section. * @param {SummaryGraphHelper} helper * Instance of SummaryGraphHelper. @@ -243,15 +243,15 @@ class TimingPath extends PureComponent { * * @param {Array} pathList * Add rendered <path> elements to this array. - * @param {Object} state + * @param {object} state * State of animation. - * @param {Number} mainIterationStartTime + * @param {number} mainIterationStartTime * Starting time of main iteration. - * @param {Number} firstSectionCount + * @param {number} firstSectionCount * Iteration count of first section. - * @param {Number} middleSectionCount + * @param {number} middleSectionCount * Iteration count of middle section. - * @param {Number} lastSectionCount + * @param {number} lastSectionCount * Iteration count of last section. * @param {SummaryGraphHelper} helper * Instance of SummaryGraphHelper. @@ -283,11 +283,11 @@ class TimingPath extends PureComponent { * * @param {Array} pathList * Add rendered <path> elements to this array. - * @param {Object} state + * @param {object} state * State of animation. - * @param {Number} mainIterationStartTime + * @param {number} mainIterationStartTime * Starting time of main iteration. - * @param {Number} firstSectionCount + * @param {number} firstSectionCount * Iteration count of first section. * @param {SummaryGraphHelper} helper * Instance of SummaryGraphHelper. @@ -359,9 +359,9 @@ class TimingPath extends PureComponent { * * @param {Array} pathList * Add rendered <path> elements to this array. - * @param {Object} state + * @param {object} state * State of animation. - * @param {Number} mainIterationStartTime + * @param {number} mainIterationStartTime * Starting time of main iteration. * @param {SummaryGraphHelper} helper * Instance of SummaryGraphHelper. @@ -383,11 +383,11 @@ class TimingPath extends PureComponent { * * @param {Array} pathList * Add rendered <path> element to this array. - * @param {Object} state + * @param {object} state * State of animation. - * @param {Number} mainIterationStartTime + * @param {number} mainIterationStartTime * Starting time of main iteration. - * @param {Number} iterationCount + * @param {number} iterationCount * Iteration count of whole animation. * @param {SummaryGraphHelper} helper * Instance of SummaryGraphHelper. @@ -416,11 +416,11 @@ class TimingPath extends PureComponent { * * @param {Array} pathList * Add rendered <path> element to this array. - * @param {Object} state + * @param {object} state * State of animation. - * @param {Number} mainIterationStartTime + * @param {number} mainIterationStartTime * Starting time of main iteration. - * @param {Number} iterationCount + * @param {number} iterationCount * Iteration count of whole animation. * @param {SummaryGraphHelper} helper * Instance of SummaryGraphHelper. diff --git a/devtools/client/inspector/animation/components/keyframes-graph/ColorPath.js b/devtools/client/inspector/animation/components/keyframes-graph/ColorPath.js @@ -143,10 +143,10 @@ class ColorPath extends ComputedStylePath { /** * Parse given RGBA string. * - * @param {String} propertyName - * @param {String} colorString + * @param {string} propertyName + * @param {string} colorString * e.g. rgb(0, 0, 0) or rgba(0, 0, 0, 0.5) and so on. - * @return {Object} + * @return {object} * RGBA {r: r, g: g, b: b, a: a}. */ function getRGBA(propertyName, colorString) { @@ -178,11 +178,11 @@ function getRGBA(propertyName, colorString) { /** * Return the distance from give two RGBA. * - * @param {Object} rgba1 + * @param {object} rgba1 * RGBA (format is same to getRGBA) - * @param {Object} rgba2 + * @param {object} rgba2 * RGBA (format is same to getRGBA) - * @return {Number} + * @return {number} * The range is 0 - 1.0. */ function getRGBADistance(rgba1, rgba2) { diff --git a/devtools/client/inspector/animation/components/keyframes-graph/ComputedStylePath.js b/devtools/client/inspector/animation/components/keyframes-graph/ComputedStylePath.js @@ -24,13 +24,13 @@ const { * getPropertyName() * Returns property name which will be animated. * - * @return {String} + * @return {string} * e.g. opacity * * getPropertyValue(keyframe) * Returns value which uses as animated keyframe value from given parameter. * - * @param {Object} keyframe + * @param {object} keyframe * @return {String||Number} * e.g. 0 * @@ -39,7 +39,7 @@ const { * * @param {String||Number} * e.g. 0 - * @return {Number} + * @return {number} * e.g. 0 (should be 0 - 1.0) */ class ComputedStylePath extends PureComponent { @@ -58,9 +58,9 @@ class ComputedStylePath extends PureComponent { * Return an array containing the path segments between the given start and * end keyframe values. * - * @param {Object} startKeyframe + * @param {object} startKeyframe * Starting keyframe. - * @param {Object} endKeyframe + * @param {object} endKeyframe * Ending keyframe. * @return {Array} * Array of path segment. @@ -209,7 +209,7 @@ class ComputedStylePath extends PureComponent { * Return react dom fron given path segments. * * @param {Array} segments - * @param {Object} style + * @param {object} style * @return {Element} */ renderPathSegments(segments, style) { @@ -230,9 +230,9 @@ class ComputedStylePath extends PureComponent { /** * Convert given CSS property name to JavaScript CSS name. * - * @param {String} cssPropertyName + * @param {string} cssPropertyName * CSS property name (e.g. background-color). - * @return {String} + * @return {string} * JavaScript CSS property name (e.g. backgroundColor). */ function getJsPropertyName(cssPropertyName) { diff --git a/devtools/client/inspector/animation/current-time-timer.js b/devtools/client/inspector/animation/current-time-timer.js @@ -14,7 +14,7 @@ class CurrentTimeTimer { /** * Constructor. * - * @param {Object} timeScale + * @param {object} timeScale * @param {Bool} shouldStopAfterEndTime * If need to stop the timer after animation end time, set true. * @param {window} win diff --git a/devtools/client/inspector/animation/test/browser_animation_indication-bar.js b/devtools/client/inspector/animation/test/browser_animation_indication-bar.js @@ -24,9 +24,9 @@ add_task(async function () { /** * Assert indication bar position. * - * @param {String} indicationBarSelector + * @param {string} indicationBarSelector * @param {Element} panel - * @param {Number} expectedPositionRate + * @param {number} expectedPositionRate */ function assertPosition(indicationBarSelector, panel, expectedPositionRate) { const barEl = panel.querySelector(indicationBarSelector); diff --git a/devtools/client/inspector/animation/test/head.js b/devtools/client/inspector/animation/test/head.js @@ -93,7 +93,7 @@ const removeAnimatedElementsExcept = function (selectors) { * @param {AnimationInspector} animationInspector. * @param {DOMElement} panel * #animation-container element. - * @param {Number} index + * @param {number} index * The index of the animation to click on. */ const clickOnAnimation = async function (animationInspector, panel, index) { @@ -111,7 +111,7 @@ const clickOnAnimation = async function (animationInspector, panel, index) { * @param {AnimationInspector} animationInspector. * @param {DOMElement} panel * #animation-container element. - * @param {String} selector + * @param {string} selector * Selector of node which is target element of animation. */ const clickOnAnimationByTargetSelector = async function ( @@ -182,7 +182,7 @@ const clickOnRewindButton = function (animationInspector, panel) { * * @param {DOMElement} panel * #animation-container element. - * @param {Number} mouseDownPosition + * @param {number} mouseDownPosition * rate on scrubber controller pane. * This method calculates * `mouseDownPosition * offsetWidth + offsetLeft of scrubber controller pane` @@ -213,7 +213,7 @@ const clickOnCurrentTimeScrubberController = function ( * @param {AnimationInspector} animationInspector. * @param {DOMElement} panel * #animation-container element. - * @param {Number} index + * @param {number} index * The index of the AnimationTargetComponent to click on. */ const clickOnInspectIcon = async function (animationInspector, panel, index) { @@ -234,7 +234,7 @@ const clickOnInspectIcon = async function (animationInspector, panel, index) { * @param {AnimationInspector} animationInspector * @param {DOMElement} panel * #animation-container element. - * @param {Number} rate + * @param {number} rate */ const changePlaybackRateSelector = async function ( animationInspector, @@ -296,7 +296,7 @@ const clickOnSummaryGraph = function ( * @param {AnimationInspector} animationInspector. * @param {DOMElement} panel * #animation-container element. - * @param {Number} index + * @param {number} index * The index of the AnimationTargetComponent to click on. */ const clickOnTargetNode = async function (animationInspector, panel, index) { @@ -355,9 +355,9 @@ const clickOnTargetNodeByTargetText = async function ( * * @param {DOMElement} panel * #animation-container element. - * @param {Number} mouseMovePixel + * @param {number} mouseMovePixel * Dispatch mousemove event with mouseMovePosition after mousedown. - * @param {Number} mouseYPixel + * @param {number} mouseYPixel * Y of mouse in pixel. */ const dragOnCurrentTimeScrubber = async function ( @@ -404,12 +404,12 @@ const dragOnCurrentTimeScrubber = async function ( * * @param {DOMElement} panel * #animation-container element. - * @param {Number} mouseDownPosition + * @param {number} mouseDownPosition * rate on scrubber controller pane. * This method calculates * `mouseDownPosition * offsetWidth + offsetLeft of scrubber controller pane` * as the clientX of MouseEvent. - * @param {Number} mouseMovePosition + * @param {number} mouseMovePosition * Dispatch mousemove event with mouseMovePosition after mousedown. * Calculation for clinetX is same to above. */ @@ -463,8 +463,8 @@ const dragOnCurrentTimeScrubberController = async function ( * @param {AnimationInspector} animationInspector * @param {DOMElement} panel * #animation-container element. - * @param {Number} pixels - * @return {Object} + * @param {number} pixels + * @return {object} * { * duration, * rate, @@ -485,7 +485,7 @@ const getDurationAndRate = function (animationInspector, panel, pixels) { * @param {AnimationInspector} animationInspector. * @param {DOMElement} panel * #animation-container element. - * @param {Number} index + * @param {number} index * The index of the AnimationTargetComponent to click on. */ const mouseOverOnTargetNode = function (animationInspector, panel, index) { @@ -501,7 +501,7 @@ const mouseOverOnTargetNode = function (animationInspector, panel, index) { * @param {AnimationInspector} animationInspector. * @param {DOMElement} panel * #animation-container element. - * @param {Number} index + * @param {number} index * The index of the AnimationTargetComponent to click on. */ const mouseOutOnTargetNode = function (animationInspector, panel, index) { @@ -538,8 +538,8 @@ const sendSpaceKeyEvent = function (animationInspector, element) { * Set a node class attribute to the given selector. * * @param {AnimationInspector} animationInspector - * @param {String} selector - * @param {String} cls + * @param {string} selector + * @param {string} cls * e.g. ".ball.still" */ const setClassAttribute = async function (animationInspector, selector, cls) { @@ -561,8 +561,8 @@ const setClassAttribute = async function (animationInspector, selector, cls) { * Set a new style properties to the node for the given selector. * * @param {AnimationInspector} animationInspector - * @param {String} selector - * @param {Object} properties + * @param {string} selector + * @param {object} properties * e.g. { * animationDuration: "1000ms", * animationTimingFunction: "linear", @@ -600,7 +600,7 @@ const setEffectTimingAndPlayback = async function ( /** * Set the sidebar width by given parameter. * - * @param {String} width + * @param {string} width * Change sidebar width by given parameter. * @param {InspectorPanel} inspector * The instance of InspectorPanel currently loaded in the toolbox @@ -616,10 +616,10 @@ const setSidebarWidth = async function (width, inspector) { * Set a new style property declaration to the node for the given selector. * * @param {AnimationInspector} animationInspector - * @param {String} selector - * @param {String} propertyName + * @param {string} selector + * @param {string} propertyName * e.g. "animationDuration" - * @param {String} propertyValue + * @param {string} propertyValue * e.g. "5.5s" */ const setStyle = async function ( @@ -646,8 +646,8 @@ const setStyle = async function ( * Set a new style properties to the node for the given selector. * * @param {AnimationInspector} animationInspector - * @param {String} selector - * @param {Object} properties + * @param {string} selector + * @param {object} properties * e.g. { * animationDuration: "1000ms", * animationTimingFunction: "linear", @@ -675,7 +675,7 @@ const setStyles = async function (animationInspector, selector, properties) { * Wait until current time of animations will be changed to given current time. * * @param {AnimationInspector} animationInspector - * @param {Number} currentTime + * @param {number} currentTime */ const waitUntilCurrentTimeChangedAt = async function ( animationInspector, @@ -693,7 +693,7 @@ const waitUntilCurrentTimeChangedAt = async function ( * Wait until animations' play state will be changed to given state. * * @param {Array} animationInspector - * @param {String} state + * @param {string} state */ const waitUntilAnimationsPlayState = async function ( animationInspector, @@ -710,7 +710,7 @@ const waitUntilAnimationsPlayState = async function ( * * @param {AnimationInspector} animationInspector * @param {DOMElement} panel - * @return {Number} count + * @return {number} count */ const getDisplayedGraphCount = (animationInspector, panel) => { const animationLength = animationInspector.state.animations.length; @@ -771,9 +771,9 @@ function assertAnimationsRunning(animationInspector) { * * @param {Element} linearGradientEl <linearGradient> element which has <stop> element. - * @param {Number} offset + * @param {number} offset * float which represents the "offset" attribute of <stop>. - * @param {String} expectedColor + * @param {string} expectedColor * e.g. rgb(0, 0, 255) */ function assertLinearGradient(linearGradientEl, offset, expectedColor) { @@ -794,7 +794,7 @@ function assertLinearGradient(linearGradientEl, offset, expectedColor) { * <path> element. * @param {boolean} hasClosePath * Set true if the path shoud be closing. - * @param {Object} expectedValues + * @param {object} expectedValues * JSON object format. We can test the vertex and color. * e.g. * [ @@ -875,7 +875,7 @@ function isPassingThrough(pathData, x, y) { * * @param {DOMElement} panel * #animation-container element. - * @param {Number} index + * @param {number} index * @return {DOMElement} * Animation item element. */ @@ -904,7 +904,7 @@ async function findAnimationItemByIndex(panel, index) { * * @param {DOMElement} panel * #animation-container element. - * @param {String} selector + * @param {string} selector * Selector of tested element. * @return {DOMElement} * Animation item element. @@ -963,7 +963,7 @@ async function findAnimationItemByTargetText(panel, targetText) { * * @param {Element} linearGradientEl * <linearGradient> element which has <stop> element. - * @param {Number} offset + * @param {number} offset * Float which represents the "offset" attribute of <stop>. * @return {Element} * If can't find suitable element, returns null. diff --git a/devtools/client/inspector/animation/utils/graph-helper.js b/devtools/client/inspector/animation/utils/graph-helper.js @@ -33,13 +33,13 @@ class SummaryGraphHelper { /** * Constructor. * - * @param {Object} state + * @param {object} state * State of animation. * @param {Array} keyframes * Array of keyframe. - * @param {Number} totalDuration + * @param {number} totalDuration * Total displayable duration. - * @param {Number} minSegmentDuration + * @param {number} minSegmentDuration * Minimum segment duration. * @param {Function} getValueFunc * Which returns graph value of given time. @@ -70,9 +70,9 @@ class SummaryGraphHelper { /** * Create the path segments from given parameters. * - * @param {Number} startTime + * @param {number} startTime * Starting time of animation. - * @param {Number} endTime + * @param {number} endTime * Ending time of animation. * @return {Array} * Array of path segment. @@ -92,8 +92,8 @@ class SummaryGraphHelper { /** * Return a coordinate as a graph segment at given time. * - * @param {Number} time - * @return {Object} + * @param {number} time + * @return {object} * { x: Number, y: Number } */ getSegment(time) { @@ -105,15 +105,15 @@ class SummaryGraphHelper { /** * Create the path segments from given parameters. * - * @param {Number} startTime + * @param {number} startTime * Starting time of animation. - * @param {Number} endTime + * @param {number} endTime * Ending time of animation. - * @param {Number} minSegmentDuration + * @param {number} minSegmentDuration * Minimum segment duration. - * @param {Number} minProgressThreshold + * @param {number} minProgressThreshold * Minimum progress threshold. - * @param {Number} resolution + * @param {number} resolution * Duration resolution for first time. * @param {Function} getSegment * A function that calculate the graph segment. @@ -180,10 +180,10 @@ function createPathSegments( * Create a function which is used as parameter (toPathStringFunc) in constructor * of SummaryGraphHelper. * - * @param {Number} endTime + * @param {number} endTime * end time of animation * e.g. 200 - * @param {Number} playbackRate + * @param {number} playbackRate * playback rate of animation * e.g. -1 * @return {Function} @@ -206,7 +206,7 @@ function createSummaryGraphPathStringFunction(endTime, playbackRate) { * * @param {Array} keyframes * Array of keyframe. - * @return {Number} + * @return {number} * Preferred duration resolution. */ function getPreferredDurationResolution(keyframes) { @@ -233,7 +233,7 @@ function getPreferredDurationResolution(keyframes) { /** * Return preferred progress threshold to render summary graph. * - * @param {Object} state + * @param {object} state * State of animation. * @param {Array} keyframes * Array of keyframe. @@ -307,7 +307,7 @@ function mapSegmentsToPlaybackRate(segments, endTime, playbackRate) { * * @param {Array} segments * e.g. [{ x: 100, y: 0 }, { x: 200, y: 1 }] - * @return {String} + * @return {string} * Path string. * e.g. "L100,0 L200,1" */ diff --git a/devtools/client/inspector/animation/utils/l10n.js b/devtools/client/inspector/animation/utils/l10n.js @@ -19,7 +19,7 @@ const INSPECTOR_L10N = new LocalizationHelper( * if the server provides the type, what type it is and if the animation * has a name. * - * @param {Object} state + * @param {object} state */ function getFormattedTitle(state) { // Older servers don't send a type, and only know about diff --git a/devtools/client/inspector/animation/utils/timescale.js b/devtools/client/inspector/animation/utils/timescale.js @@ -80,8 +80,8 @@ class TimeScale { * than the absolute value of zero position time, relative time will be * negative time. * - * @param {Number} distance - * @return {Number} + * @param {number} distance + * @return {number} */ distanceToRelativeTime(distance) { return (this.getDuration() * distance) / 100 - this.zeroPositionTime; @@ -91,8 +91,8 @@ class TimeScale { * Depending on the time scale, format the given time as milliseconds or * seconds. * - * @param {Number} time - * @return {String} The formatted time string. + * @param {number} time + * @return {string} The formatted time string. */ formatTime(time) { // Ignore negative zero @@ -112,7 +112,7 @@ class TimeScale { /** * Return entire animations duration. * - * @return {Number} duration + * @return {number} duration */ getDuration() { return this.maxEndTime - this.minStartTime; @@ -121,7 +121,7 @@ class TimeScale { /** * Return current time of this time scale represents. * - * @return {Number} + * @return {number} */ getCurrentTime() { return this.currentTime - this.minStartTime; @@ -132,7 +132,7 @@ class TimeScale { * This time does not include playbackRate and cratedTime. * Also, if the animation has infinite iterations, this returns Infinity. * - * @param {Object} animation + * @param {object} animation * @return {Numbber} end time */ getEndTime({ state }) { diff --git a/devtools/client/inspector/animation/utils/utils.js b/devtools/client/inspector/animation/utils/utils.js @@ -14,9 +14,9 @@ const OPTIMAL_TIME_INTERVAL_MULTIPLES = [1, 2.5, 5]; * Find the optimal interval between time graduations in the animation timeline * graph based on a minimum time interval. * - * @param {Number} minTimeInterval + * @param {number} minTimeInterval * Minimum time in ms in one interval - * @return {Number} The optimal interval time in ms + * @return {number} The optimal interval time in ms */ function findOptimalTimeInterval(minTimeInterval) { if (!minTimeInterval) { @@ -48,7 +48,7 @@ function findOptimalTimeInterval(minTimeInterval) { * Check whether or not the given list of animations has an iteration count of infinite. * * @param {Array} animations. - * @return {Boolean} true if there is an animation in the list of animations + * @return {boolean} true if there is an animation in the list of animations * whose animation iteration count is infinite. */ function hasAnimationIterationCountInfinite(animations) { @@ -59,7 +59,7 @@ function hasAnimationIterationCountInfinite(animations) { * Check wether the animations are running at least one. * * @param {Array} animations. - * @return {Boolean} true: running + * @return {boolean} true: running */ function hasRunningAnimation(animations) { return animations.some(({ state }) => state.playState === "running"); diff --git a/devtools/client/inspector/boxmodel/actions/box-model-highlighter.js b/devtools/client/inspector/boxmodel/actions/box-model-highlighter.js @@ -22,7 +22,7 @@ module.exports = { * Show the box model highlighter for the currently selected node front. * The selected node is obtained from the Selection instance on the Inspector. * - * @param {Object} options + * @param {object} options * Optional configuration options passed to the box model highlighter */ highlightSelectedNode(options = {}) { @@ -50,7 +50,7 @@ module.exports = { * * @param {NodeFront} nodeFront * Node that should be highlighted. - * @param {Object} options + * @param {object} options * Optional configuration options passed to the box model highlighter */ highlightNode(nodeFront, options = {}) { diff --git a/devtools/client/inspector/boxmodel/actions/box-model.js b/devtools/client/inspector/boxmodel/actions/box-model.js @@ -14,7 +14,7 @@ module.exports = { /** * Updates the geometry editor's enabled state. * - * @param {Boolean} enabled + * @param {boolean} enabled * Whether or not the geometry editor is enabled or not. */ updateGeometryEditorEnabled(enabled) { diff --git a/devtools/client/inspector/boxmodel/box-model.js b/devtools/client/inspector/boxmodel/box-model.js @@ -157,7 +157,7 @@ BoxModel.prototype = { /** * Updates the box model panel by dispatching the new layout data. * - * @param {String} reason + * @param {string} reason * Optional string describing the reason why the boxmodel is updated. */ updateBoxModel(reason) { @@ -293,7 +293,7 @@ BoxModel.prototype = { * * @param {Element} target * The target element. - * @param {String} property + * @param {string} property * The name of the property. */ onShowRulePreviewTooltip(target, property) { @@ -316,7 +316,7 @@ BoxModel.prototype = { * The element that was clicked. * @param {Event} event * The event object. - * @param {String} property + * @param {string} property * The name of the property. */ onShowBoxModelEditor(element, event, property) { diff --git a/devtools/client/inspector/boxmodel/components/BoxModelMain.js b/devtools/client/inspector/boxmodel/components/BoxModelMain.js @@ -222,7 +222,7 @@ class BoxModelMain extends PureComponent { * * @param {Element} target * Node to be observed - * @param {Boolean} shiftKey + * @param {boolean} shiftKey * Determines if shiftKey was pressed */ moveFocus({ target, shiftKey }) { diff --git a/devtools/client/inspector/boxmodel/components/BoxModelProperties.js b/devtools/client/inspector/boxmodel/components/BoxModelProperties.js @@ -48,7 +48,7 @@ class BoxModelProperties extends PureComponent { * This returns the right element if there needs to be one, and one was passed in the * props. * - * @return {Object} An object with 2 properties: + * @return {object} An object with 2 properties: * - referenceElement {NodeFront} * - referenceElementType {String} */ diff --git a/devtools/client/inspector/boxmodel/test/head.js b/devtools/client/inspector/boxmodel/test/head.js @@ -14,7 +14,7 @@ Services.scriptloader.loadSubScript( * Is the given node visible in the page (rendered in the frame tree). * * @param {DOMNode} - * @return {Boolean} + * @return {boolean} */ function isNodeVisible(node) { return !!node.getClientRects().length; @@ -25,7 +25,7 @@ function isNodeVisible(node) { * * @param {InspectorPanel} inspector * The instance of InspectorPanel currently loaded in the toolbox. - * @param {Boolean} waitForSelectionUpdate + * @param {boolean} waitForSelectionUpdate * Should the boxmodel-view-updated event come from a new selection. * @return {Promise} a promise */ @@ -106,7 +106,7 @@ selectNode = async function (node, inspector, reason) { * * @param {DOMNode} element * The element to check. - * @param {String} expectedText + * @param {string} expectedText * The text that is expected to be set as textContent of the element. */ async function waitForElementTextContent(element, expectedText) { diff --git a/devtools/client/inspector/boxmodel/utils/editing-session.js b/devtools/client/inspector/boxmodel/utils/editing-session.js @@ -31,9 +31,9 @@ EditingSession.prototype = { * * @param {StyleRuleFront} rule * The CSS rule. - * @param {String} property + * @param {string} property * The name of the property. - * @return {String} the value. + * @return {string} the value. */ getPropertyFromRule(rule, property) { // Use the parsed declarations in the StyleRuleFront object if available. @@ -52,7 +52,7 @@ EditingSession.prototype = { * Returns the current value for a property as a string or the empty string if * no style rules affect the property. * - * @param {String} property + * @param {string} property * The name of the property as a string */ getProperty(property) { @@ -80,11 +80,11 @@ EditingSession.prototype = { * Get the index of a given css property name in a CSS rule. * Or -1, if there are no properties in the rule yet. * - * @param {String} name + * @param {string} name * The property name. * @param {StyleRuleFront} rule * Optional, defaults to the element style rule. - * @return {Number} The property index in the rule. + * @return {number} The property index in the rule. */ getPropertyIndex(name, rule = this._rules[0]) { if (!rule.declarations.length) { diff --git a/devtools/client/inspector/breadcrumbs.js b/devtools/client/inspector/breadcrumbs.js @@ -73,7 +73,7 @@ ArrowScrollBox.prototype = { * Scroll to the specified element using the current scroll behavior * * @param {Element} element element to scroll - * @param {String} block desired alignment of element after scrolling + * @param {string} block desired alignment of element after scrolling */ scrollToElement(element, block) { element.scrollIntoView({ block, behavior: this.scrollBehavior }); @@ -211,10 +211,10 @@ ArrowScrollBox.prototype = { * Check whether the element is to the left of its container but does * not also span the entire container. * - * @param {Number} left the left scroll point of the container - * @param {Number} right the right edge of the container - * @param {Number} elementLeft the left edge of the element - * @param {Number} elementRight the right edge of the element + * @param {number} left the left scroll point of the container + * @param {number} right the right edge of the container + * @param {number} elementLeft the left edge of the element + * @param {number} elementRight the right edge of the element */ elementLeftOfContainer(left, right, elementLeft, elementRight) { return ( @@ -226,10 +226,10 @@ ArrowScrollBox.prototype = { * Check whether the element is to the right of its container but does * not also span the entire container. * - * @param {Number} left the left scroll point of the container - * @param {Number} right the right edge of the container - * @param {Number} elementLeft the left edge of the element - * @param {Number} elementRight the right edge of the element + * @param {number} left the left scroll point of the container + * @param {number} right the right edge of the container + * @param {number} elementLeft the left edge of the element + * @param {number} elementRight the right edge of the element */ elementRightOfContainer(left, right, elementLeft, elementRight) { return ( @@ -321,8 +321,8 @@ ArrowScrollBox.prototype = { * Create an XHTML element with the given class name, and append it to the * parent. * - * @param {String} tagName name of the tag to create - * @param {String} className class of the element + * @param {string} tagName name of the tag to create + * @param {string} className class of the element * @param {DOMNode} parent the parent node to which it should be appended * @return {DOMNode} The new element */ @@ -436,7 +436,7 @@ HTMLBreadcrumbs.prototype = { * Build a string that represents the node: tagName#id.class1.class2. * * @param {NodeFront} nodeFront The node to pretty-print - * @return {String} + * @return {string} */ prettyPrintNodeAsText(nodeFront) { let text = nodeFront.isShadowRoot @@ -601,7 +601,7 @@ HTMLBreadcrumbs.prototype = { /** * Handle a keyboard shortcut supported by the breadcrumbs widget. * - * @param {String} name + * @param {string} name * Name of the keyboard shortcut received. * @param {DOMEvent} event * Original event that triggered the shortcut. @@ -675,7 +675,7 @@ HTMLBreadcrumbs.prototype = { /** * Set which button represent the selected node. * - * @param {Number} index Index of the displayed-button to select. + * @param {number} index Index of the displayed-button to select. */ setCursor(index) { // Unselect the previously selected button @@ -701,7 +701,7 @@ HTMLBreadcrumbs.prototype = { * Get the index of the node in the cache. * * @param {NodeFront} node. - * @returns {Number} The index for this node or -1 if not found. + * @returns {number} The index for this node or -1 if not found. */ indexOf(node) { for (let i = this.nodeHierarchy.length - 1; i >= 0; i--) { @@ -716,7 +716,7 @@ HTMLBreadcrumbs.prototype = { * Remove all the buttons and their references in the cache after a given * index. * - * @param {Number} index. + * @param {number} index. */ cutAfter(index) { while (this.nodeHierarchy.length > index + 1) { @@ -791,7 +791,7 @@ HTMLBreadcrumbs.prototype = { * Find the "youngest" ancestor of a node which is already in the breadcrumbs. * * @param {NodeFront} node. - * @return {Number} Index of the ancestor in the cache, or -1 if not found. + * @return {number} Index of the ancestor in the cache, or -1 if not found. */ getCommonAncestor(node) { while (node) { @@ -847,7 +847,7 @@ HTMLBreadcrumbs.prototype = { * widget to be updated. * * @param {Array} mutations The mutations array. - * @return {Boolean} + * @return {boolean} */ _hasInterestingMutations(mutations) { if (!mutations || !mutations.length) { @@ -867,8 +867,8 @@ HTMLBreadcrumbs.prototype = { * Check if the provided mutation (from a markupmutation event) is relevant * for the current breadcrumbs. * - * @param {Object} mutation The mutation to check. - * @return {Boolean} true if the mutation is relevant, false otherwise. + * @param {object} mutation The mutation to check. + * @return {boolean} true if the mutation is relevant, false otherwise. */ _isInterestingMutation(mutation) { const { type, added, removed, target, attributeName } = mutation; @@ -901,7 +901,7 @@ HTMLBreadcrumbs.prototype = { /** * Update the breadcrumbs display when a new node is selected. * - * @param {String} reason The reason for the update, if any. + * @param {string} reason The reason for the update, if any. * @param {Array} mutations An array of mutations in case this was called as * the "markupmutation" event listener. */ diff --git a/devtools/client/inspector/changes/ChangesView.js b/devtools/client/inspector/changes/ChangesView.js @@ -160,9 +160,9 @@ class ChangesView { * - if neither rule id nor source id are provided, copy the changes too all rules * within all sources. * - * @param {String|null} ruleId + * @param {string | null} ruleId * Optional rule id. - * @param {String|null} sourceId + * @param {string | null} sourceId * Optional source id. */ copyChanges(ruleId, sourceId) { @@ -204,7 +204,7 @@ class ChangesView { * Gets the full content of the target CSS rule (including any changes applied) * and copies it to the clipboard. * - * @param {String} ruleId + * @param {string} ruleId * Rule id of the target CSS rule. */ async copyRule(ruleId) { diff --git a/devtools/client/inspector/changes/components/ChangesApp.js b/devtools/client/inspector/changes/components/ChangesApp.js @@ -132,7 +132,7 @@ class ChangesApp extends PureComponent { * * @param {Array} selectors * List of strings as versions of this rule's selector over time. - * @param {Boolean} isNewRule + * @param {boolean} isNewRule * Whether the rule was created at runtime. * @return {Array} */ diff --git a/devtools/client/inspector/changes/reducers/changes.js b/devtools/client/inspector/changes/reducers/changes.js @@ -12,8 +12,8 @@ const { /** * Return a deep clone of the given state object. * - * @param {Object} state - * @return {Object} + * @param {object} state + * @return {object} */ function cloneState(state = {}) { return Object.entries(state).reduce((sources, [sourceId, source]) => { @@ -41,7 +41,7 @@ function cloneState(state = {}) { * create entries in the given rules collection for each rule and assign parent/child * dependencies. * - * @param {Object} ruleData + * @param {object} ruleData * Information about a CSS rule: * { * id: {String} @@ -55,11 +55,11 @@ function cloneState(state = {}) { * Indexes of each ancestor rule within its parent rule. * } * - * @param {Object} rules + * @param {object} rules * Collection of rules to be mutated. * This is a reference to the corresponding `rules` object from the state. * - * @return {Object} + * @return {object} * Entry for the CSS rule created the given collection of rules. */ function createRule(ruleData, rules) { diff --git a/devtools/client/inspector/changes/selectors/changes.js b/devtools/client/inspector/changes/selectors/changes.js @@ -22,16 +22,16 @@ const { * Keeping this interface updated allows the Redux state structure to change without * affecting the consumer components. * - * @param {Object} state + * @param {object} state * Redux slice for tracked changes. - * @param {Object} filter + * @param {object} filter * Object with optional filters to use. Has the following properties: * - sourceIds: {Array} * Use only subtrees of sources matching source ids from this array. * - ruleIds: {Array} * Use only rules matching rule ids from this array. If the array includes ids * of ancestor rules (@media, @supports), their nested rules will be included. - * @return {Object} + * @return {object} */ function getChangesTree(state, filter = {}) { // Use or assign defaults of sourceId and ruleId arrays by which to filter the tree. @@ -43,11 +43,11 @@ function getChangesTree(state, filter = {}) { * * Returns the rule object with expanded children or null if previously visited. * - * @param {String} ruleId - * @param {Object} rule + * @param {string} ruleId + * @param {object} rule * @param {Array} rules * @param {Set} visitedRules - * @return {Object|null} + * @return {object | null} */ function expandRuleChildren(ruleId, rule, rules, visitedRules) { if (visitedRules.has(ruleId)) { @@ -126,11 +126,11 @@ function getChangesTree(state, filter = {}) { * rules). Removed CSS declarations are written commented out. Added CSS declarations are * written as-is. * - * @param {Object} state + * @param {object} state * Redux slice for tracked changes. - * @param {Object} filter + * @param {object} filter * Object with optional source and rule filters. See getChangesTree() - * @return {String} + * @return {string} * CSS stylesheet text. */ @@ -177,9 +177,9 @@ function getChangesStylesheet(state, filter) { * @param {Array} selectors * History of selector versions if changed over time. * Array with a single item (the original selector) if never changed. - * @param {Number} level + * @param {number} level * Level of nesting within a CSS rule tree. - * @return {String} + * @return {string} */ function writeSelector(selectors = [], level) { const indent = indentChar.repeat(level); diff --git a/devtools/client/inspector/changes/test/head.js b/devtools/client/inspector/changes/test/head.js @@ -18,7 +18,7 @@ Services.scriptloader.loadSubScript( * * @param {Document} panelDoc * Host document of the Changes panel. - * @param {String} selector + * @param {string} selector * Optional selector to filter rendered declaration DOM elements. * One of ".diff-remove" or ".diff-add". * If omitted, all declarations will be returned. @@ -57,7 +57,7 @@ function getRemovedDeclarations(panelDoc, containerNode) { * * @param {Document} panelDoc * Host document of the Changes panel. - * @param {String} selector + * @param {string} selector * Optional selector to filter rendered selector DOM elements. * One of ".diff-remove" or ".diff-add". * If omitted, all selectors will be returned. diff --git a/devtools/client/inspector/changes/utils/changes-utils.js b/devtools/client/inspector/changes/utils/changes-utils.js @@ -14,11 +14,11 @@ const { * For inline stylesheets, return a string indicating that. * For URLs, return just the stylesheet filename. * - * @param {Object} source + * @param {object} source * Information about the style source. Contains: - * - type: {String} One of "element" or "stylesheet" + * - type: {string} One of "element" or "stylesheet" * - href: {String|null} Stylesheet URL or document URL for elmeent inline styles - * @return {String} + * @return {string} */ function getSourceForDisplay(source) { let href; diff --git a/devtools/client/inspector/compatibility/test/browser/browser_compatibility_dynamic_markup-dom-change.js b/devtools/client/inspector/compatibility/test/browser/browser_compatibility_dynamic_markup-dom-change.js @@ -78,7 +78,7 @@ add_task(async function () { * This overrides the definition in inspector/test/head.js which times * out when the container to be clicked is already the selected node. * - * @param {String|NodeFront} selector + * @param {string | NodeFront} selector * @param {InspectorPanel} inspector The instance of InspectorPanel currently * loaded in the toolbox * @return {Promise} Resolves when the node has been selected. diff --git a/devtools/client/inspector/compatibility/test/browser/head.js b/devtools/client/inspector/compatibility/test/browser/head.js @@ -229,7 +229,7 @@ async function assertNodeList(panel, expectedNodes) { /** * Get IssueItem of given property from given element. * - * @param {String} property + * @param {string} property * @param {Element} element * @return {Element} */ @@ -241,8 +241,8 @@ function getIssueItem(property, element) { * Toggle enable/disable checkbox of a specific property on rule view. * * @param {Inspector} inspector - * @param {Number} ruleIndex - * @param {Number} propIndex + * @param {number} ruleIndex + * @param {number} propIndex */ async function togglePropStatusOnRuleView(inspector, ruleIndex, propIndex) { const ruleView = inspector.getPanel("ruleview").view; @@ -263,7 +263,7 @@ async function togglePropStatusOnRuleView(inspector, ruleIndex, propIndex) { /** * Return a promise which waits for COMPATIBILITY_UPDATE_SELECTED_NODE_COMPLETE action. * - * @param {Object} store + * @param {object} store * @return {Promise} */ function waitForUpdateSelectedNodeAction(store) { @@ -273,7 +273,7 @@ function waitForUpdateSelectedNodeAction(store) { /** * Return a promise which waits for COMPATIBILITY_UPDATE_TOP_LEVEL_TARGET_COMPLETE action. * - * @param {Object} store + * @param {object} store * @return {Promise} */ function waitForUpdateTopLevelTargetAction(store) { diff --git a/devtools/client/inspector/computed/computed.js b/devtools/client/inspector/computed/computed.js @@ -71,7 +71,7 @@ class UpdateProcess { * Timeouts will be set on this window when appropriate. * @param {Array} array * The array of items to process. - * @param {Object} options + * @param {object} options * Options for the update process: * onItem {function} Will be called with the value of each iteration. * onBatch {function} Will be called after each batch of iterations, @@ -279,9 +279,9 @@ class CssComputedView { /** * Lookup a l10n string in the shared styleinspector string bundle. * - * @param {String} name + * @param {string} name * The key to lookup. - * @returns {String} localized version of the given key. + * @returns {string} localized version of the given key. */ static l10n(name) { try { @@ -414,7 +414,7 @@ class CssComputedView { * * @param {DOMNode} node * The node which we want information about - * @return {Object} The type information object contains the following props: + * @return {object} The type information object contains the following props: * - view {String} Always "computed" to indicate the computed view. * - type {String} One of the VIEW_NODE_XXX_TYPE const in * client/inspector/shared/node-types @@ -760,7 +760,7 @@ class CssComputedView { /** * Set the filter style search value. * - * @param {String} value + * @param {string} value * The search value. */ setFilterStyles(value = "") { @@ -993,7 +993,7 @@ class PropertyInfo { /** * @param {CssComputedView} tree * The CssComputedView instance we are working with. - * @param {String} name + * @param {string} name * The CSS property name */ constructor(tree, name) { @@ -1027,10 +1027,10 @@ class PropertyView { /** * @param {CssComputedView} tree * The CssComputedView instance we are working with. - * @param {String} name + * @param {string} name * The CSS property name for which this PropertyView * instance will render the rules. - * @param {Boolean} isCustomProperty + * @param {boolean} isCustomProperty * Set to true if this will represent a custom property. */ constructor(tree, name, isCustomProperty = false) { @@ -1083,7 +1083,7 @@ class PropertyView { /** * Get the computed style for the current property. * - * @return {String} the computed style for the current property of the + * @return {string} the computed style for the current property of the * currently highlighted element. */ get value() { @@ -1132,7 +1132,7 @@ class PropertyView { /** * Returns the className that should be assigned to the propertyView. * - * @return {String} + * @return {string} */ get propertyHeaderClassName() { return this.visible ? "computed-property-view" : "computed-property-hidden"; @@ -1141,7 +1141,7 @@ class PropertyView { /** * Is the property invalid at computed value time * - * @returns {Boolean} + * @returns {boolean} */ get invalidAtComputedValueTime() { return this.#tree.computed[this.name].invalidAtComputedValueTime; @@ -1495,8 +1495,8 @@ class PropertyView { /** * Parse a property value using the OutputParser. * - * @param {String} value - * @param {String} baseURI + * @param {string} value + * @param {string} baseURI * @returns {DocumentFragment|Element} */ #parseValue(value, baseURI) { @@ -1705,7 +1705,7 @@ class SelectorView { * original sources or not. This is a callback for * SourceMapURLService.subscribe, which see. * - * @param {Object | null} originalLocation + * @param {object | null} originalLocation * The original position object (url/line/column) or null. */ #updateLocation = originalLocation => { diff --git a/devtools/client/inspector/computed/test/head.js b/devtools/client/inspector/computed/test/head.js @@ -39,7 +39,7 @@ function getComputedViewProperties(view) { * * @param {CssComputedView} view * The instance of the computed view panel - * @param {String} name + * @param {string} name * The name of the property to retrieve * @return an object {nameSpan, valueSpan} */ @@ -62,7 +62,7 @@ function getComputedViewProperty(view, name) { * * @param {CssComputedView} view * The instance of the computed view panel - * @param {String} name + * @param {string} name * The name of the property to retrieve * @return {PropertyView} */ @@ -79,7 +79,7 @@ function getComputedViewPropertyView(view, name) { * * @param {CssComputedView} view * The instance of the computed view panel - * @param {String} name + * @param {string} name * The name of the property to retrieve * @return {Promise} A promise that resolves to the property matched rules * container @@ -117,9 +117,9 @@ var getComputedViewMatchedRules = async function (view, name) { * * @param {CssComputedView} view * The instance of the computed view panel - * @param {String} name + * @param {string} name * The name of the property to retrieve - * @return {String} The property value + * @return {string} The property value */ function getComputedViewPropertyValue(view, name) { return getComputedViewProperty(view, name).valueSpan.textContent; @@ -131,7 +131,7 @@ function getComputedViewPropertyValue(view, name) { * * @param {CssComputedView} view * The instance of the computed view panel - * @param {Number} index + * @param {number} index * The index of the property to be expanded * @return a promise that resolves when the property has been expanded, or * rejects if the property was not found @@ -153,7 +153,7 @@ function expandComputedViewPropertyByIndex(view, index) { * * @param {CssComputedView} view * The instance of the computed view panel - * @param {Number} index + * @param {number} index * The index of the matched selector element * @return {DOMNode} The link at the given index, if one exists, null otherwise */ @@ -185,7 +185,7 @@ function selectAllText(view) { * * @param {CssComputedView} view * The instance of the computed view panel - * @param {String} expectedPattern + * @param {string} expectedPattern * A regular expression used to check the content of the clipboard */ async function copyAllAndCheckClipboard(view, expectedPattern) { @@ -211,11 +211,11 @@ async function copyAllAndCheckClipboard(view, expectedPattern) { * * @param {CssComputedView} view * The instance of the computed view panel - * @param {Object} positions + * @param {object} positions * The start and end positions of the text to be selected. This must be an object * like this: * { start: {prop: 1, offset: 0}, end: {prop: 3, offset: 5} } - * @param {String} expectedPattern + * @param {string} expectedPattern * A regular expression used to check the content of the clipboard */ async function copySomeTextAndCheckClipboard(view, positions, expectedPattern) { @@ -276,12 +276,12 @@ function failClipboardCheck(expectedPattern) { * * @param {CssComputedView} view * The instance of the computed view panel - * @param {Object} options + * @param {object} options * @param {string} options.property * The property name to check * @param {string} options.expectedComputedValue * The expected value displayed for the property - * @param {Object[]} options.expectedMatchedSelectors + * @param {object[]} options.expectedMatchedSelectors * An array of objects describing the expected matched selectors * @param {string} options.expectedMatchedSelectors[].selector * The selector that should be displayed at this index diff --git a/devtools/client/inspector/extensions/extension-sidebar.js b/devtools/client/inspector/extensions/extension-sidebar.js @@ -36,10 +36,10 @@ const { * * @param {Inspector} inspector * The inspector where the sidebar should be hooked to. - * @param {Object} options - * @param {String} options.id + * @param {object} options + * @param {string} options.id * The unique id of the sidebar. - * @param {String} options.title + * @param {string} options.title * The title of the sidebar. */ class ExtensionSidebar { diff --git a/devtools/client/inspector/flexbox/actions/flexbox-highlighter.js b/devtools/client/inspector/flexbox/actions/flexbox-highlighter.js @@ -23,7 +23,7 @@ module.exports = { * * @param {NodeFront} nodeFront * Node for which the highlighter should be toggled. - * @param {String} reason + * @param {string} reason * Reason why the highlighter was toggled; used in telemetry. */ toggleFlexboxHighlighter(nodeFront, reason) { diff --git a/devtools/client/inspector/flexbox/actions/flexbox.js b/devtools/client/inspector/flexbox/actions/flexbox.js @@ -34,7 +34,7 @@ module.exports = { /** * Updates the color used for the flexbox's highlighter. * - * @param {String} color + * @param {string} color * The color to use for this nodeFront's flexbox highlighter. */ updateFlexboxColor(color) { @@ -47,7 +47,7 @@ module.exports = { /** * Updates the flexbox highlighted state. * - * @param {Boolean} highlighted + * @param {boolean} highlighted * Whether or not the flexbox highlighter is highlighting the flexbox. */ updateFlexboxHighlighted(highlighted) { diff --git a/devtools/client/inspector/flexbox/components/FlexItemSizingProperties.js b/devtools/client/inspector/flexbox/components/FlexItemSizingProperties.js @@ -59,11 +59,11 @@ class FlexItemSizingProperties extends PureComponent { * The rendered value will end with 'px' (unless the dimension is 0 in which case the * unit will be omitted) * - * @param {Number} value + * @param {number} value * The number to be rounded - * @param {Boolean} prependPlusSign + * @param {boolean} prependPlusSign * If set to true, the + sign will be printed before a positive value - * @return {Object} + * @return {object} * The React component representing this rounded size */ renderSize(value, prependPlusSign) { @@ -86,11 +86,11 @@ class FlexItemSizingProperties extends PureComponent { /** * Render an authored CSS property. * - * @param {String} name + * @param {string} name * The name for this CSS property - * @param {String} value + * @param {string} value * The property value - * @return {Object} + * @return {object} * The React component representing this CSS property */ renderCssProperty(name, value) { @@ -103,7 +103,7 @@ class FlexItemSizingProperties extends PureComponent { * * @param {Array} sentences * The list of sentences as Strings - * @return {Object} + * @return {object} * The React component representing these sentences */ renderReasons(sentences) { diff --git a/devtools/client/inspector/flexbox/flexbox.js b/devtools/client/inspector/flexbox/flexbox.js @@ -97,7 +97,7 @@ class FlexboxInspector { /** * Returns an object containing the custom flexbox colors for different hosts. * - * @return {Object} that maps a host name to a custom flexbox color for a given host. + * @return {object} that maps a host name to a custom flexbox color for a given host. */ async getCustomHostColors() { if (this._customHostColors) { @@ -116,9 +116,9 @@ class FlexboxInspector { * * @param {NodeFront} nodeFront * The NodeFront to fetch the flex container properties. - * @param {Boolean} onlyLookAtParents + * @param {boolean} onlyLookAtParents * Whether or not to only consider the parent node of the given node. - * @return {Object} consisting of the given node's flex container's properties. + * @return {object} consisting of the given node's flex container's properties. */ async getFlexContainerProps(nodeFront, onlyLookAtParents = false) { const layoutFront = await nodeFront.walkerFront.getLayoutInspector(); @@ -204,7 +204,7 @@ class FlexboxInspector { /** * Returns the custom overlay color for the current host or the default flexbox color. * - * @return {String} overlay color. + * @return {string} overlay color. */ async getOverlayColor() { if (this._overlayColor) { @@ -243,7 +243,7 @@ class FlexboxInspector { * If the event is dispatched on behalf of a flex highlighter, toggle the * corresponding flex container's highlighted state in the Redux store. * - * @param {Object} data + * @param {object} data * Object with data associated with the highlighter event. * {NodeFront} data.nodeFront * The NodeFront of the flex container element for which the flexbox @@ -262,7 +262,7 @@ class FlexboxInspector { * If the event is dispatched on behalf of a flex highlighter, toggle the * corresponding flex container's highlighted state in the Redux store. * - * @param {Object} data + * @param {object} data * Object with data associated with the highlighter event. * {NodeFront} data.nodeFront * The NodeFront of the flex container element for which the flexbox @@ -280,7 +280,7 @@ class FlexboxInspector { * Updates the flex container highlighted state in the Redux store if the provided * NodeFront is the current selected flex container. * - * @param {Boolean} highlighted + * @param {boolean} highlighted * Whether the change is to highlight or hide the overlay. * @param {NodeFront} nodeFront * The NodeFront of the flex container element for which the flexbox @@ -367,7 +367,7 @@ class FlexboxInspector { /** * Handler for a change in the flexbox overlay color picker for a flex container. * - * @param {String} color + * @param {string} color * A hex string representing the color to use. */ async onSetFlexboxOverlayColor(color) { @@ -417,10 +417,10 @@ class FlexboxInspector { * Handler for "new-root" event fired by the inspector and "new-node-front" event fired * by the inspector selection. Updates the flexbox panel if it is visible. * - * @param {Object} + * @param {object} * This callback is sometimes executed on "new-node-front" events which means * that a first param is passed here (the nodeFront), which we don't care about. - * @param {String} reason + * @param {string} reason * On "new-node-front" events, a reason is passed here, and we need it to detect * if this update was caused by a node selection from the markup-view. */ @@ -437,13 +437,13 @@ class FlexboxInspector { * the layout view becomes visible or a new node is selected and needs to be update * with new flexbox data. * - * @param {Object|null} flexContainer + * @param {object | null} flexContainer * An object consisting of the current flex container's flex items and * properties. - * @param {Object|null} flexItemContainer + * @param {object | null} flexItemContainer * An object consisting of the parent flex container's flex items and * properties. - * @param {Boolean} initiatedByMarkupViewSelection + * @param {boolean} initiatedByMarkupViewSelection * True if the update was due to a node selection in the markup-view. */ async update( @@ -515,9 +515,9 @@ class FlexboxInspector { * For a given flex container object, returns the flex container properties that can be * used to check if 2 flex container objects are the same. * - * @param {Object|null} flexContainer + * @param {object | null} flexContainer * Object consisting of the flex container's properties. - * @return {Object|null} consisting of the comparable flex container's properties. + * @return {object | null} consisting of the comparable flex container's properties. */ function getComparableFlexContainerProperties(flexContainer) { if (!flexContainer) { @@ -553,11 +553,11 @@ function getComparableFlexItemsProperties(flexItems) { /** * Compares the old and new flex container properties * - * @param {Object} oldFlexContainer + * @param {object} oldFlexContainer * Object consisting of the old flex container's properties. - * @param {Object} newFlexContainer + * @param {object} newFlexContainer * Object consisting of the new flex container's properties. - * @return {Boolean} true if the flex container properties are the same, false otherwise. + * @return {boolean} true if the flex container properties are the same, false otherwise. */ function hasFlexContainerChanged(oldFlexContainer, newFlexContainer) { return ( diff --git a/devtools/client/inspector/fonts/components/FontAxis.js b/devtools/client/inspector/fonts/components/FontAxis.js @@ -30,11 +30,11 @@ class FontAxis extends PureComponent { * Naive implementation to get increment step for variable font axis that ensures * fine grained control based on range of values between min and max. * - * @param {Number} min + * @param {number} min * Minumum value for range. - * @param {Number} max + * @param {number} max * Maximum value for range. - * @return {Number} + * @return {number} * Step value used in range input for font axis. */ getAxisStep(min, max) { diff --git a/devtools/client/inspector/fonts/components/FontEditor.js b/devtools/client/inspector/fonts/components/FontEditor.js @@ -60,7 +60,7 @@ class FontEditor extends PureComponent { * * @param {Array} fontAxes * Array of font axis instances - * @param {Object} editedAxes + * @param {object} editedAxes * Object with axes and values edited by the user or defined in the CSS * declaration for font-variation-settings. * @return {Array|null} @@ -238,7 +238,7 @@ class FontEditor extends PureComponent { * * @param {Array} fontInstances * Named variation instances as provided with the font file. - * @param {Object} selectedInstance + * @param {object} selectedInstance * Object with information about the currently selected variation instance. * Example: * { diff --git a/devtools/client/inspector/fonts/components/FontMetadata.js b/devtools/client/inspector/fonts/components/FontMetadata.js @@ -37,8 +37,8 @@ class FontMetadata extends PureComponent { * If the string is larger than MAX_STRING_LENGTH, the string gets truncated * and we display a twisty button to reveal the full text. * - * @param {String} fontProperty: The font property to render - * @returns {String|Array<ReactElement>} + * @param {string} fontProperty: The font property to render + * @returns {string | Array<ReactElement>} */ renderExpandableString(fontProperty) { const str = this.props.font[fontProperty]; diff --git a/devtools/client/inspector/fonts/components/FontPropertyValue.js b/devtools/client/inspector/fonts/components/FontPropertyValue.js @@ -90,9 +90,9 @@ class FontPropertyValue extends PureComponent { * Given a `prop` key found on the component's props, check the matching `propLabel`. * If `propLabel` is true, return the `prop` value; Otherwise, return null. * - * @param {String} prop + * @param {string} prop * Key found on the component's props. - * @return {Number|null} + * @return {number | null} */ getPropLabel(prop) { const label = this.props[`${prop}Label`]; @@ -114,9 +114,9 @@ class FontPropertyValue extends PureComponent { * Ensure it is a number and that it does not go outside the min/max limits, unless * allowed by the `allowOverflow` and `allowUnderflow` props. * - * @param {Number} value + * @param {number} value * Numeric value - * @return {Boolean} + * @return {boolean} * Whether the value conforms to the components contraints. */ isValueValid(value) { @@ -264,7 +264,7 @@ class FontPropertyValue extends PureComponent { * state instead of from props to prevent jittering during continous dragging of the * range input thumb or incrementing from the number input. * - * @param {Boolean} isInteractive + * @param {boolean} isInteractive * Whether to mark the interactive state on or off. */ toggleInteractiveState(isInteractive) { @@ -285,7 +285,7 @@ class FontPropertyValue extends PureComponent { * * @see this.onBlur() for logic reconciling the internal state with props. * - * @param {Number} value + * @param {number} value * Numeric property value. */ updateValue(value) { diff --git a/devtools/client/inspector/fonts/fonts.js b/devtools/client/inspector/fonts/fonts.js @@ -191,16 +191,16 @@ class FontInspector { * Conversion is done via pixels. If neither of the two given unit types is "px", * recursively get the value in pixels, then convert that result to the desired unit. * - * @param {String} property + * @param {string} property * Property name for the converted value. * Assumed to be "font-size", but special case for "line-height". - * @param {Number} value + * @param {number} value * Numeric value to convert. - * @param {String} fromUnit + * @param {string} fromUnit * CSS unit to convert from. - * @param {String} toUnit + * @param {string} toUnit * CSS unit to convert to. - * @return {Number} + * @return {number} * Converted numeric value. */ async convertUnits(property, value, fromUnit, toUnit) { @@ -338,7 +338,7 @@ class FontInspector { * Get all expected CSS font properties and values from the node's matching rules and * fallback to computed style. Skip CSS Custom Properties, `calc()` and keyword values. * - * @return {Object} + * @return {object} */ async getFontProperties() { const properties = {}; @@ -410,9 +410,9 @@ class FontInspector { * Get the box dimensions used for unit conversion according to the CSS property and * target CSS unit. * - * @param {String} property + * @param {string} property * CSS property - * @param {String} unit + * @param {string} unit * Target CSS unit * @return {Promise} * Promise that resolves with an object with box dimensions in pixels. @@ -458,9 +458,9 @@ class FontInspector { * Get the refernece font size value used for unit conversion according to the * CSS property and target CSS unit. * - * @param {String} property + * @param {string} property * CSS property - * @param {String} unit + * @param {string} unit * Target CSS unit * @return {Promise} * Promise that resolves with the reference font size value or null if there @@ -486,9 +486,9 @@ class FontInspector { * Get the reference node used in measurements for unit conversion according to the * the CSS property and target CSS unit type. * - * @param {String} property + * @param {string} property * CSS property - * @param {String} unit + * @param {string} unit * Target CSS unit * @return {Promise} * Promise that resolves with the reference node used in measurements for unit @@ -520,7 +520,7 @@ class FontInspector { * Get a reference to a TextProperty instance from the current selected rule for a * given property name. * - * @param {String} name + * @param {string} name * CSS property name * @return {TextProperty|null} */ @@ -555,7 +555,7 @@ class FontInspector { * - slnt -> font-style * - ital -> font-style * - * @param {String} axis + * @param {string} axis * Name of registered axis. * @return {Function} * Method to call which updates the corresponding CSS font property. @@ -623,7 +623,7 @@ class FontInspector { * considered to be custom axes names and will be written to the * "font-variation-settings" CSS property. * - * @param {String} name + * @param {string} name * CSS property name or axis name. * @return {Function} * Method which updates the rule view and page style. @@ -649,7 +649,7 @@ class FontInspector { /** * Check if the font inspector panel is visible. * - * @return {Boolean} + * @return {boolean} */ isPanelVisible() { return ( @@ -686,9 +686,9 @@ class FontInspector { * on the page circumventing direct TextProperty.setValue() which triggers expensive DOM * operations in TextPropertyEditor.update(). * - * @param {String} name + * @param {string} name * CSS property name - * @param {String} value + * @param {string} value * CSS property value */ async syncChanges(name, value) { @@ -713,9 +713,9 @@ class FontInspector { /** * Handler for changes of a font axis value coming from the FontEditor. * - * @param {String} tag + * @param {string} tag * Tag name of the font axis. - * @param {Number} value + * @param {number} value * Value of the font axis. */ onAxisUpdate(tag, value) { @@ -727,11 +727,11 @@ class FontInspector { /** * Handler for changes of a CSS font property value coming from the FontEditor. * - * @param {String} property + * @param {string} property * CSS font property name. - * @param {Number} value + * @param {number} value * CSS font property numeric value. - * @param {String|null} unit + * @param {string | null} unit * CSS unit or null */ onFontPropertyUpdate(property, value, unit) { @@ -745,7 +745,7 @@ class FontInspector { * Handler for selecting a font variation instance. Dispatches an action which updates * the axes and their values as defined by that variation instance. * - * @param {String} name + * @param {string} name * Name of variation instance. (ex: Light, Regular, Ultrabold, etc.) * @param {Array} values * Array of objects with axes and values defined by the variation instance. @@ -812,13 +812,13 @@ class FontInspector { * If the property parameter is not a recognized CSS font property name, assume it's a * variable font axis name. * - * @param {String} property + * @param {string} property * CSS font property name or axis name - * @param {Number} value + * @param {number} value * CSS font property value or axis value - * @param {String|undefined} fromUnit + * @param {string | undefined} fromUnit * Optional CSS unit to convert from - * @param {String|undefined} toUnit + * @param {string | undefined} toUnit * Optional CSS unit to convert to */ async onPropertyChange(property, value, fromUnit, toUnit) { @@ -841,7 +841,7 @@ class FontInspector { * Handler for "property-value-updated" event emitted from the rule view whenever a * property value changes. Ignore changes to properties unrelated to the font editor. * - * @param {Object} eventData + * @param {object} eventData * Object with the property name and value and origin rule. * Example: { name: "font-size", value: "1em", rule: Object } */ @@ -858,11 +858,11 @@ class FontInspector { /** * Reveal a font's usage in the page. * - * @param {String} font + * @param {string} font * The name of the font to be revealed in the page. - * @param {Boolean} show + * @param {boolean} show * Whether or not to reveal the font. - * @param {Boolean} isForCurrentElement + * @param {boolean} isForCurrentElement * Optional. Default `true`. Whether or not to restrict revealing the font * just to the current element selection. */ @@ -1051,9 +1051,9 @@ class FontInspector { * TextProperty.setValue() which performs other actions, including marking the property * as "changed" in the Rule view with a green indicator. * - * @param {String} name + * @param {string} name * CSS property name - * @param {String}value + * @param {string}value * CSS property value */ updatePropertyValue(name, value) { diff --git a/devtools/client/inspector/fonts/test/browser_fontinspector_edit-previews.js b/devtools/client/inspector/fonts/test/browser_fontinspector_edit-previews.js @@ -37,7 +37,7 @@ add_task(async function () { * The FontInspector document. * @param {Array[String]} originalURIs * An array of URIs to compare with the current URIs. - * @param {Boolean} assertIdentical + * @param {boolean} assertIdentical * If true, this method asserts that the previous and current URIs are * identical. If false, this method asserts that the previous and current * URI's are different. diff --git a/devtools/client/inspector/fonts/test/browser_fontinspector_theme-change.js b/devtools/client/inspector/fonts/test/browser_fontinspector_theme-change.js @@ -52,8 +52,8 @@ add_task(async function () { /** * Sets the current theme and waits for fontinspector-updated event. * - * @param {String} theme - the new theme - * @param {Object} inspector - the inspector panel + * @param {string} theme - the new theme + * @param {object} inspector - the inspector panel */ async function setThemeAndWaitForUpdate(theme, inspector) { const onUpdated = inspector.once("fontinspector-updated"); diff --git a/devtools/client/inspector/fonts/test/head.js b/devtools/client/inspector/fonts/test/head.js @@ -19,10 +19,10 @@ var nodeConstants = require("resource://devtools/shared/dom-node-constants.js"); * the default selectNode isn't enough to guaranty that the panel has finished * updating. We also need to wait for the fontinspector-updated event. * - * @param {String|NodeFront} selector + * @param {string | NodeFront} selector * @param {InspectorPanel} inspector * The instance of InspectorPanel currently loaded in the toolbox. - * @param {String} reason + * @param {string} reason * Defaults to "test" which instructs the inspector not to highlight the * node upon selection. */ @@ -80,7 +80,7 @@ var openFontInspectorForURL = async function (url) { * preview images to be updated. * * @param {FontInspector} view - The FontInspector instance. - * @param {String} text - The text to preview. + * @param {string} text - The text to preview. */ async function updatePreviewText(view, text) { info(`Changing the preview text to '${text}'`); @@ -185,7 +185,7 @@ function getAllFontsEls(viewDoc) { * * @param {DOMNode} fontEl * The font element. - * @return {String} + * @return {string} * The name of the font as shown in the UI. */ function getName(fontEl) { @@ -197,7 +197,7 @@ function getName(fontEl) { * * @param {DOMNode} fontEl * The font element. - * @return {String} + * @return {string} * The URL where the font was loaded from as shown in the UI. */ function getURL(fontEl) { @@ -209,7 +209,7 @@ function getURL(fontEl) { * * @param {DOMNode} fontEl * The font element. - * @return {String} + * @return {string} * The name of the font family as shown in the UI. */ function getFamilyName(fontEl) { @@ -221,9 +221,9 @@ function getFamilyName(fontEl) { * * @param {Document} viewDoc * Host document of the font inspector panel. - * @param {String} name + * @param {string} name * Font property name or axis tag - * @return {Object} + * @return {object} * Object with the value and unit of the given font property or axis tag * from the corresponding input fron the font editor. * @Example: @@ -251,7 +251,7 @@ function getPropertyValue(viewDoc, name) { * * @param {DOMNode} fontEl * The font element. - * @return {Boolean} + * @return {boolean} */ function isRemote(fontEl) { return fontEl.querySelector(".font-origin").classList.contains("remote"); diff --git a/devtools/client/inspector/fonts/utils/font-utils.js b/devtools/client/inspector/fonts/utils/font-utils.js @@ -9,9 +9,9 @@ module.exports = { * Given a CSS unit type, get the amount by which to increment a numeric value. * Used as the step attribute in inputs of type "range" or "number". * - * @param {String} unit + * @param {string} unit * CSS unit type (px, %, em, rem, vh, vw, ...) - * @return {Number} + * @return {number} * Amount by which to increment. */ getStepForUnit(unit) { @@ -37,9 +37,9 @@ module.exports = { * Get the unit type from the end of a CSS value string. * Returns null for non-string input or unitless values. * - * @param {String} value + * @param {string} value * CSS value string. - * @return {String|null} + * @return {string | null} * CSS unit type, like "px", "em", "rem", etc or null. */ getUnitFromValue(value) { @@ -56,11 +56,11 @@ module.exports = { * axis tag names and corresponding values. If the string is a keyword or does not * contain axes, return an empty object. * - * @param {String} string + * @param {string} string * Value of font-variation-settings property coming from node's computed style. * Its contents are expected to be stable having been already parsed by the * browser. - * @return {Object} + * @return {object} */ parseFontVariationAxes(string) { let axes = {}; @@ -97,10 +97,10 @@ module.exports = { * this function does not pad with extra zeros. If the input is not a number, * the function throws an error. * - * @param {Number} number - * @param {Number} decimals + * @param {number} number + * @param {number} decimals * Decimal count in the output number. Default to one decimal. - * @return {Number} + * @return {number} */ toFixed(number, decimals = 1) { if (typeof number !== "number") { diff --git a/devtools/client/inspector/grids/actions/grid-highlighter.js b/devtools/client/inspector/grids/actions/grid-highlighter.js @@ -23,7 +23,7 @@ module.exports = { * * @param {NodeFront} nodeFront * Node that should be highlighted. - * @param {Object} options + * @param {object} options * Optional configuration options passed to the grid highlighter */ showGridHighlighter(nodeFront, options = {}) { diff --git a/devtools/client/inspector/grids/actions/grids.js b/devtools/client/inspector/grids/actions/grids.js @@ -16,7 +16,7 @@ module.exports = { * * @param {NodeFront} nodeFront * The NodeFront of the DOM node to toggle the grid highlighter. - * @param {String} color + * @param {string} color * The color to use for this nodeFront's grid highlighter. */ updateGridColor(nodeFront, color) { @@ -32,7 +32,7 @@ module.exports = { * * @param {NodeFront} nodeFront * The NodeFront of the DOM node to toggle the grid highlighter. - * @param {Boolean} highlighted + * @param {boolean} highlighted * Whether or not the grid highlighter is highlighting the grid. */ updateGridHighlighted(nodeFront, highlighted) { diff --git a/devtools/client/inspector/grids/actions/highlighter-settings.js b/devtools/client/inspector/grids/actions/highlighter-settings.js @@ -14,7 +14,7 @@ module.exports = { /** * Updates the grid highlighter's show grid areas preference. * - * @param {Boolean} enabled + * @param {boolean} enabled * Whether or not the grid highlighter should show the grid areas. */ updateShowGridAreas(enabled) { @@ -27,7 +27,7 @@ module.exports = { /** * Updates the grid highlighter's show grid line numbers preference. * - * @param {Boolean} enabled + * @param {boolean} enabled * Whether or not the grid highlighter should show the grid line numbers. */ updateShowGridLineNumbers(enabled) { @@ -40,7 +40,7 @@ module.exports = { /** * Updates the grid highlighter's show infinite lines preference. * - * @param {Boolean} enabled + * @param {boolean} enabled * Whether or not the grid highlighter should extend grid lines infinitely. */ updateShowInfiniteLines(enabled) { diff --git a/devtools/client/inspector/grids/components/GridOutline.js b/devtools/client/inspector/grids/components/GridOutline.js @@ -141,13 +141,13 @@ class GridOutline extends PureComponent { * Returns the grid area name if the given grid cell is part of a grid area, otherwise * null. * - * @param {Number} columnNumber + * @param {number} columnNumber * The column number of the grid cell. - * @param {Number} rowNumber + * @param {number} rowNumber * The row number of the grid cell. * @param {Array} areas * Array of grid areas data stored in the grid fragment. - * @return {String} If there is a grid area return area name, otherwise null. + * @return {string} If there is a grid area return area name, otherwise null. */ getGridAreaName(columnNumber, rowNumber, areas) { const gridArea = areas.find( @@ -168,7 +168,7 @@ class GridOutline extends PureComponent { /** * Returns the height of the grid outline ranging between a minimum and maximum height. * - * @return {Number} The height of the grid outline. + * @return {number} The height of the grid outline. */ getHeight() { const { height } = this.state; @@ -199,7 +199,7 @@ class GridOutline extends PureComponent { /** * Renders the grid outline for the given grid container object. * - * @param {Object} grid + * @param {object} grid * A single grid container in the document. */ renderGrid(grid) { @@ -282,23 +282,23 @@ class GridOutline extends PureComponent { /** * Renders the grid cell of a grid fragment. * - * @param {Number} id + * @param {number} id * The grid id stored on the grid fragment - * @param {Number} gridFragmentIndex + * @param {number} gridFragmentIndex * The index of the grid fragment rendered to the document. - * @param {Number} x + * @param {number} x * The x-position of the grid cell. - * @param {Number} y + * @param {number} y * The y-position of the grid cell. - * @param {Number} rowNumber + * @param {number} rowNumber * The row number of the grid cell. - * @param {Number} columnNumber + * @param {number} columnNumber * The column number of the grid cell. - * @param {String|null} gridAreaName + * @param {string | null} gridAreaName * The grid area name or null if the grid cell is not part of a grid area. - * @param {Number} width + * @param {number} width * The width of grid cell. - * @param {Number} height + * @param {number} height * The height of the grid cell. */ renderGridCell( @@ -404,9 +404,9 @@ class GridOutline extends PureComponent { /** * Get the width and height of a given grid. * - * @param {Object} grid + * @param {object} grid * A single grid container in the document. - * @return {Object} An object like { width, height } + * @return {object} An object like { width, height } */ function getTotalWidthAndHeight(grid) { // TODO: We are drawing the first fragment since only one is currently being stored. diff --git a/devtools/client/inspector/grids/grid-inspector.js b/devtools/client/inspector/grids/grid-inspector.js @@ -189,11 +189,11 @@ class GridInspector { * * @param {NodeFront} nodeFront * The NodeFront for which we need the color. - * @param {String} customColor + * @param {string} customColor * The color fetched from the custom palette, if it exists. - * @param {String} fallbackColor + * @param {string} fallbackColor * The color to use if no color could be found for the node front. - * @return {String} color + * @return {string} color * The color to use. */ getInitialGridColor(nodeFront, customColor, fallbackColor) { @@ -243,7 +243,7 @@ class GridInspector { * * @param {Array} newGridFronts * A list of GridFront objects. - * @return {Boolean} + * @return {boolean} */ haveCurrentFragmentsChanged(newGridFronts) { const gridHighlighters = this.highlighters.gridHighlighters; @@ -479,7 +479,7 @@ class GridInspector { * @param {NodeFront} nodeFront * The NodeFront of the grid container element for which the grid highlighter * is shown for. - * @param {Boolean} highlighted + * @param {boolean} highlighted * If the grid should be updated to highlight or hide. */ onHighlighterChange(nodeFront, highlighted) { @@ -572,7 +572,7 @@ class GridInspector { * @param {NodeFront} node * The NodeFront of the grid container element for which the grid color is * being updated. - * @param {String} color + * @param {string} color * A hex string representing the color to use. */ async onSetGridOverlayColor(node, color) { @@ -658,7 +658,7 @@ class GridInspector { * component. Toggles on/off the option to show the grid areas in the grid highlighter. * Refreshes the shown grid highlighter for the grids currently highlighted. * - * @param {Boolean} enabled + * @param {boolean} enabled * Whether or not the grid highlighter should show the grid areas. */ onToggleShowGridAreas(enabled) { @@ -680,7 +680,7 @@ class GridInspector { * numbers in the grid highlighter. Refreshes the shown grid highlighter for the * grids currently highlighted. * - * @param {Boolean} enabled + * @param {boolean} enabled * Whether or not the grid highlighter should show the grid line numbers. */ onToggleShowGridLineNumbers(enabled) { @@ -702,7 +702,7 @@ class GridInspector { * lines infinitely in the grid highlighter. Refreshes the shown grid highlighter * for grids currently highlighted. * - * @param {Boolean} enabled + * @param {boolean} enabled * Whether or not the grid highlighter should extend grid lines infinitely. */ onToggleShowInfiniteLines(enabled) { @@ -725,7 +725,7 @@ class GridInspector { * * @param {Error} error * The original error object. - * @param {String} message + * @param {string} message * The message to log in case the inspector is already destroyed and * the error is swallowed. */ @@ -744,9 +744,9 @@ class GridInspector { * * @param {Array} grids * A list of grid data. - * @param {Object} parent + * @param {object} parent * A grid data of parent. - * @param {Number} zIndex + * @param {number} zIndex * z-index for the parent. */ _updateZOrder(grids, parent, zIndex = 0) { diff --git a/devtools/client/inspector/grids/test/head.js b/devtools/client/inspector/grids/test/head.js @@ -22,7 +22,7 @@ registerCleanupFunction(async function () { * * @param {Document} doc * The owner document for the grid inspector. - * @param {Number} gridCellIndex + * @param {number} gridCellIndex * The index (0-based) of the grid cell that should be hovered. */ function synthesizeMouseOverOnGridCell(doc, gridCellIndex = 0) { @@ -40,10 +40,10 @@ function synthesizeMouseOverOnGridCell(doc, gridCellIndex = 0) { /** * Returns the number of visible grid highlighters * - * @param {Object} options - * @param {Boolean} options.isParent: Pass false/true if only the parent/child grid highlighter + * @param {object} options + * @param {boolean} options.isParent: Pass false/true if only the parent/child grid highlighter * should be counted. - * @returns {Number} + * @returns {number} */ function getNumberOfVisibleGridHighlighters({ isParent } = {}) { return SpecialPowers.spawn( diff --git a/devtools/client/inspector/grids/utils/utils.js b/devtools/client/inspector/grids/utils/utils.js @@ -15,7 +15,7 @@ * A list of gridFragment objects. * @param {Array} fragments2 * Another list of gridFragment objects to compare to the first list. - * @return {Boolean} + * @return {boolean} * True if the fragments are the same, false otherwise. */ function compareFragmentsGeometry(fragments1, fragments2) { diff --git a/devtools/client/inspector/inspector-search.js b/devtools/client/inspector/inspector-search.js @@ -460,7 +460,7 @@ class SelectorAutocompleter extends EventEmitter { * Populates the suggestions list and show the suggestion popup. * * @param {Array} suggestions: List of suggestions - * @param {String|null} popupState: One of SelectorAutocompleter.States + * @param {string | null} popupState: One of SelectorAutocompleter.States * @return {Promise} promise that will resolve when the autocomplete popup is fully * displayed or hidden. */ diff --git a/devtools/client/inspector/inspector.js b/devtools/client/inspector/inspector.js @@ -203,14 +203,14 @@ class Inspector extends EventEmitter { * Set any attributes or listeners that rely on the document being loaded or fronts * from the InspectorFront and Target here. * - * @param {Object} options + * @param {object} options * @param {NodeFront|undefined} options.defaultStartupNode: Optional node front that * will be selected when the first root node is available. * @param {ElementIdentifier|undefined} options.defaultStartupNodeDomReference: Optional * element identifier whose matching node front will be selected when the first * root node is available. * Will be ignored if defaultStartupNode is passed. - * @param {String|undefined} options.defaultStartupNodeSelectionReason: Optional string + * @param {string | undefined} options.defaultStartupNodeSelectionReason: Optional string * that will be used as a reason for the node selection when either * defaultStartupNode or defaultStartupNodeDomReference is passed * @returns {Inspector} @@ -885,7 +885,7 @@ class Inspector extends EventEmitter { /** * Check if the inspector should use the landscape mode. * - * @return {Boolean} true if the inspector should be in landscape mode. + * @return {boolean} true if the inspector should be in landscape mode. */ #useLandscapeMode() { if (!this.panelDoc) { @@ -1404,10 +1404,10 @@ class Inspector extends EventEmitter { * Create a side-panel tab controlled by an extension * using the devtools.panels.elements.createSidebarPane and sidebar object API * - * @param {String} id + * @param {string} id * An unique id for the sidebar tab. - * @param {Object} options - * @param {String} options.title + * @param {object} options + * @param {string} options.title * The tab title */ addExtensionSidebar(id, { title }) { @@ -1441,7 +1441,7 @@ class Inspector extends EventEmitter { * extension has been disable/uninstalled while the toolbox and inspector were * still open). * - * @param {String} id + * @param {string} id * The id of the sidebar tab to destroy. */ removeExtensionSidebar(id) { @@ -1483,7 +1483,7 @@ class Inspector extends EventEmitter { * Method to check whether the document is a HTML document and * pickColorFromPage method is available or not. * - * @return {Boolean} true if the eyedropper highlighter is supported by the current + * @return {boolean} true if the eyedropper highlighter is supported by the current * document. */ async supportsEyeDropper() { @@ -1613,7 +1613,7 @@ class Inspector extends EventEmitter { /** * Can a new HTML element be inserted into the currently selected element? * - * @return {Boolean} + * @return {boolean} */ canAddHTMLChild() { const selection = this.selection; diff --git a/devtools/client/inspector/markup/markup-context-menu.js b/devtools/client/inspector/markup/markup-context-menu.js @@ -278,7 +278,7 @@ class MarkupContextMenu { /** * Paste the contents of the clipboard as adjacent HTML to the selected Node. * - * @param {String} position + * @param {string} position * The position as specified for Element.insertAdjacentHTML * (i.e. "beforeBegin", "afterBegin", "beforeEnd", "afterEnd"). */ diff --git a/devtools/client/inspector/markup/markup.js b/devtools/client/inspector/markup/markup.js @@ -806,7 +806,7 @@ class MarkupView extends EventEmitter { * * @param {NodeFront} nodeFront * The node for which to show the highlighter. - * @param {Object} options + * @param {object} options * Configuration object with options for the Box Model Highlighter. * @return {Promise} Resolves after the highlighter for this nodeFront is shown. */ @@ -835,9 +835,9 @@ class MarkupView extends EventEmitter { * This is the place to observe for highlighter events, check the highlighter type and * event name, then react for example by modifying the DOM. * - * @param {String} eventName + * @param {string} eventName * Highlighter event name. One of: "highlighter-hidden", "highlighter-shown" - * @param {Object} data + * @param {object} data * Object with data associated with the highlighter event. * {String} data.type * Highlighter type @@ -898,7 +898,7 @@ class MarkupView extends EventEmitter { * * @param {NodeFront} nodeFront * The node to get the container for. - * @param {Boolean} slotted + * @param {boolean} slotted * true to get the slotted version of the container. * @return {MarkupContainer} The container for the provided node. */ @@ -912,7 +912,7 @@ class MarkupView extends EventEmitter { * * @param {NodeFront} nodeFront * The node to set the container for. - * @param {Boolean} slotted + * @param {boolean} slotted * true if the container represents the slotted version of the node. */ setContainer(node, container, slotted) { @@ -925,9 +925,9 @@ class MarkupView extends EventEmitter { * * @param {NodeFront} nodeFront * The node to check. - * @param {Boolean} slotted + * @param {boolean} slotted * true to check for a container matching the slotted version of the node. - * @return {Boolean} True if a container exists, false otherwise. + * @return {boolean} True if a container exists, false otherwise. */ hasContainer(node, slotted) { const key = this._getContainerKey(node, slotted); @@ -1050,7 +1050,7 @@ class MarkupView extends EventEmitter { * all the listeners. * * @param {NodeFront|undefined} nodeFront - * @param {String|undefined} reason + * @param {string | undefined} reason */ _onNewSelection(nodeFront, reason) { const selection = this.inspector.selection; @@ -1163,7 +1163,7 @@ class MarkupView extends EventEmitter { /** * Highlight search results in the markup view. * - * @param {String|null} searchQuery: The search string we want to highlight. Pass null + * @param {string | null} searchQuery: The search string we want to highlight. Pass null * to clear existing highlighting. */ _updateSearchResultsHighlightingInSelectedNode(searchQuery) { @@ -1483,7 +1483,7 @@ class MarkupView extends EventEmitter { * If there's an attribute on the current node that's currently focused, then * delete this attribute, otherwise delete the node itself. * - * @param {Boolean} moveBackward + * @param {boolean} moveBackward * If set to true and if we're deleting the node, focus the previous * sibling after deletion, otherwise the next one. */ @@ -1522,7 +1522,7 @@ class MarkupView extends EventEmitter { * * @param {NodeFront} node * The node to remove. - * @param {Boolean} moveBackward + * @param {boolean} moveBackward * If set to true, focus the previous sibling, otherwise the next one. */ deleteNode(node, moveBackward) { @@ -1644,9 +1644,9 @@ class MarkupView extends EventEmitter { * * @param {NodeFront} node * The node in the content document. - * @param {Boolean} flashNode + * @param {boolean} flashNode * Whether the newly imported node should be flashed - * @param {Boolean} slotted + * @param {boolean} slotted * Whether we are importing the slotted version of the node. * @return {MarkupContainer} The MarkupContainer object for this element. */ @@ -1866,11 +1866,11 @@ class MarkupView extends EventEmitter { * node is scrolled on to screen. * * @param {NodeFront} nodeFront - * @param {Object} options - * @param {Boolean} options.centered - * @param {Boolean} options.scroll - * @param {Boolean} options.slotted - * @param {Boolean} options.smoothScroll + * @param {object} options + * @param {boolean} options.centered + * @param {boolean} options.scroll + * @param {boolean} options.slotted + * @param {boolean} options.smoothScroll * @returns */ showNode( @@ -1998,7 +1998,7 @@ class MarkupView extends EventEmitter { * * @param {NodeFront} node * The NodeFront to get the outerHTML / innerHTML for. - * @param {Boolean} isOuter + * @param {boolean} isOuter * If true, makes the function return the outerHTML, * otherwise the innerHTML. * @return {Promise} that will be resolved with the outerHTML / innerHTML. @@ -2120,9 +2120,9 @@ class MarkupView extends EventEmitter { * * @param {NodeFront} node * Node which outerHTML will be replaced. - * @param {String} newValue + * @param {string} newValue * The new outerHTML to set on the node. - * @param {String} oldValue + * @param {string} oldValue * The old outerHTML that will be used if the user undoes the update. * @return {Promise} that will resolve when the outer HTML has been updated. */ @@ -2146,9 +2146,9 @@ class MarkupView extends EventEmitter { * * @param {Node} node * node which innerHTML will be replaced. - * @param {String} newValue + * @param {string} newValue * The new innerHTML to set on the node. - * @param {String} oldValue + * @param {string} oldValue * The old innerHTML that will be used if the user undoes the update. * @return {Promise} that will resolve when the inner HTML has been updated. */ @@ -2175,10 +2175,10 @@ class MarkupView extends EventEmitter { * * @param {NodeFront} node * The reference node. - * @param {String} position + * @param {string} position * The position as specified for Element.insertAdjacentHTML * (i.e. "beforeBegin", "afterBegin", "beforeEnd", "afterEnd"). - * @param {String} newValue + * @param {string} newValue * The adjacent HTML. * @return {Promise} that will resolve when the adjacent HTML has * been inserted. @@ -2263,9 +2263,9 @@ class MarkupView extends EventEmitter { * * @param {NodeFront} node * The NodeFront to update. - * @param {Boolean} expanded + * @param {boolean} expanded * Whether the node should be expanded/collapsed. - * @param {Boolean} applyToDescendants + * @param {boolean} applyToDescendants * Whether all descendants should also be expanded/collapsed */ setNodeExpanded(node, expanded, applyToDescendants) { @@ -2288,7 +2288,7 @@ class MarkupView extends EventEmitter { * * @param {NodeFront} node * The NodeFront to mark as selected. - * @return {Boolean} False if the node is already marked as selected, true + * @return {boolean} False if the node is already marked as selected, true * otherwise. */ markNodeAsSelected(node) { @@ -2412,7 +2412,7 @@ class MarkupView extends EventEmitter { * * @param {MarkupContainer} container * The markup container whose children need updating - * @param {Object} options + * @param {object} options * Options are {expand:boolean,flash:boolean} * @return {Promise} that will be resolved when the children are ready * (which may be immediately). diff --git a/devtools/client/inspector/markup/test/browser_markup_grid_display_badge_03.js b/devtools/client/inspector/markup/test/browser_markup_grid_display_badge_03.js @@ -37,9 +37,9 @@ add_task(async function () { * Enable the flex or grid highlighter by clicking on the corresponding badge * next to a node in the markup view. Returns the badge element. * - * @param {String} type + * @param {string} type * Either "flex" or "grid" - * @param {String} selector + * @param {string} selector * Selector matching the flex or grid container element. * @param {Inspector} inspector * Instance of Inspector panel diff --git a/devtools/client/inspector/markup/test/browser_markup_keybindings_scrolltonode.js b/devtools/client/inspector/markup/test/browser_markup_keybindings_scrolltonode.js @@ -70,9 +70,9 @@ add_task(async function () { * of the viewport, depending on the provided "expected" argument. * Returns a promise that will resolve when the test has been performed. * - * @param {String} selector + * @param {string} selector * css selector for the element to test - * @param {Boolean} expected + * @param {boolean} expected * true if the element is expected to be in the viewport, false otherwise * @return {Promise} promise */ diff --git a/devtools/client/inspector/markup/test/events/helper_events_test_runner.js b/devtools/client/inspector/markup/test/events/helper_events_test_runner.js @@ -33,7 +33,7 @@ async function runEventPopupTests(url, tests) { * Generator function that takes a selector and expected results and returns * the event info. * - * @param {Object} test + * @param {object} test * A test object should contain the following properties: * - selector {String} a css selector targeting the node to edit * - expected {Array} array of expected event objects @@ -261,11 +261,11 @@ function getDocMarkupEventsJQueryLoadHandlerText() { /** * Create diff of two strings. * - * @param {String} text1 + * @param {string} text1 * String to compare with text2. - * @param {String} text2 [description] + * @param {string} text2 [description] * String to compare with text1. - * @param {String} msg + * @param {string} msg * Message to display on failure. A diff will be displayed after this * message. */ diff --git a/devtools/client/inspector/markup/test/head.js b/devtools/client/inspector/markup/test/head.js @@ -31,7 +31,7 @@ SimpleTest.requestCompleteLog(); * separate directory. * The script will be loaded synchronously and in the test's scope. * - * @param {String} filePath The file path, relative to the current directory. + * @param {string} filePath The file path, relative to the current directory. * Examples: * - "helper_attributes_test_runner.js" */ @@ -57,10 +57,10 @@ function getContainerForNodeFront(nodeFront, { markup }) { * Get the MarkupContainer object instance that corresponds to the given * selector * - * @param {String|NodeFront} selector + * @param {string | NodeFront} selector * @param {InspectorPanel} inspector The instance of InspectorPanel currently * loaded in the toolbox - * @param {Boolean} Set to true in the event that the node shouldn't be found. + * @param {boolean} Set to true in the event that the node shouldn't be found. * @return {MarkupContainer} */ var getContainerForSelector = async function ( @@ -84,8 +84,8 @@ var getContainerForSelector = async function ( /** * Retrieve the nodeValue for the firstChild of a provided selector on the content page. * - * @param {String} selector - * @return {String} the nodeValue of the first + * @param {string} selector + * @return {string} the nodeValue of the first */ function getFirstChildNodeValue(selector) { return SpecialPowers.spawn( @@ -119,7 +119,7 @@ function waitForChildrenUpdated({ markup }) { * Simulate a click on the markup-container (a line in the markup-view) * that corresponds to the selector passed. * - * @param {String|NodeFront} selector + * @param {string | NodeFront} selector * @param {InspectorPanel} inspector The instance of InspectorPanel currently * loaded in the toolbox * @return {Promise} Resolves when the node has been selected. @@ -151,7 +151,7 @@ var clickContainer = async function (selector, inspector) { * * @param {DOMNode} field The element that gets editable after receiving focus * and <ENTER> keypress - * @param {String} value The string value to be set into the edited field + * @param {string} value The string value to be set into the edited field * @param {InspectorPanel} inspector The instance of InspectorPanel currently * loaded in the toolbox */ @@ -169,8 +169,8 @@ function setEditableFieldValue(field, value, inspector) { * and enters the given text, then wait for it to be applied and the for the * node to mutates (when new attribute(s) is(are) created) * - * @param {String} selector The selector for the node to edit. - * @param {String} text The new attribute text to be entered (e.g. "id='test'") + * @param {string} selector The selector for the node to edit. + * @param {string} text The new attribute text to be entered (e.g. "id='test'") * @param {InspectorPanel} inspector The instance of InspectorPanel currently * loaded in the toolbox * @return a promise that resolves when the node has mutated @@ -190,8 +190,8 @@ var addNewAttributes = async function (selector, text, inspector) { /** * Checks that a node has the given attributes. * - * @param {String} selector The selector for the node to check. - * @param {Object} expected An object containing the attributes to check. + * @param {string} selector The selector for the node to check. + * @param {object} expected An object containing the attributes to check. * e.g. {id: "id1", class: "someclass"} * * Note that node.getAttribute() returns attribute values provided by the HTML @@ -264,7 +264,7 @@ function redoChange(inspector) { * * @param {NodeFront} nodeFront * @param {InspectorPanel} inspector - * @param {Boolean} assert Should this function run assertions inline. + * @param {boolean} assert Should this function run assertions inline. * @return A promise that resolves with a boolean indicating whether * the menu items are disabled once the menu has been checked. */ @@ -306,7 +306,7 @@ var isEditingMenuDisabled = async function ( * * @param {NodeFront} nodeFront * @param {InspectorPanel} inspector - * @param {Boolean} assert Should this function run assertions inline. + * @param {boolean} assert Should this function run assertions inline. * @return A promise that resolves with a boolean indicating whether * the menu items are enabled once the menu has been checked. */ @@ -363,7 +363,7 @@ function promiseNextTick() { * * @param {Promise} promise * Promise to resolve - * @param {Number} ms + * @param {number} ms * Milliseconds to wait. * @return "timeout" on timeout, otherwise the result of the fulfilled promise. */ @@ -405,8 +405,8 @@ function collapseSelectionAndShiftTab(inspector) { * Check that the current focused element is an attribute element in the markup * view. * - * @param {String} attrName The attribute name expected to be found - * @param {Boolean} editMode Whether or not the attribute should be in edit mode + * @param {string} attrName The attribute name expected to be found + * @param {boolean} editMode Whether or not the attribute should be in edit mode */ function checkFocusedAttribute(attrName, editMode) { const focusedAttr = Services.focus.focusedElement; @@ -425,7 +425,7 @@ function checkFocusedAttribute(attrName, editMode) { /** * Get attributes for node as how they are represented in editor. * - * @param {String} selector + * @param {string} selector * @param {InspectorPanel} inspector * @return {Promise} * A promise that resolves with an array of attribute names @@ -444,10 +444,10 @@ var getAttributesFromEditor = async function (selector, inspector) { * handlers. * * @param {InspectorPanel} inspector The current inspector-panel instance. - * @param {String|MarkupContainer} selector The selector to identify the node or + * @param {string | MarkupContainer} selector The selector to identify the node or * the MarkupContainer for this node. - * @param {Number} xOffset Optional x offset to drag by. - * @param {Number} yOffset Optional y offset to drag by. + * @param {number} xOffset Optional x offset to drag by. + * @param {number} yOffset Optional y offset to drag by. */ async function simulateNodeDrag( inspector, @@ -492,7 +492,7 @@ async function simulateNodeDrag( * meant to be called after simulateNodeDrag has been called. * * @param {InspectorPanel} inspector The current inspector-panel instance. - * @param {String|MarkupContainer} selector The selector to identify the node or + * @param {string | MarkupContainer} selector The selector to identify the node or * the MarkupContainer for this node. */ async function simulateNodeDrop(inspector, selector) { @@ -510,10 +510,10 @@ async function simulateNodeDrop(inspector, selector) { * mousemove and mouseup handlers. * * @param {InspectorPanel} inspector The current inspector-panel instance. - * @param {String|MarkupContainer} selector The selector to identify the node or + * @param {string | MarkupContainer} selector The selector to identify the node or * the MarkupContainer for this node. - * @param {Number} xOffset Optional x offset to drag by. - * @param {Number} yOffset Optional y offset to drag by. + * @param {number} xOffset Optional x offset to drag by. + * @param {number} yOffset Optional y offset to drag by. */ async function simulateNodeDragAndDrop(inspector, selector, xOffset, yOffset) { await simulateNodeDrag(inspector, selector, xOffset, yOffset); @@ -552,9 +552,9 @@ async function waitForScrollStop(doc) { * * @param {InspectorPanel} inspector * The current inspector-panel instance. - * @param {String} key + * @param {string} key * The key to simulate to delete the node - * @param {Object} + * @param {object} * - {String} selector: selector of the element to delete. * - {String} focusedSelector: selector of the element that should be selected * after deleting the node. diff --git a/devtools/client/inspector/markup/test/helper_attributes_test_runner.js b/devtools/client/inspector/markup/test/helper_attributes_test_runner.js @@ -14,7 +14,7 @@ * the test runner will check if all the new attributes are gone. * * @param {Array} tests See runAddAttributesTest for the structure - * @param {DOMNode|String} nodeOrSelector The node or node selector + * @param {DOMNode | string} nodeOrSelector The node or node selector * corresponding to an element on the current test page that has *no attributes* * when the test starts. It will be used to add and remove attributes. * @param {InspectorPanel} inspector The instance of InspectorPanel currently @@ -37,10 +37,10 @@ function runAddAttributesTests(tests, nodeOrSelector, inspector) { * Run a single add-attribute test. * See runAddAttributesTests for a description. * - * @param {Object} test A test object should contain the following properties: - * - desc {String} a textual description for that test, to help when + * @param {object} test A test object should contain the following properties: + * - desc {string} a textual description for that test, to help when * reading logs - * - text {String} the string to be inserted into the new attribute field + * - text {string} the string to be inserted into the new attribute field * - expectedAttributes {Object} a key/value pair object that will be * used to check the attributes on the test element * - validate {Function} optional extra function that will be called @@ -50,7 +50,7 @@ function runAddAttributesTests(tests, nodeOrSelector, inspector) { * - {DOMNode} The element being tested * - {MarkupContainer} The corresponding container in the markup-view * - {InspectorPanel} The instance of the InspectorPanel opened - * @param {String} selector The node selector corresponding to the test element + * @param {string} selector The node selector corresponding to the test element * @param {InspectorPanel} inspector The instance of InspectorPanel currently * opened */ @@ -110,7 +110,7 @@ function runEditAttributesTests(tests, inspector) { * Run a single edit-attribute test. * See runEditAttributesTests for a description. * - * @param {Object} test A test object should contain the following properties: + * @param {object} test A test object should contain the following properties: * - desc {String} a textual description for that test, to help when * reading logs * - node {String} a css selector that will be used to select the node diff --git a/devtools/client/inspector/markup/test/helper_markup_accessibility_navigation.js b/devtools/client/inspector/markup/test/helper_markup_accessibility_navigation.js @@ -11,7 +11,7 @@ * * @param {InspectorPanel} inspector * Current instance of the inspector being tested. - * @param {Object} elms + * @param {object} elms * Map of elements that will be used to retrieve live references to children * elements * @param {Element} focused @@ -33,9 +33,9 @@ function testNavigationState(inspector, elms, focused, activedescendant) { /** * Lookup the provided dotted path ("prop1.subprop2.myProp") in the provided object. * - * @param {Object} obj + * @param {object} obj * Object to expand. - * @param {String} path + * @param {string} path * Dotted path to use to expand the object. * @return {?} anything that is found at the provided path in the object. */ @@ -50,10 +50,10 @@ function lookupPath(obj, path) { * * @param {InspectorPanel} inspector * Current instance of the inspector being tested. - * @param {Object} elms + * @param {object} elms * MarkupContainers/Elements that will be used to retrieve references to other * elements based on objects' paths. - * @param {Object} testData + * @param {object} testData * - {String} desc: description for better logging. * - {String} key: keyboard event's key. * - {Object} options, optional: event data such as shiftKey, etc. diff --git a/devtools/client/inspector/markup/test/helper_outerhtml_test_runner.js b/devtools/client/inspector/markup/test/helper_outerhtml_test_runner.js @@ -32,7 +32,7 @@ function runEditOuterHTMLTests(tests, inspector) { * Run a single edit-outer-html test. * See runEditOuterHTMLTests for a description. * - * @param {Object} test A test object should contain the following properties: + * @param {object} test A test object should contain the following properties: * - selector {String} a css selector targeting the node to edit * - oldHTML {String} * - newHTML {String} diff --git a/devtools/client/inspector/markup/utils.js b/devtools/client/inspector/markup/utils.js @@ -12,11 +12,11 @@ const FLASH_TARGETS_SELECTOR = "[class*=theme-fg-color], .force-color-on-flash"; * * @param {Node} backgroundElt * The element to set the highlighted background color on. - * @param {Object} options + * @param {object} options * @param {Node} options.foregroundElt * The element to set the matching foreground color on. This will equal * backgroundElt if not set. - * @param {String} options.backgroundClass + * @param {string} options.backgroundClass * The background highlight color class to set on the element. */ function flashElementOn( @@ -45,11 +45,11 @@ function flashElementOn( * * @param {Node} backgroundElt * The element to remove the highlighted background color on. - * @param {Object} options + * @param {object} options * @param {Node} options.foregroundElt * The element to remove the matching foreground color on. This will equal * backgroundElt if not set. - * @param {String} options.backgroundClass + * @param {string} options.backgroundClass * The background highlight color class to remove on the element. */ function flashElementOff( @@ -88,7 +88,7 @@ function getAutocompleteMaxWidth(element, container) { /** * Parse attribute names and values from a string. * - * @param {String} attr + * @param {string} attr * The input string for which names/values are to be parsed. * @param {HTMLDocument} doc * A document that can be used to test valid attributes. diff --git a/devtools/client/inspector/markup/views/element-editor.js b/devtools/client/inspector/markup/views/element-editor.js @@ -271,7 +271,7 @@ ElementEditor.prototype = { * * @param {DOMNode} node * The node to get information from. - * @return {Object} An object literal with the following information: + * @return {object} An object literal with the following information: * {type: "attribute", name: "rel", value: "index", el: node} */ getInfoAtNode(node) { @@ -584,7 +584,7 @@ ElementEditor.prototype = { /** * Show overflow highlight if showOverflowHighlight is true, otherwise hide it. * - * @param {Boolean} showOverflowHighlight + * @param {boolean} showOverflowHighlight */ setOverflowHighlight(showOverflowHighlight) { this.container.tagState.classList.toggle( @@ -661,7 +661,7 @@ ElementEditor.prototype = { /** * Get the element used for one of the attributes of this element. * - * @param {String} attrName + * @param {string} attrName * The name of the attribute to get the element for * @return {DOMNode} */ @@ -674,7 +674,7 @@ ElementEditor.prototype = { /** * Remove an attribute from the attrElements object and the DOM. * - * @param {String} attrName + * @param {string} attrName * The name of the attribute to remove */ removeAttribute(attrName) { @@ -753,7 +753,7 @@ ElementEditor.prototype = { /** * Setup the editable field for the given attribute. * - * @param {Object} attribute + * @param {object} attribute * An object containing the name and value of a DOM attribute. * @param {Element} attrEditorEl * The attribute container <span class="attreditor"> element. @@ -847,7 +847,7 @@ ElementEditor.prototype = { /** * Appends the attribute value to the given attribute value <span> element. * - * @param {Object} attribute + * @param {object} attribute * An object containing the name and value of a DOM attribute. * @param {Element} attributeValueEl * The attribute value <span class="attr-value"> element to append @@ -911,9 +911,9 @@ ElementEditor.prototype = { * Truncates the given attribute value if it is a base64 data URL or the * collapse attributes pref is enabled. * - * @param {String} value + * @param {string} value * Attribute value. - * @return {String} truncated attribute value. + * @return {string} truncated attribute value. */ _truncateAttributeValue(value) { if (value && value.match(COLLAPSE_DATA_URL_REGEX)) { @@ -929,7 +929,7 @@ ElementEditor.prototype = { * Parse a user-entered attribute string and apply the resulting * attributes to the node. This operation is undoable. * - * @param {String} value + * @param {string} value * The user-entered value. * @param {DOMNode} attrNode * The attribute editor that created this diff --git a/devtools/client/inspector/markup/views/html-editor.js b/devtools/client/inspector/markup/views/html-editor.js @@ -127,7 +127,7 @@ class HTMLEditor extends EventEmitter { * @param {DOMNode} element * The element that the editor will be anchored to. * Should belong to the HTMLDocument passed into the constructor. - * @param {String} text + * @param {string} text * Value to set the contents of the editor to * @param {Function} cb * The function to call when hiding @@ -151,7 +151,7 @@ class HTMLEditor extends EventEmitter { /** * Hide the editor, optionally committing the changes * - * @param {Boolean} shouldCommit + * @param {boolean} shouldCommit * A change will be committed by default. If this param * strictly equals false, no change will occur. */ diff --git a/devtools/client/inspector/markup/views/markup-container.js b/devtools/client/inspector/markup/views/markup-container.js @@ -38,7 +38,7 @@ function MarkupContainer() {} /** * Unique identifier used to set markup container node id. * - * @type {Number} + * @type {number} */ let markupContainerID = 0; @@ -57,7 +57,7 @@ MarkupContainer.prototype = { * The markup view that owns this container. * @param {NodeFront} node * The node to display. - * @param {String} type + * @param {string} type * The type of container to build. One of TYPES.TEXT_CONTAINER, * TYPES.ELEMENT_CONTAINER, TYPES.READ_ONLY_CONTAINER */ @@ -610,8 +610,8 @@ MarkupContainer.prototype = { /** * Open a "link" found in a node's attribute in the markup-view * - * @param {String} type: A node-attribute-parser.js ATTRIBUTE_TYPES - * @param {String} link: A "link" as returned by the `parseAttribute` function from + * @param {string} type: A node-attribute-parser.js ATTRIBUTE_TYPES + * @param {string} link: A "link" as returned by the `parseAttribute` function from * node-attribute-parser.js . This can be an actual URL, but could be * something else (e.g. an element id). */ @@ -815,8 +815,8 @@ MarkupContainer.prototype = { /** * Try to put keyboard focus on the current editor. * - * @param {Object} options - * @param {Boolean} options.fromMouseEvent: Set to true if this is called from a mouse event. + * @param {object} options + * @param {boolean} options.fromMouseEvent: Set to true if this is called from a mouse event. */ focus({ fromMouseEvent = false } = {}) { // Elements with tabindex of -1 are not focusable. @@ -852,7 +852,7 @@ MarkupContainer.prototype = { /** * Expands the markup container if it has children. * - * @param {Boolean} applyToDescendants + * @param {boolean} applyToDescendants * Whether all descendants should also be expanded/collapsed */ expandContainer(applyToDescendants) { diff --git a/devtools/client/inspector/markup/views/read-only-editor.js b/devtools/client/inspector/markup/views/read-only-editor.js @@ -56,7 +56,7 @@ ReadOnlyEditor.prototype = { /** * Show overflow highlight if showOverflowHighlight is true, otherwise hide it. * - * @param {Boolean} showOverflowHighlight + * @param {boolean} showOverflowHighlight */ setOverflowHighlight(showOverflowHighlight) { this.container.tagState.classList.toggle( diff --git a/devtools/client/inspector/markup/views/root-container.js b/devtools/client/inspector/markup/views/root-container.js @@ -40,7 +40,7 @@ RootContainer.prototype = { /** * Set the expanded state of the container node. * - * @param {Boolean} value + * @param {boolean} value */ setExpanded() {}, diff --git a/devtools/client/inspector/markup/views/text-editor.js b/devtools/client/inspector/markup/views/text-editor.js @@ -39,7 +39,7 @@ loader.lazyRequireGetter( * The container owning this editor. * @param {DOMNode} node * The node being edited. - * @param {String} type + * @param {string} type * The type of editor to build. This can be either 'text' or 'comment'. */ function TextEditor(container, node, type) { diff --git a/devtools/client/inspector/node-picker.js b/devtools/client/inspector/node-picker.js @@ -40,7 +40,7 @@ class NodePicker extends EventEmitter { /** * Start/stop the element picker on the debuggee target. * - * @param {Boolean} doFocus + * @param {boolean} doFocus * Optionally focus the content area once the picker is activated. * @return Promise that resolves when done */ @@ -79,7 +79,7 @@ class NodePicker extends EventEmitter { * picking mode and remove all event listeners associated with node picking. * * @param {InspectorFront} inspectorFront - * @param {Boolean} isDestroyCodePath + * @param {boolean} isDestroyCodePath * Optional. If true, we assume that's when the toolbox closes * and we should avoid doing any RDP request. * @return {Promise} @@ -130,7 +130,7 @@ class NodePicker extends EventEmitter { * created while node picking is active) to listen for mouse movements over their nodes * and trigger events when a node is hovered or picked. * - * @param {Boolean} doFocus + * @param {boolean} doFocus * Optionally focus the content area once the picker is activated. */ start = async doFocus => { @@ -154,10 +154,10 @@ class NodePicker extends EventEmitter { * Stop the element picker. Note that the picker is automatically stopped when * an element is picked. * - * @param {Boolean} isDestroyCodePath + * @param {boolean} isDestroyCodePath * Optional. If true, we assume that's when the toolbox closes * and we should avoid doing any RDP request. - * @param {Boolean} canceled + * @param {boolean} canceled * Optional. If true, emit an additional event to notify that the * picker was canceled, ie stopped without selecting a node. */ @@ -203,7 +203,7 @@ class NodePicker extends EventEmitter { /** * When a node is hovered by the mouse when the highlighter is in picker mode * - * @param {Object} data + * @param {object} data * Information about the node being hovered */ #onHovered = async data => { @@ -236,7 +236,7 @@ class NodePicker extends EventEmitter { /** * When a node has been picked while the highlighter is in picker mode * - * @param {Object} data + * @param {object} data * Information about the picked node */ #onPicked = data => { @@ -248,7 +248,7 @@ class NodePicker extends EventEmitter { * When a node has been shift-clicked (previewed) while the highlighter is in * picker mode * - * @param {Object} data + * @param {object} data * Information about the picked node */ #onPreviewed = data => { diff --git a/devtools/client/inspector/panel.js b/devtools/client/inspector/panel.js @@ -18,7 +18,7 @@ class InspectorPanel { /** * Initialize the inspector * - * @param {Object} options: see Inspector.init + * @param {object} options: see Inspector.init * @returns {Inspector} */ open(options = {}) { diff --git a/devtools/client/inspector/rules/models/class-list.js b/devtools/client/inspector/rules/models/class-list.js @@ -112,9 +112,9 @@ class ClassList { /** * Set the state for a given class on the current node. * - * @param {String} name + * @param {string} name * The class which state should be changed. - * @param {Boolean} isApplied + * @param {boolean} isApplied * True if the class should be enabled, false otherwise. * @return {Promise} Resolves when the change has been made in the DOM. */ @@ -129,7 +129,7 @@ class ClassList { /** * Add several classes to the current node at once. * - * @param {String} classNameString + * @param {string} classNameString * The string that contains all classes. * @return {Promise} Resolves when the change has been made in the DOM. */ @@ -146,7 +146,7 @@ class ClassList { /** * Add a class to the current node at once. * - * @param {String} name + * @param {string} name * The class to be added. * @return {Promise} Resolves when the change has been made in the DOM. */ @@ -218,9 +218,9 @@ class ClassList { * - the one already used on elements of the document * - the one defined in Stylesheets of the document * - * @param {String} filter: A string the classNames should start with (an insensitive + * @param {string} filter: A string the classNames should start with (an insensitive * case matching will be done). - * @returns {Promise<Array<String>>} A promise that resolves with an array of strings + * @returns {Promise<Array<string>>} A promise that resolves with an array of strings * matching the passed filter. */ getClassNames(filter) { diff --git a/devtools/client/inspector/rules/models/element-style.js b/devtools/client/inspector/rules/models/element-style.js @@ -40,14 +40,14 @@ class ElementStyle { * The element whose style we are viewing. * @param {CssRuleView} ruleView * The instance of the rule-view panel. - * @param {Object} store + * @param {object} store * The ElementStyle can use this object to store metadata * that might outlast the rule view, particularly the current * set of disabled properties. * @param {PageStyleFront} pageStyle * Front for the page style actor that will be providing * the style information. - * @param {Boolean} showUserAgentStyles + * @param {boolean} showUserAgentStyles * Should user agent styles be inspected? */ constructor(element, ruleView, store, pageStyle, showUserAgentStyles) { @@ -168,7 +168,7 @@ class ElementStyle { /** * Returns the Rule object of the given rule id. * - * @param {String|null} id + * @param {string | null} id * The id of the Rule object. * @return {Rule|undefined} of the given rule id or undefined if it cannot be found. */ @@ -234,12 +234,12 @@ class ElementStyle { * Add a rule if it's one we care about. Filters out duplicates and * inherited styles with no inherited properties. * - * @param {Object} options + * @param {object} options * Options for creating the Rule, see the Rule constructor. * @param {Array} existingRules * Rules to reuse if possible. If a rule is reused, then it * it will be deleted from this array. - * @return {Boolean} true if we added the rule. + * @return {boolean} true if we added the rule. */ _maybeAddRule(options, existingRules) { // If we've already included this domRule (for example, when a @@ -302,7 +302,7 @@ class ElementStyle { * the latest state. Use this opportunity to also trigger checks for the "inactive" * state of the declaration (whether it has effect or not). * - * @param {String} pseudo + * @param {string} pseudo * Optional pseudo-element for which to restrict marking CSS declarations as * overridden. */ @@ -545,8 +545,8 @@ class ElementStyle { * a computed property seen "earlier" (e.g. whose rule had higher priority, or that * was declared in the same rule, but earlier). * - * @param {Object} computedProp: A computed prop object, as stored in TextProp#computed - * @param {Object} earlierProp: The computed prop to compare against + * @param {object} computedProp: A computed prop object, as stored in TextProp#computed + * @param {object} earlierProp: The computed prop to compare against * @returns Boolean */ _hasHigherPriorityThanEarlierProp(computedProp, earlierProp) { @@ -589,7 +589,7 @@ class ElementStyle { * Update CSS variable tooltip information on textProp editor when registered property * are added/modified/removed. * - * @param {Set<String>} registeredPropertyNamesSet: A Set containing the name of the + * @param {Set<string>} registeredPropertyNamesSet: A Set containing the name of the * registered properties which were added/modified/removed. */ onRegisteredPropertiesChange(registeredPropertyNamesSet) { @@ -608,7 +608,7 @@ class ElementStyle { * * @param {TextProperty} declaration * A TextProperty of a rule. - * @param {Set<String>} variableNamesSet + * @param {Set<string>} variableNamesSet * A Set of CSS variable names that have been updated. */ _hasUpdatedCSSVariable(declaration, variableNamesSet) { @@ -632,7 +632,7 @@ class ElementStyle { * criteria such as time and animation delay need to be checked in order to determine * if the property is overridden at runtime. * - * @param {String} pseudo + * @param {string} pseudo * Optional pseudo-element for which to restrict marking CSS declarations as * overridden. If omitted, only declarations for regular style rules are * returned (no pseudo-element style rules). @@ -703,9 +703,9 @@ class ElementStyle { /** * Adds a new declaration to the rule. * - * @param {String} ruleId + * @param {string} ruleId * The id of the Rule to be modified. - * @param {String} value + * @param {string} value * The new declaration value. */ addNewDeclaration(ruleId, value) { @@ -742,11 +742,11 @@ class ElementStyle { * Given the id of the rule and the new declaration name, modifies the existing * declaration name to the new given value. * - * @param {String} ruleId + * @param {string} ruleId * The Rule id of the given CSS declaration. - * @param {String} declarationId + * @param {string} declarationId * The TextProperty id for the CSS declaration. - * @param {String} name + * @param {string} name * The new declaration name. */ async modifyDeclarationName(ruleId, declarationId, name) { @@ -780,7 +780,7 @@ class ElementStyle { * * @param {Rule} rule * The Rule object to write new declarations to. - * @param {Array<Object>} declarationsToAdd + * @param {Array<object>} declarationsToAdd * An array of object containg the parsed declaration data to be added. * @param {TextProperty|null} siblingDeclaration * Optional declaration next to which the new declaration will be added. @@ -806,9 +806,9 @@ class ElementStyle { * Example: Calling with "red; width: 100px" would return * { firstValue: "red", propertiesToAdd: [{ name: "width", value: "100px" }] } * - * @param {String} value + * @param {string} value * The string to parse. - * @return {Object} An object with the following properties: + * @return {object} An object with the following properties: * firstValue: A string containing a simple value, like * "red" or "100px!important" * declarationsToAdd: An array with additional declarations, following the @@ -850,11 +850,11 @@ class ElementStyle { * Given the id of the rule and the new declaration value, modifies the existing * declaration value to the new given value. * - * @param {String} ruleId + * @param {string} ruleId * The Rule id of the given CSS declaration. - * @param {String} declarationId + * @param {string} declarationId * The TextProperty id for the CSS declaration. - * @param {String} value + * @param {string} value * The new declaration value. */ async modifyDeclarationValue(ruleId, declarationId, value) { @@ -896,9 +896,9 @@ class ElementStyle { /** * Modifies the existing rule's selector to the new given value. * - * @param {String} ruleId + * @param {string} ruleId * The id of the Rule to be modified. - * @param {String} selector + * @param {string} selector * The new selector value. */ async modifySelector(ruleId, selector) { @@ -966,9 +966,9 @@ class ElementStyle { /** * Toggles the enabled state of the given CSS declaration. * - * @param {String} ruleId + * @param {string} ruleId * The Rule id of the given CSS declaration. - * @param {String} declarationId + * @param {string} declarationId * The TextProperty id for the CSS declaration. */ toggleDeclaration(ruleId, declarationId) { @@ -992,7 +992,7 @@ class ElementStyle { * * @param {TextProperty} prop * The text property to update. - * @return {Boolean} true if the TextProperty's overridden state (or any of + * @return {boolean} true if the TextProperty's overridden state (or any of * its computed properties overridden state) changed. */ _updatePropertyOverridden(prop) { @@ -1021,11 +1021,11 @@ class ElementStyle { /** * Returns data about a CSS variable. * - * @param {String} name + * @param {string} name * The name of the variable. - * @param {String} pseudo + * @param {string} pseudo * The pseudo-element name of the rule. - * @return {Object} An object with the following properties: + * @return {object} An object with the following properties: * - {String|undefined} value: The variable's value. Undefined if variable is not set. * - {RegisteredPropertyResource|undefined} registeredProperty: The registered * property data (syntax, initial value, inherits). Undefined if the variable @@ -1058,7 +1058,7 @@ class ElementStyle { /** * Get all custom properties. * - * @param {String} pseudo + * @param {string} pseudo * The pseudo-element name of the rule. * @returns Map<String, String> A map whose key is the custom property name and value is * the custom property value (or registered property initial diff --git a/devtools/client/inspector/rules/models/rule.js b/devtools/client/inspector/rules/models/rule.js @@ -38,7 +38,7 @@ class Rule { /** * @param {ElementStyle} elementStyle * The ElementStyle to which this rule belongs. - * @param {Object} options + * @param {object} options * The information used to construct this rule. Properties include: * rule: A StyleRuleActor * inherited: An element this rule was inherited from. If omitted, @@ -226,7 +226,7 @@ class Rule { /** * Returns the TextProperty with the given id or undefined if it cannot be found. * - * @param {String|null} id + * @param {string | null} id * A TextProperty id. * @return {TextProperty|undefined} with the given id in the current Rule or undefined * if it cannot be found. @@ -260,7 +260,7 @@ class Rule { * Returns true if the rule matches the creation options * specified. * - * @param {Object} options + * @param {object} options * Creation options. See the Rule constructor for documentation. */ matches(options) { @@ -270,13 +270,13 @@ class Rule { /** * Create a new TextProperty to include in the rule. * - * @param {String} name + * @param {string} name * The text property name (such as "background" or "border-top"). - * @param {String} value + * @param {string} value * The property's value (not including priority). - * @param {String} priority + * @param {string} priority * The property's priority (either "important" or an empty string). - * @param {Boolean} enabled + * @param {boolean} enabled * True if the property should be enabled. * @param {TextProperty} siblingProp * Optional, property next to which the new property will be added. @@ -452,7 +452,7 @@ class Rule { * * @param {TextProperty} property * The property to rename. - * @param {String} name + * @param {string} name * The new property name (such as "background" or "border-top"). * @return {Promise} */ @@ -474,9 +474,9 @@ class Rule { * * @param {TextProperty} property * The property to manipulate. - * @param {String} value + * @param {string} value * The property's value (not including priority). - * @param {String} priority + * @param {string} priority * The property's priority (either "important" or an empty string). * @return {Promise} */ @@ -500,9 +500,9 @@ class Rule { * * @param {TextProperty} property * The property which value will be previewed - * @param {String} value + * @param {string} value * The value to be used for the preview - * @param {String} priority + * @param {string} priority * The property's priority (either "important" or an empty string). * @return {Promise} */ @@ -530,7 +530,7 @@ class Rule { * * @param {TextProperty} property * The property to enable/disable - * @param {Boolean} value + * @param {boolean} value */ setPropertyEnabled(property, value) { if (property.enabled === !!value) { @@ -739,7 +739,7 @@ class Rule { * @param {TextProperty} newProp * The current version of the property, as parsed from the * authoredText in Rule._getTextProperties(). - * @return {Boolean} true if a property was updated, false if no properties + * @return {boolean} true if a property was updated, false if no properties * were updated. */ _updateTextProperty(newProp) { @@ -804,7 +804,7 @@ class Rule { * * @param {TextProperty} textProperty * The text property that will be left to focus on a sibling. - * @param {Number} direction + * @param {number} direction * The move focus direction number. */ editClosestTextProperty(textProperty, direction) { @@ -855,7 +855,7 @@ class Rule { } /** - * @returns {Boolean} Whether or not the rule is in a layer + * @returns {boolean} Whether or not the rule is in a layer */ isInLayer() { return this.domRule.ancestorData.some(({ type }) => type === "layer"); @@ -867,7 +867,7 @@ class Rule { * of the same CSSLayerBlockRule) * * @param {Rule} otherRule: The rule we want to compare with - * @returns {Boolean} + * @returns {boolean} */ isInDifferentLayer(otherRule) { const filterLayer = ({ type }) => type === "layer"; @@ -892,7 +892,7 @@ class Rule { } /** - * @returns {Boolean} Whether or not the rule is in a @starting-style rule + * @returns {boolean} Whether or not the rule is in a @starting-style rule */ isInStartingStyle() { return this.domRule.ancestorData.some( @@ -901,7 +901,7 @@ class Rule { } /** - * @returns {Boolean} Whether or not the rule can be edited + * @returns {boolean} Whether or not the rule can be edited */ isEditable() { return !this.isSystem && this.domRule.type !== PRES_HINTS; @@ -910,7 +910,7 @@ class Rule { /** * See whether this rule has any non-invisible properties. * - * @return {Boolean} true if there is any visible property, or false + * @return {boolean} true if there is any visible property, or false * if all properties are invisible */ hasAnyVisibleProperties() { diff --git a/devtools/client/inspector/rules/models/text-property.js b/devtools/client/inspector/rules/models/text-property.js @@ -34,18 +34,18 @@ loader.lazyRequireGetter( */ class TextProperty { /** - * @param {Object} options + * @param {object} options * @param {Rule} options.rule * The rule this TextProperty came from. - * @param {String} options.name + * @param {string} options.name * The text property name (such as "background" or "border-top"). - * @param {String} options.value + * @param {string} options.value * The property's value (not including priority). - * @param {String} options.priority + * @param {string} options.priority * The property's priority (either "important" or an empty string). - * @param {Boolean} options.enabled + * @param {boolean} options.enabled * Whether the property is enabled. - * @param {Boolean} options.invisible + * @param {boolean} options.invisible * Whether the property is invisible. In an inherited rule, only show * the inherited declarations. The other declarations are considered * invisible and does not show up in the UI. These are needed so that @@ -95,7 +95,7 @@ class TextProperty { /** * Returns whether or not the declaration's name is known. * - * @return {Boolean} true if the declaration name is known, false otherwise. + * @return {boolean} true if the declaration name is known, false otherwise. */ get isKnownProperty() { return this.cssProperties.isKnown(this.name); @@ -104,7 +104,7 @@ class TextProperty { /** * Returns whether or not the declaration is changed by the user. * - * @return {Boolean} true if the declaration is changed by the user, false + * @return {boolean} true if the declaration is changed by the user, false * otherwise. */ get isPropertyChanged() { @@ -222,7 +222,7 @@ class TextProperty { * Called when the property's value has been updated externally, and * the property and editor should update to reflect that value. * - * @param {String} value + * @param {string} value * Property value */ updateValue(value) { @@ -275,7 +275,7 @@ class TextProperty { /** * Returns the associated StyleRule declaration if it exists * - * @returns {Object|undefined} + * @returns {object | undefined} */ #getDomRuleDeclaration() { const selfIndex = this.rule.textProps.indexOf(this); @@ -286,7 +286,7 @@ class TextProperty { * Validate this property. Does it make sense for this value to be assigned * to this property name? * - * @return {Boolean} true if the whole CSS declaration is valid, false otherwise. + * @return {boolean} true if the whole CSS declaration is valid, false otherwise. */ isValid() { const declaration = this.#getDomRuleDeclaration(); @@ -306,7 +306,7 @@ class TextProperty { * Returns an object with properties explaining why the property is inactive, if it is. * If it's not inactive, this returns undefined. * - * @returns {Object|undefined} + * @returns {object | undefined} */ getInactiveCssData() { const declaration = this.#getDomRuleDeclaration(); @@ -402,7 +402,7 @@ class TextProperty { /** * Validate the name of this property. * - * @return {Boolean} true if the property name is valid, false otherwise. + * @return {boolean} true if the property name is valid, false otherwise. */ isNameValid() { const declaration = this.#getDomRuleDeclaration(); @@ -423,7 +423,7 @@ class TextProperty { * For now, it's only computed on the server for declarations of * registered properties. * - * @return {Boolean} + * @return {boolean} */ isInvalidAtComputedValueTime() { const declaration = this.#getDomRuleDeclaration(); @@ -441,7 +441,7 @@ class TextProperty { /** * Get the associated CSS variable computed value. * - * @return {String} + * @return {string} */ getVariableComputedValue() { const declaration = this.#getDomRuleDeclaration(); @@ -459,7 +459,7 @@ class TextProperty { * Returns the expected syntax for this property. * For now, it's only sent from the server for invalid at computed-value time declarations. * - * @return {String|null} The expected syntax, or null. + * @return {string | null} The expected syntax, or null. */ getExpectedSyntax() { const declaration = this.#getDomRuleDeclaration(); diff --git a/devtools/client/inspector/rules/models/user-properties.js b/devtools/client/inspector/rules/models/user-properties.js @@ -20,11 +20,11 @@ class UserProperties { * * @param {CSSStyleDeclaration} style * The CSSStyleDeclaration against which the property is mapped. - * @param {String} name + * @param {string} name * The name of the property to get. - * @param {String} value + * @param {string} value * Default value. - * @return {String} + * @return {string} * The property value if it has previously been set by the user, null * otherwise. */ @@ -43,9 +43,9 @@ class UserProperties { * * @param {CSSStyleDeclaration} style * The CSSStyleDeclaration against which the property is to be mapped. - * @param {String} name + * @param {string} name * The name of the property to set. - * @param {String} userValue + * @param {string} userValue * The value of the property to set. */ setProperty(style, name, userValue) { @@ -67,7 +67,7 @@ class UserProperties { * * @param {CSSStyleDeclaration} style * The CSSStyleDeclaration against which the property would be mapped. - * @param {String} name + * @param {string} name * The name of the property to check. */ contains(style, name) { @@ -79,7 +79,7 @@ class UserProperties { /** * Check whether a named property is stored. * - * @param {String} name + * @param {string} name * The name of the property to check. */ containsName(name) { diff --git a/devtools/client/inspector/rules/rules.js b/devtools/client/inspector/rules/rules.js @@ -138,7 +138,7 @@ const REGISTERED_PROPERTIES_CONTAINER_ID = "registered-properties-container"; * Inspector toolbox panel * @param {Document} document * The document that will contain the rule view. - * @param {Object} store + * @param {object} store * The CSS rule view can use this object to store metadata * that might outlast the rule view, particularly the current * set of disabled properties. @@ -364,9 +364,9 @@ CssRuleView.prototype = { * unhighlight the highlighted nodes. * * @param {Rule} rule - * @param {String} selector + * @param {string} selector * Elements matching this selector will be highlighted on the page. - * @param {Boolean} highlightFromRulesSelector + * @param {boolean} highlightFromRulesSelector */ async toggleSelectorHighlighter( rule, @@ -410,8 +410,8 @@ CssRuleView.prototype = { /** * Check whether a SelectorHighlighter is active for the given selector text. * - * @param {String} selector - * @return {Boolean} + * @param {string} selector + * @return {boolean} */ isSelectorHighlighted(selector) { const options = this.inspector.highlighters.getOptionsForActiveHighlighter( @@ -545,9 +545,9 @@ CssRuleView.prototype = { * This is the place to observe for highlighter events, check the highlighter type and * event name, then react to specific events, for example by modifying the DOM. * - * @param {String} eventName + * @param {string} eventName * Highlighter event name. One of: "highlighter-hidden", "highlighter-shown" - * @param {Object} data + * @param {object} data * Object with data associated with the highlighter event. */ handleHighlighterEvent(eventName, data) { @@ -646,7 +646,7 @@ CssRuleView.prototype = { * * @param {DOMNode} node * The node which we want information about - * @return {Object|null} containing the following props: + * @return {object | null} containing the following props: * - type {String} One of the VIEW_NODE_XXX_TYPE const in * client/inspector/shared/node-types. * - rule {Rule} The Rule object. @@ -662,7 +662,7 @@ CssRuleView.prototype = { * * @param {DOMNode} node * The node which we want information about - * @return {Object|null} containing the following props: + * @return {object | null} containing the following props: * - type {String} Compatibility issue type. * - property {string} The incompatible rule * - alias {Array} The browser specific alias of rule @@ -829,7 +829,7 @@ CssRuleView.prototype = { /** * Set the filter style search value. * - * @param {String} value + * @param {string} value * The search value. */ setFilterStyles(value = "") { @@ -1076,7 +1076,7 @@ CssRuleView.prototype = { * * @param {NodeActor} element * The node whose style rules we'll inspect. - * @param {Boolean} allowRefresh + * @param {boolean} allowRefresh * Update the view even if the element is the same as last time. */ selectElement(element, allowRefresh = false) { @@ -1362,11 +1362,11 @@ CssRuleView.prototype = { /** * Creates an expandable container in the rule view * - * @param {String} label + * @param {string} label * The label for the container header - * @param {String} containerId + * @param {string} containerId * The id that will be set on the container - * @param {Boolean} isPseudo + * @param {boolean} isPseudo * Whether or not the container will hold pseudo element rules * @return {DOMNode} The container element */ @@ -1437,7 +1437,7 @@ CssRuleView.prototype = { /** * Return the RegisteredPropertyEditor element for a given property name * - * @param {String} registeredPropertyName + * @param {string} registeredPropertyName * @returns {Element|null} */ getRegisteredPropertyElement(registeredPropertyName) { @@ -1453,9 +1453,9 @@ CssRuleView.prototype = { * Clickable toggle DOM Node * @param {DOMNode} container * Expandable container DOM Node - * @param {Boolean} isPseudo + * @param {boolean} isPseudo * Whether or not the container will hold pseudo element rules - * @param {Boolean} showPseudo + * @param {boolean} showPseudo * Whether or not pseudo element rules should be displayed */ _toggleContainerVisibility(toggleButton, container, isPseudo, showPseudo) { @@ -1653,7 +1653,7 @@ CssRuleView.prototype = { * @param {Rule} rule * The rule object we're highlighting if its rule selectors or * property values match the search value. - * @return {Boolean} true if the rule was highlighted, false otherwise. + * @return {boolean} true if the rule was highlighted, false otherwise. */ highlightRule(rule) { const isRuleSelectorHighlighted = this._highlightRuleSelector(rule); @@ -1680,7 +1680,7 @@ CssRuleView.prototype = { * * @param {Rule} rule * The Rule object. - * @return {Boolean} true if the rule selector was highlighted, + * @return {boolean} true if the rule selector was highlighted, * false otherwise. */ _highlightRuleSelector(rule) { @@ -1714,7 +1714,7 @@ CssRuleView.prototype = { * Highlights the ancestor rules data (@media / @layer) that matches the filter search * value and returns a boolean indicating whether or not element was highlighted. * - * @return {Boolean} true if the element was highlighted, false otherwise. + * @return {boolean} true if the element was highlighted, false otherwise. */ _highlightAncestorRules(rule) { const element = rule.editor.ancestorDataEl; @@ -1746,7 +1746,7 @@ CssRuleView.prototype = { * returns a boolean indicating whether or not the stylesheet source was * highlighted. * - * @return {Boolean} true if the stylesheet source was highlighted, false + * @return {boolean} true if the stylesheet source was highlighted, false * otherwise. */ _highlightStyleSheet(rule) { @@ -1878,17 +1878,17 @@ CssRuleView.prototype = { * element if the search terms match the property, and returns a boolean * indicating whether or not the search terms match. * - * @param {Object} options + * @param {object} options * @param {DOMNode} options.element * The node to highlight if search terms match - * @param {String} options.propertyName + * @param {string} options.propertyName * The property name of a rule - * @param {String} options.propertyValue + * @param {string} options.propertyValue * The property value of a rule * @param {TextProperty} options.textProperty * The text property that we may highlight. It's helpful in cases we don't have * an element yet (e.g. if the property is a hidden unused variable) - * @return {Boolean} true if the given search terms match the property, false + * @return {boolean} true if the given search terms match the property, false * otherwise. */ _highlightMatches({ element, propertyName, propertyValue, textProperty }) { @@ -2153,7 +2153,7 @@ CssRuleView.prototype = { * The rule to scroll to. * @param {Element|null} declaration * Optional. The declaration to scroll to. - * @param {String} scrollBehavior + * @param {string} scrollBehavior * Optional. The transition animation when scrolling. If prefers-reduced-motion * system pref is set, then the scroll behavior will be overridden to "auto". */ @@ -2196,14 +2196,14 @@ CssRuleView.prototype = { * Finds the specified TextProperty name in the rule view. If found, scroll to and * flash the TextProperty. * - * @param {String} name + * @param {string} name * The property name to scroll to and highlight. - * @param {Object} options + * @param {object} options * @param {Function|undefined} options.ruleValidator * An optional function that can be used to filter out rules we shouldn't look * into to find the property name. The function is called with a Rule object, * and the rule will be skipped if the function returns a falsy value. - * @return {Boolean} true if the TextProperty name is found, and false otherwise. + * @return {boolean} true if the TextProperty name is found, and false otherwise. */ highlightProperty(name, { ruleValidator } = {}) { // First, let's clear any search we might have, as the property could be hidden @@ -2333,7 +2333,7 @@ CssRuleView.prototype = { * * @param {Rule} rule * @param {Element} element - * @param {String} scrollBehavior + * @param {string} scrollBehavior */ _highlightElementInRule(rule, element, scrollBehavior) { if (rule) { @@ -2700,7 +2700,7 @@ class RuleViewTool { * Update rules that reference registered properties whose name is in the passed Set, * so the `var()` tooltip has up-to-date information. * - * @param {Set<String>} registeredPropertyNames + * @param {Set<string>} registeredPropertyNames */ _updateElementStyleRegisteredProperties(registeredPropertyNames) { if (!this.view._elementStyle) { diff --git a/devtools/client/inspector/rules/test/browser_rules_add-rule-iframes.js b/devtools/client/inspector/rules/test/browser_rules_add-rule-iframes.js @@ -31,11 +31,11 @@ add_task(async function () { * Add a new property in the rule at the provided index in the rule view. * * @param {RuleView} view - * @param {Number} index + * @param {number} index * The index of the rule in which we should add a new property. - * @param {String} name + * @param {string} name * The name of the new property. - * @param {String} value + * @param {string} value * The value of the new property. */ async function addNewProperty(view, index, name, value) { diff --git a/devtools/client/inspector/rules/test/browser_rules_completion-new-property_multiline.js b/devtools/client/inspector/rules/test/browser_rules_completion-new-property_multiline.js @@ -126,7 +126,7 @@ add_task(async function () { * Wait for the editor to emit "after-suggest" to make sure the autocompletion * process is finished. * - * @param {String} key + * @param {string} key * The key to send to the input. * @param {InplaceEditor} editor * The inplace editor which owns the focused input. diff --git a/devtools/client/inspector/rules/test/browser_rules_content_01.js b/devtools/client/inspector/rules/test/browser_rules_content_01.js @@ -140,7 +140,7 @@ add_task(async function () { * * @param {Inspector} view * @param {Integer} ruleIndex - * @param {Array<Object>} expectedSelectors: + * @param {Array<object>} expectedSelectors: * An array of objects representing each selector. Objects have the following shape: * - selector: The expected selector text * - matches: True if the selector should have the "matching" class diff --git a/devtools/client/inspector/rules/test/browser_rules_edit-size-property-dragging.js b/devtools/client/inspector/rules/test/browser_rules_edit-size-property-dragging.js @@ -345,14 +345,14 @@ async function runIncrementTest(editor, view, tests) { * * @param {TextPropertyEditor} editor * @param {Array} options - * @param {String} options.startValue - * @param {String} options.expectedEndValue - * @param {Boolean} options.shift Whether or not we press the shift key - * @param {Number} options.distance Distance of the dragging - * @param {String} options.description - * @param {Boolean} options.ctrl Small increment key - * @param {Boolean} options.alt Small increment key for macosx - * @param {Boolean} options.deadzoneIncluded True if the provided distance + * @param {string} options.startValue + * @param {string} options.expectedEndValue + * @param {boolean} options.shift Whether or not we press the shift key + * @param {number} options.distance Distance of the dragging + * @param {string} options.description + * @param {boolean} options.ctrl Small increment key + * @param {boolean} options.alt Small increment key for macosx + * @param {boolean} options.deadzoneIncluded True if the provided distance * accounts for the deadzone. When false, the deadzone will automatically * be added to the distance. */ @@ -390,13 +390,13 @@ async function testIncrement(editor, options) { * Synthesizes mouse dragging (mousedown + mousemove + mouseup) * * @param {TextPropertyEditor} editor - * @param {Number} distance length of the horizontal dragging (negative if dragging left) - * @param {Object} option - * @param {Boolean} option.escape - * @param {Boolean} option.alt - * @param {Boolean} option.shift - * @param {Boolean} option.ctrl - * @param {Boolean} option.deadzoneIncluded + * @param {number} distance length of the horizontal dragging (negative if dragging left) + * @param {object} option + * @param {boolean} option.escape + * @param {boolean} option.alt + * @param {boolean} option.shift + * @param {boolean} option.ctrl + * @param {boolean} option.deadzoneIncluded */ async function synthesizeMouseDragging(editor, distance, options = {}) { info(`Start to synthesize mouse dragging (from ${1} to ${1 + distance})`); diff --git a/devtools/client/inspector/rules/test/browser_rules_linear-easing-swatch.js b/devtools/client/inspector/rules/test/browser_rules_linear-easing-swatch.js @@ -400,8 +400,8 @@ add_task(async function testChart() { * Check that the svg chart line and control points are placed where we expect them. * * @param {ToolipPanel} panel - * @param {Array<Array<Number>>} expectedPoints: Array of coordinated - * @param {String} messagePrefix + * @param {Array<Array<number>>} expectedPoints: Array of coordinated + * @param {string} messagePrefix */ function checkChartState(panel, expectedPoints, messagePrefix = "") { const svgLine = panel.querySelector("svg.chart .chart-linear"); @@ -439,10 +439,10 @@ function checkChartState(panel, expectedPoints, messagePrefix = "") { * Checks if the property in the rule view has the expected state * * @param {RuleView} view - * @param {String} selector - * @param {String} property - * @param {String} expectedLinearValue: Expected value in the rule view - * @param {String} expectedComputedLinearValue: Expected computed value. Defaults to expectedLinearValue. + * @param {string} selector + * @param {string} property + * @param {string} expectedLinearValue: Expected value in the rule view + * @param {string} expectedComputedLinearValue: Expected computed value. Defaults to expectedLinearValue. * @returns {Element|null} */ async function checkRuleView( @@ -476,8 +476,8 @@ async function checkRuleView( * Returns the linear easing swatch for a rule (defined by its selector), and a property. * * @param {RuleView} view - * @param {String} selector - * @param {String} property + * @param {string} selector + * @param {string} property * @returns {Element|null} */ function getRuleViewLinearEasingSwatch(view, selector, property) { diff --git a/devtools/client/inspector/rules/test/browser_rules_variables-jump-to-definition.js b/devtools/client/inspector/rules/test/browser_rules_variables-jump-to-definition.js @@ -462,8 +462,8 @@ function getJumpToDefinitionButtonForDeclaration(rule, declaration) { * * @param {RuleView} view * @param {Element} jumpToDefinitionButton - * @param {String} expectedPropertyName: The name of the property that should be highlighted - * @param {String} expectedPropertyValue: The value of the property that should be highlighted + * @param {string} expectedPropertyName: The name of the property that should be highlighted + * @param {string} expectedPropertyValue: The value of the property that should be highlighted */ async function highlightProperty( view, diff --git a/devtools/client/inspector/rules/test/head.js b/devtools/client/inspector/rules/test/head.js @@ -49,7 +49,7 @@ async function hideTooltipAndWaitForRuleViewChanged(editorTooltip, view) { * A validator generator function that returns a boolean. * This is called every few milliseconds to check if the result is true. * When it is true, the promise resolves. - * @param {String} name + * @param {string} name * Optional name of the test. This is used to generate * the success and failure messages. * @return a promise that resolves when the function returned true or rejects @@ -83,7 +83,7 @@ var waitForSuccess = async function (validatorFn, desc = "untitled") { * @param {SwatchColorPickerTooltip} colorPicker * @param {Array} newRgba * The new color to be set [r, g, b, a] - * @param {Object} expectedChange + * @param {object} expectedChange * Optional object that needs the following props: * - {String} selector The selector to the element in the page that * will have its style changed. @@ -131,13 +131,13 @@ var simulateColorPickerChange = async function ( * * @param {RuleView} view * The related rule view instance - * @param {Number} ruleIndex + * @param {number} ruleIndex * Which rule to target in the rule view - * @param {Number} propIndex + * @param {number} propIndex * Which property to target in the rule * @param {Array} newRgba * The new color to be set [r, g, b, a] - * @param {Object} expectedChange + * @param {object} expectedChange * Optional object that needs the following props: * - {String} selector The selector to the element in the page that * will have its style changed. @@ -174,13 +174,13 @@ var openColorPickerAndSelectColor = async function ( * * @param {RuleView} view * The related rule view instance - * @param {Number} ruleIndex + * @param {number} ruleIndex * Which rule to target in the rule view - * @param {Number} propIndex + * @param {number} propIndex * Which property to target in the rule * @param {Array} coords * The new coordinates to be used, e.g. [0.1, 2, 0.9, -1] - * @param {Object} expectedChange + * @param {object} expectedChange * Optional object that needs the following props: * - {String} selector The selector to the element in the page that * will have its style changed. @@ -226,20 +226,20 @@ var openCubicBezierAndChangeCoords = async function ( * * @param {CssRuleView} view * The instance of the rule-view panel - * @param {Number} ruleIndex + * @param {number} ruleIndex * The index of the rule to use. - * @param {String} name + * @param {string} name * The name for the new property - * @param {String} value + * @param {string} value * The value for the new property - * @param {Object=} options - * @param {String=} options.commitValueWith + * @param {object=} options + * @param {string=} options.commitValueWith * Which key should be used to commit the new value. VK_TAB is used by * default, but tests might want to use another key to test cancelling * for exemple. * If set to null, no keys will be hit, so the input will still be focused * at the end of this function - * @param {Boolean=} options.blurNewProperty + * @param {boolean=} options.blurNewProperty * After the new value has been added, a new property would have been * focused. This parameter is true by default, and that causes the new * property to be blurred. Set to false if you don't want this. @@ -366,7 +366,7 @@ var addProperty = async function ( * The instance of the rule-view panel. * @param {TextProperty} textProp * The instance of the TextProperty to be changed. - * @param {String} name + * @param {string} name * The new property name. */ var renameProperty = async function (view, textProp, name) { @@ -401,7 +401,7 @@ var renameProperty = async function (view, textProp, name) { * The instance of the rule-view panel * @param {TextProperty} textProp * The instance of the TextProperty to be removed - * @param {Boolean} blurNewProperty + * @param {boolean} blurNewProperty * After the property has been removed, a new property would have been * focused. This parameter is true by default, and that causes the new * property to be blurred. Set to false if you don't want this. @@ -465,9 +465,9 @@ async function addNewRule(inspector, view) { * The instance of InspectorPanel currently loaded in the toolbox * @param {CssRuleView} view * The instance of the rule-view panel - * @param {String} expectedSelector + * @param {string} expectedSelector * The value we expect the selector to have - * @param {Number} expectedIndex + * @param {number} expectedIndex * The index we expect the rule to have in the rule-view * @returns {Rule} a promise that resolves the new model Rule after the rule has * been added @@ -553,9 +553,9 @@ function waitForStyleModification(inspector) { * * @param {CssRuleView} view * The instance of the Rules view - * @param {String} selectorText + * @param {string} selectorText * The selector of the CSS rule to look for - * @param {Number} index + * @param {number} index * If there are more CSS rules with the same selector, use this index * to determine which one should be retrieved. Defaults to 0 (first) */ @@ -607,7 +607,7 @@ async function clickSelectorIcon(view, selectorText, index = 0) { * has been recorded. * * @param {CssRuleView} view The rule-view instance. - * @param {String} name The class name to find the checkbox. + * @param {string} name The class name to find the checkbox. */ async function toggleClassPanelCheckBox(view, name) { info(`Clicking on checkbox for class ${name}`); @@ -682,7 +682,7 @@ async function openEyedropper(view, swatch) { * * @param {ruleView} view * The rule-view instance. - * @param {Number} ruleIndex + * @param {number} ruleIndex * The index we expect the rule to have in the rule-view. If an array, the first * item is the children index in the rule view, and the second item is the child * node index in the retrieved rule view element. This is helpful to select rules @@ -754,10 +754,10 @@ async function getPropertiesForRuleIndex( * * @param {ruleView} view * The rule-view instance - * @param {Number} ruleIndex + * @param {number} ruleIndex * The index of the CSS rule where we can find the declaration to be * toggled. - * @param {Object} declaration + * @param {object} declaration * An object representing the declaration e.g. { color: "red" }. */ async function toggleDeclaration(view, ruleIndex, declaration) { @@ -779,11 +779,11 @@ async function toggleDeclaration(view, ruleIndex, declaration) { * * @param {RuleView} view * Instance of RuleView. - * @param {Number} ruleIndex + * @param {number} ruleIndex * The index of the CSS rule where to find the declaration. - * @param {Object} declaration + * @param {object} declaration * An object representing the target declaration e.g. { color: red }. - * @param {Object} newDeclaration + * @param {object} newDeclaration * An object representing the desired updated declaration e.g. { display: none }. */ async function updateDeclaration( @@ -818,11 +818,11 @@ async function updateDeclaration( * * @param {ruleView} view * The rule-view instance. - * @param {Number} ruleIndex + * @param {number} ruleIndex * The index we expect the rule to have in the rule-view. - * @param {Object} declaration + * @param {object} declaration * An object representing the declaration e.g. { color: "red" }. - * @param {Object} options + * @param {object} options * @param {string | undefined} options.expected * Expected message ID for the given incompatible property. * If the expected message is not specified (undefined), the given declaration @@ -894,9 +894,9 @@ async function checkDeclarationCompatibility( * * @param {ruleView} view * The rule-view instance. - * @param {Number} ruleIndex + * @param {number} ruleIndex * The index we expect the rule to have in the rule-view. - * @param {Object} declaration + * @param {object} declaration * An object representing the declaration e.g. { color: "red" }. */ async function checkDeclarationIsInactive(view, ruleIndex, declaration) { @@ -926,12 +926,12 @@ async function checkDeclarationIsInactive(view, ruleIndex, declaration) { * * @param {ruleView} view * The rule-view instance. - * @param {Number|Array} ruleIndex + * @param {number | Array} ruleIndex * The index we expect the rule to have in the rule-view. If an array, the first * item is the children index in the rule view, and the second item is the child * node index in the retrieved rule view element. This is helpful to select rules * inside the pseudo element section. - * @param {Object} declaration + * @param {object} declaration * An object representing the declaration e.g. { color: "red" }. */ async function checkDeclarationIsActive(view, ruleIndex, declaration) { @@ -951,9 +951,9 @@ async function checkDeclarationIsActive(view, ruleIndex, declaration) { * The rule-view instance. * @param {string} type * The interactive tooltip type being tested. - * @param {Number} ruleIndex + * @param {number} ruleIndex * The index we expect the rule to have in the rule-view. - * @param {Object} declaration + * @param {object} declaration * An object representing the declaration e.g. { color: "red" }. */ async function checkInteractiveTooltip(view, type, ruleIndex, declaration) { @@ -1156,9 +1156,9 @@ async function runInactiveCSSTests(view, inspector, tests) { * Return the checkbox element from the Rules view corresponding * to the given pseudo-class. * - * @param {Object} view + * @param {object} view * Instance of RuleView. - * @param {String} pseudo + * @param {string} pseudo * Pseudo-class, like :hover, :active, :focus, etc. * @return {HTMLElement} */ @@ -1173,13 +1173,13 @@ function getPseudoClassCheckbox(view, pseudo) { * * @param {RulesView} view * The RulesView instance. - * @param {String} selector + * @param {string} selector * Selector name for a rule. (e.g. "div", "div::before" and ".sample" etc); - * @param {String} propertyName + * @param {string} propertyName * Property name (e.g. "color" and "padding-top" etc); - * @param {String} expectedClassName + * @param {string} expectedClassName * The class name the variable should have. - * @param {String} expectedDatasetValue + * @param {string} expectedDatasetValue * The variable data attribute value. */ function checkCSSVariableOutput( @@ -1205,7 +1205,7 @@ function checkCSSVariableOutput( * * @param {RulesView} view * The RulesView instance. - * @param {Number} ruleIndex + * @param {number} ruleIndex * @returns {HTMLElement} */ function getRuleViewAncestorRulesDataElementByIndex(view, ruleIndex) { @@ -1220,8 +1220,8 @@ function getRuleViewAncestorRulesDataElementByIndex(view, ruleIndex) { * * @param {RulesView} view * The RulesView instance. - * @param {Number} ruleIndex - * @returns {String} + * @param {number} ruleIndex + * @returns {string} */ function getRuleViewAncestorRulesDataTextByIndex(view, ruleIndex) { return getRuleViewAncestorRulesDataElementByIndex(view, ruleIndex)?.innerText; diff --git a/devtools/client/inspector/rules/utils/utils.js b/devtools/client/inspector/rules/utils/utils.js @@ -63,7 +63,7 @@ function getDeclarationFromNode(node, rule) { * The node which we want information about * @param {ElementStyle} elementStyle * The ElementStyle to which this rule belongs - * @return {Object|null} containing the following props: + * @return {object | null} containing the following props: * - rule {Rule} The Rule object. * - type {String} One of the VIEW_NODE_XXX_TYPE const in * client/inspector/shared/node-types. @@ -235,7 +235,7 @@ function getNodeInfo(node, elementStyle) { * * @param {DOMNode} node * The node to start from - * @return {Object} {name, value} + * @return {object} {name, value} */ function getPropertyNameAndValue(node) { while (node?.classList) { @@ -285,7 +285,7 @@ function getShapeToggleActive(node) { * * @param {DOMNode} node * A shape point node - * @returns {String} The point associated with the given node. + * @returns {string} The point associated with the given node. */ function getShapePoint(node) { const classList = node.classList; @@ -308,7 +308,7 @@ function getShapePoint(node) { * Returns an array of CSS variables used in a CSS property value. * If no CSS variables are used, returns an empty array. * - * @param {String} propertyValue + * @param {string} propertyValue * CSS property value (e.g. "1px solid var(--color, blue)") * @return {Array} * List of variable names (e.g. ["--color"]) diff --git a/devtools/client/inspector/rules/views/class-list-previewer.js b/devtools/client/inspector/rules/views/class-list-previewer.js @@ -144,9 +144,9 @@ class ClassListPreviewer { /** * Render a single checkbox for a given classname. * - * @param {String} name + * @param {string} name * The name of this class. - * @param {Boolean} isApplied + * @param {boolean} isApplied * Is this class currently applied on the DOM node. * @return {DOMNode} The DOM element for this checkbox. */ diff --git a/devtools/client/inspector/rules/views/registered-property-editor.js b/devtools/client/inspector/rules/views/registered-property-editor.js @@ -26,7 +26,7 @@ class RegisteredPropertyEditor extends EventEmitter { /** * @param {CssRuleView} ruleView * The CssRuleView containing the document holding this rule editor. - * @param {Object} propertyDefinition + * @param {object} propertyDefinition * The property definition data as returned by PageStyleActor's getRegisteredProperties */ constructor(ruleView, propertyDefinition) { diff --git a/devtools/client/inspector/rules/views/rule-editor.js b/devtools/client/inspector/rules/views/rule-editor.js @@ -72,10 +72,10 @@ const INDENT_STR = " ".repeat(INDENT_SIZE); * The CssRuleView containg the document holding this rule editor. * @param {Rule} rule * The Rule object we're editing. - * @param {Object} options + * @param {object} options * @param {Set} options.elementsWithPendingClicks * @param {Function} options.onShowUnusedCustomCssProperties - * @param {Boolean} options.shouldHideUnusedCustomCssProperties + * @param {boolean} options.shouldHideUnusedCustomCssProperties */ function RuleEditor(ruleView, rule, options = {}) { EventEmitter.decorate(this); @@ -486,7 +486,7 @@ RuleEditor.prototype = { * * @param {Integer} selectorIndex: The index of the selector we want to create the * warnings for - * @param {Array<Object>} selectorWarnings: An array of object of the following shape: + * @param {Array<object>} selectorWarnings: An array of object of the following shape: * - {Integer} index: The index of the selector this applies to * - {String} kind: Identifies the warning * @returns {Element|null} @@ -573,7 +573,7 @@ RuleEditor.prototype = { * original sources or not. This is a callback for * SourceMapURLService.subscribeByID, which see. * - * @param {Object | null} originalLocation + * @param {object | null} originalLocation * The original position object (url/line/column) or null. */ _updateLocation(originalLocation) { @@ -646,7 +646,7 @@ RuleEditor.prototype = { /** * Update the rule editor with the contents of the rule. * - * @param {Boolean} reset + * @param {boolean} reset * True to completely reset the rule editor before populating. */ populate(reset) { @@ -923,8 +923,8 @@ RuleEditor.prototype = { /** * Render a given rule selector in this.selectorText element * - * @param {String} selector: The selector text to display - * @param {Number} selectorIndex: Its index in the rule + * @param {string} selector: The selector text to display + * @param {number} selectorIndex: Its index in the rule */ _populateSelector(selector, selectorIndex) { if (selectorIndex !== 0) { @@ -1003,13 +1003,13 @@ RuleEditor.prototype = { /** * Programatically add a new property to the rule. * - * @param {String} name + * @param {string} name * Property name. - * @param {String} value + * @param {string} value * Property value. - * @param {String} priority + * @param {string} priority * Property priority. - * @param {Boolean} enabled + * @param {boolean} enabled * True if the property should be enabled. * @param {TextProperty} siblingProp * Optional, property next to which the new property will be added. @@ -1142,9 +1142,9 @@ RuleEditor.prototype = { /** * Called when the new property input has been dismissed. * - * @param {String} value + * @param {string} value * The value in the editor. - * @param {Boolean} commit + * @param {boolean} commit * True if the value should be committed. */ _onNewProperty(value, commit) { @@ -1198,11 +1198,11 @@ RuleEditor.prototype = { * Ignores the change if the user pressed escape, otherwise * commits it. * - * @param {String} value + * @param {string} value * The value contained in the editor. - * @param {Boolean} commit + * @param {boolean} commit * True if the change should be applied. - * @param {Number} direction + * @param {number} direction * The move focus direction number. */ async _onSelectorDone(value, commit, direction) { @@ -1292,7 +1292,7 @@ RuleEditor.prototype = { /** * Handle moving the focus change after a Tab keypress in the selector inplace editor. * - * @param {Number} direction + * @param {number} direction * The move focus direction number. */ _moveSelectorFocus(direction) { diff --git a/devtools/client/inspector/rules/views/text-property-editor.js b/devtools/client/inspector/rules/views/text-property-editor.js @@ -99,7 +99,7 @@ const IS_DRAGGING_CLASSNAME = "ruleview-propertyvalue-dragging"; * The rule editor that owns this TextPropertyEditor. * @param {TextProperty} property * The text property to edit. - * @param {Object} options + * @param {object} options * @param {Set} options.elementsWithPendingClicks */ class TextPropertyEditor { @@ -456,7 +456,7 @@ class TextPropertyEditor { * Get the grid line names of the grid that the currently selected element is * contained in. * - * @return {Object} Contains the names of the cols and rows as arrays + * @return {object} Contains the names of the cols and rows as arrays * {cols: [], rows: []}. */ #getGridlineNames = async () => { @@ -530,7 +530,7 @@ class TextPropertyEditor { * Get the path from which to resolve requests for this * rule's stylesheet. * - * @return {String} the stylesheet's href. + * @return {string} the stylesheet's href. */ get #sheetHref() { const domRule = this.rule.domRule; @@ -1381,11 +1381,11 @@ class TextPropertyEditor { * Ignores the change if the user pressed escape, otherwise * commits it. * - * @param {String} value + * @param {string} value * The value contained in the editor. - * @param {Boolean} commit + * @param {boolean} commit * True if the change should be applied. - * @param {Number} direction + * @param {number} direction * The move focus direction number. */ #onNameDone = (value, commit, direction) => { @@ -1441,7 +1441,7 @@ class TextPropertyEditor { * Begin editing next or previous available property given the focus * direction. * - * @param {Number} direction + * @param {number} direction * The move focus direction number. */ remove(direction) { @@ -1459,11 +1459,11 @@ class TextPropertyEditor { * Called when a value editor closes. If the user pressed escape, * revert to the value this property had before editing. * - * @param {String} value + * @param {string} value * The value contained in the editor. - * @param {Boolean} commit + * @param {boolean} commit * True if the change should be applied. - * @param {Number} direction + * @param {number} direction * The move focus direction number. */ #onValueDone = (value = "", commit, direction) => { @@ -1566,9 +1566,9 @@ class TextPropertyEditor { * Example: Calling with "red; width: 100px" would return * { firstValue: "red", propertiesToAdd: [{ name: "width", value: "100px" }] } * - * @param {String} value + * @param {string} value * The string to parse - * @return {Object} An object with the following properties: + * @return {object} An object with the following properties: * firstValue: A string containing a simple value, like * "red" or "100px!important" * propertiesToAdd: An array with additional properties, following the @@ -1609,9 +1609,9 @@ class TextPropertyEditor { /** * Live preview this property, without committing changes. * - * @param {String} value + * @param {string} value * The value to set the current property to. - * @param {Boolean} reverting + * @param {boolean} reverting * True if we're reverting the previously previewed value */ #previewValue = (value, reverting = false) => { @@ -1634,7 +1634,7 @@ class TextPropertyEditor { * Alt on macosx and ctrl on other OSs * * @param {KeyboardEvent} event - * @returns {Boolean} + * @returns {boolean} */ #hasSmallIncrementModifier(event) { const modifier = @@ -1647,8 +1647,8 @@ class TextPropertyEditor { * e.g. if the input is "128px" it will return an object like * { groups: { value: "128", unit: "px"}} * - * @param {String} value - * @returns {Object|null} + * @param {string} value + * @returns {object | null} */ #parseDimension(value) { // The regex handles values like +1, -1, 1e4, .4, 1.3e-4, 1.567 @@ -1661,7 +1661,7 @@ class TextPropertyEditor { * Check if a textProperty value is supported to add the dragging feature * * @param {TextProperty} textProperty - * @returns {Boolean} + * @returns {boolean} */ #isDraggableProperty(textProperty) { // Check if the feature is explicitly disabled. @@ -1853,7 +1853,7 @@ class TextPropertyEditor { * Validate this property. Does it make sense for this value to be assigned * to this property name? This does not apply the property value * - * @return {Boolean} true if the property name + value pair is valid, false otherwise. + * @return {boolean} true if the property name + value pair is valid, false otherwise. */ isValid() { return this.prop.isValid(); @@ -1862,7 +1862,7 @@ class TextPropertyEditor { /** * Validate the name of this property. * - * @return {Boolean} true if the property name is valid, false otherwise. + * @return {boolean} true if the property name is valid, false otherwise. */ #isNameValid() { return this.prop.isNameValid(); diff --git a/devtools/client/inspector/shared/highlighters-overlay.js b/devtools/client/inspector/shared/highlighters-overlay.js @@ -251,7 +251,7 @@ class HighlightersOverlay { * This is a chance to run some non-essential operations like: logging telemetry data, * storing metadata about the highlighter to enable restoring it after refresh, etc. * - * @param {String} type + * @param {string} type * Highlighter type shown. * @param {NodeFront} nodeFront * Node front of the element that was highlighted. @@ -301,7 +301,7 @@ class HighlightersOverlay { * Returns a promise that resovles with a boolean indicating whether to skip showing * the highlighter with these arguments. * - * @param {String} type + * @param {string} type * Highlighter type to show. * @param {NodeFront} nodeFront * Node front of the element to be highlighted. @@ -363,7 +363,7 @@ class HighlightersOverlay { * Optionally run some operations before hiding a highlighter of a given type. * Runs only if a highlighter of that type exists. * - * @param {String} type + * @param {string} type * highlighter type * @return {Promise} */ @@ -396,9 +396,9 @@ class HighlightersOverlay { /** * Get the maximum number of possible active highlighter instances of a given type. * - * @param {String} type + * @param {string} type * Highlighter type - * @return {Number} + * @return {number} * Default 1 */ #getMaxActiveHighlighters(type) { @@ -424,7 +424,7 @@ class HighlightersOverlay { /** * Get a highlighter instance of the given type for the given node front. * - * @param {String} type + * @param {string} type * Highlighter type. * @param {NodeFront} nodeFront * Node front of the element to be highlighted with the requested highlighter. @@ -451,7 +451,7 @@ class HighlightersOverlay { /** * Get the currently active highlighter of a given type. * - * @param {String} type + * @param {string} type * Highlighter type. * @return {Highlighter|null} * Highlighter instance @@ -475,9 +475,9 @@ class HighlightersOverlay { * - timer: (Optional) index of timer set with setTimout() to autohide the highlighter * Returns an empty object if a highlighter of the given type is not active. * - * @param {String} type + * @param {string} type * Highlighter type. - * @return {Object} + * @return {object} */ getDataForActiveHighlighter(type) { if (!this.#activeHighlighters.has(type)) { @@ -490,9 +490,9 @@ class HighlightersOverlay { /** * Get the configuration options of the active highlighter of a given type. * - * @param {String} type + * @param {string} type * Highlighter type. - * @return {Object} + * @return {object} */ getOptionsForActiveHighlighter(type) { const { options } = this.getDataForActiveHighlighter(type); @@ -502,7 +502,7 @@ class HighlightersOverlay { /** * Get the node front highlighted by a given highlighter type. * - * @param {String} type + * @param {string} type * Highlighter type. * @return {NodeFront|null} * Node front of the element currently being highlighted @@ -525,7 +525,7 @@ class HighlightersOverlay { * In pages with frames running in different processes, this ensures highlighters from * other frames do not stay visible. * - * @param {String} type + * @param {string} type * Highlighter type to show. * @param {NodeFront} nodeFront * Node front of the element to be highlighted. @@ -586,12 +586,12 @@ class HighlightersOverlay { /** * Set a timer to automatically hide all highlighters of a given type after a delay. * - * @param {String} type + * @param {string} type * Highlighter type to hide. - * @param {Number|undefined} duration + * @param {number | undefined} duration * Delay in milliseconds after which to hide the highlighter. * If a duration is not provided, return early without scheduling a task. - * @return {Number|undefined} + * @return {number | undefined} * Index of the scheduled task returned by setTimeout(). */ scheduleAutoHideHighlighterType(type, duration) { @@ -610,7 +610,7 @@ class HighlightersOverlay { /** * Hide all instances of a given highlighter type. * - * @param {String} type + * @param {string} type * Highlighter type to hide. * @return {Promise} */ @@ -649,7 +649,7 @@ class HighlightersOverlay { * * @param {NodeFront} node * Grid container NodeFront. - * @return {Boolean} + * @return {boolean} */ canGridHighlighterToggle(node) { return ( @@ -663,7 +663,7 @@ class HighlightersOverlay { * Returns true when the maximum number of grid highlighter instances is reached. * FIXME: Bug 1572652 should address this constraint. * - * @return {Boolean} + * @return {boolean} */ isGridHighlighterLimitReached() { return this.gridHighlighters.size === this.maxGridHighlighters; @@ -673,7 +673,7 @@ class HighlightersOverlay { * Returns whether `node` is somewhere inside the DOM of the rule view. * * @param {DOMNode} node - * @return {Boolean} + * @return {boolean} */ isRuleView(node) { return !!node.closest("#ruleview-panel"); @@ -714,7 +714,7 @@ class HighlightersOverlay { * * @param {NodeFront} node * The NodeFront of the element with a shape to highlight. - * @param {Object} options + * @param {object} options * Object used for passing options to the shapes highlighter. * @param {TextProperty} textProperty * TextProperty where to write changes. @@ -733,7 +733,7 @@ class HighlightersOverlay { * * @param {NodeFront} node * The NodeFront of the element with a shape to highlight. - * @param {Object} options + * @param {object} options * Object used for passing options to the shapes highlighter. */ async showShapesHighlighter(node, options) { @@ -747,7 +747,7 @@ class HighlightersOverlay { /** * Called after the shape highlighter was shown. * - * @param {Object} data + * @param {object} data * Data associated with the event. * Contains: * - {NodeFront} node: The NodeFront of the element that is highlighted. @@ -793,7 +793,7 @@ class HighlightersOverlay { * * @param {NodeFront} node * The NodeFront of the element to highlight. - * @param {String} point + * @param {string} point * The point to highlight in the shapes highlighter. */ async hoverPointShapesHighlighter(node, point) { @@ -848,7 +848,7 @@ class HighlightersOverlay { * * @param {NodeFront} node * The NodeFront of the flexbox container element to highlight. - * @param. {String} trigger + * @param. {string} trigger * String name matching "layout", "markup" or "rule" to indicate where the * flexbox highlighter was toggled on from. "layout" represents the layout view. * "markup" represents the markup view. "rule" represents the rule view. @@ -868,9 +868,9 @@ class HighlightersOverlay { * * @param {NodeFront} node * The NodeFront of the flexbox container element to highlight. - * @param {Object} options + * @param {object} options * Object used for passing options to the flexbox highlighter. - * @param. {String} trigger + * @param. {string} trigger * String name matching "layout", "markup" or "rule" to indicate where the * flexbox highlighter was toggled on from. "layout" represents the layout view. * "markup" represents the markup view. "rule" represents the rule view. @@ -936,7 +936,7 @@ class HighlightersOverlay { * * @param {NodeFront} node * The NodeFront of the grid container element to highlight. - * @param. {String} trigger + * @param. {string} trigger * String name matching "grid", "markup" or "rule" to indicate where the * grid highlighter was toggled on from. "grid" represents the grid view. * "markup" represents the markup view. "rule" represents the rule view. @@ -978,9 +978,9 @@ class HighlightersOverlay { * * @param {NodeFront} node * The NodeFront of the grid container element to highlight. - * @param {Object} options + * @param {object} options * Object used for passing options to the grid highlighter. - * @param {String} trigger + * @param {string} trigger * String name matching "grid", "markup" or "rule" to indicate where the * grid highlighter was toggled on from. "grid" represents the grid view. * "markup" represents the markup view. "rule" represents the rule view. @@ -1355,9 +1355,9 @@ class HighlightersOverlay { * Restores the saved highlighter state for the given highlighter * and their state. * - * @param {String} type + * @param {string} type * Highlighter type to be restored. - * @param {Object} state + * @param {object} state * Object containing the metadata used to restore the highlighter. * {Array} state.selectors * Array of CSS selector which identifies the node to be highlighted. @@ -1404,9 +1404,9 @@ class HighlightersOverlay { * They typically exist in the context of the page, like the ShapesInContextEditor. * * @param {NodeFront} node. - * @param {String} type + * @param {string} type * Type of in-context editor. Currently supported: "shapesEditor" - * @return {Object|null} + * @return {object | null} * Reference to instance for given type of in-context editor or null. */ async getInContextEditor(node, type) { @@ -1448,7 +1448,7 @@ class HighlightersOverlay { /** * Get a highlighter front given a type. It will only be initialized once. * - * @param {String} type + * @param {string} type * The highlighter type. One of this.highlighters. * @return {Promise} that resolves to the highlighter */ @@ -1491,7 +1491,7 @@ class HighlightersOverlay { * * @param {NodeFront} node * The NodeFront of the shape point to toggle - * @param {Boolean} active + * @param {boolean} active * Whether the shape point should be active */ _toggleShapePointActive(node, active) { @@ -1556,8 +1556,8 @@ class HighlightersOverlay { * Is the current hovered node a css transform property value in the * computed-view. * - * @param {Object} nodeInfo - * @return {Boolean} + * @param {object} nodeInfo + * @return {boolean} */ #isComputedViewTransform(nodeInfo) { if (nodeInfo.view != "computed") { @@ -1574,7 +1574,7 @@ class HighlightersOverlay { * rule-view. * * @param {DOMNode} node - * @return {Boolean} + * @return {boolean} */ #isRuleViewShapeSwatch(node) { return ( @@ -1585,8 +1585,8 @@ class HighlightersOverlay { /** * Is the current hovered node a css transform property value in the rule-view. * - * @param {Object} nodeInfo - * @return {Boolean} + * @param {object} nodeInfo + * @return {boolean} */ #isRuleViewTransform(nodeInfo) { if (nodeInfo.view != "rule") { @@ -1605,8 +1605,8 @@ class HighlightersOverlay { /** * Is the current hovered node a highlightable shape point in the rule-view. * - * @param {Object} nodeInfo - * @return {Boolean} + * @param {object} nodeInfo + * @return {boolean} */ isRuleViewShapePoint(nodeInfo) { if (nodeInfo.view != "rule") { diff --git a/devtools/client/inspector/shared/node-reps.js b/devtools/client/inspector/shared/node-reps.js @@ -35,7 +35,7 @@ loader.lazyRequireGetter( * * @param {NodeFront} nodeFront * The node front to create the element for. - * @param {Object} props + * @param {object} props * Props to pass to the rep. */ function getNodeRep(nodeFront, props = {}) { diff --git a/devtools/client/inspector/shared/style-inspector-menu.js b/devtools/client/inspector/shared/style-inspector-menu.js @@ -46,7 +46,7 @@ const PREF_ORIG_SOURCES = "devtools.source-map.client-service.enabled"; * * @param {RuleView|ComputedView} view * RuleView or ComputedView instance controlling this menu - * @param {Object} options + * @param {object} options * Option menu configuration */ function StyleInspectorMenu(view, { isRuleView = false } = {}) { @@ -311,7 +311,7 @@ StyleInspectorMenu.prototype = { * A helper that determines if the popup was opened with a click to a color * value and saves the color to this._colorToCopy. * - * @return {Boolean} + * @return {boolean} * true if click on color opened the popup, false otherwise. */ _isColorPopup() { @@ -334,7 +334,7 @@ StyleInspectorMenu.prototype = { /** * Check if the current node (clicked node) is an image URL * - * @return {Boolean} true if the node is an image url + * @return {boolean} true if the node is an image url */ _isImageUrl() { const nodeInfo = this._getClickedNodeInfo(); diff --git a/devtools/client/inspector/shared/test/head.js b/devtools/client/inspector/shared/test/head.js @@ -76,7 +76,7 @@ const STYLE_INSPECTOR_L10N = new LocalizationHelper( * A validator function that returns a boolean. * This is called every few milliseconds to check if the result is true. * When it is true, the promise resolves. - * @param {String} name + * @param {string} name * Optional name of the test. This is used to generate * the success and failure messages. * @return a promise that resolves when the function returned true or rejects @@ -100,7 +100,7 @@ function waitForSuccess(validatorFn, name = "untitled") { * Get the dataURL for the font family tooltip. * * @param {Window} win - * @param {String} font + * @param {string} font * The font family value. * @param {object} nodeFront * The NodeActor that will used to retrieve the dataURL for the @@ -130,7 +130,7 @@ var getFontFamilyDataURL = async function (win, font, nodeFront) { * @param {SwatchColorPickerTooltip} colorPicker * @param {Array} newRgba * The new color to be set [r, g, b, a] - * @param {Object} expectedChange + * @param {object} expectedChange * Optional object that needs the following props: * - {DOMNode} element The element in the page that will have its * style changed. @@ -177,7 +177,7 @@ var simulateColorPickerChange = async function ( * * @param {CssComputedView} view * The instance of the computed view panel - * @param {String} name + * @param {string} name * The name of the property to retrieve * @return an object {nameSpan, valueSpan} */ @@ -203,9 +203,9 @@ function getComputedViewProperty(view, name) { * * @param {CssComputedView} view * The instance of the computed view panel - * @param {String} name + * @param {string} name * The name of the property to retrieve - * @return {String} The property value + * @return {string} The property value */ function getComputedViewPropertyValue(view, name, propertyName) { return getComputedViewProperty(view, name, propertyName).valueSpan diff --git a/devtools/client/inspector/shared/tooltips-overlay.js b/devtools/client/inspector/shared/tooltips-overlay.js @@ -148,7 +148,7 @@ TooltipsOverlay.prototype = { * These tooltips are attached to the toolbox document if they require a popup panel. * Otherwise, it is attached to the inspector panel document if it is an inline editor. * - * @param {String} name + * @param {string} name * Identifier name for the tooltip */ getTooltip(name) { @@ -232,8 +232,8 @@ TooltipsOverlay.prototype = { * Given a hovered node info, find out which type of tooltip should be shown, * if any * - * @param {Object} nodeInfo - * @return {String} The tooltip type to be shown, or null + * @param {object} nodeInfo + * @return {string} The tooltip type to be shown, or null */ _getTooltipType({ type, value: prop }) { let tooltipType = null; @@ -383,7 +383,7 @@ TooltipsOverlay.prototype = { * * @param {DOMNode} target * The currently hovered node - * @return {Boolean} + * @return {boolean} * true if shown, false otherwise. */ async onInteractiveTooltipTargetHover(target) { @@ -463,7 +463,7 @@ TooltipsOverlay.prototype = { /** * Send a telemetry Scalar showing that a tooltip of `type` has been opened. * - * @param {String} type + * @param {string} type * The node type from `devtools/client/inspector/shared/node-types` or the Tooltip type. */ sendOpenScalarToTelemetry(type) { @@ -475,7 +475,7 @@ TooltipsOverlay.prototype = { * be relative, a call will be made to the debuggee to retrieve the image content as an * imageData URI. * - * @param {String} imageUrl + * @param {string} imageUrl * The image url value (may be relative or absolute). * @return {Promise} A promise that resolves when the preview tooltip content is ready */ @@ -510,7 +510,7 @@ TooltipsOverlay.prototype = { /** * Set the content of the preview tooltip to display a font family preview. * - * @param {String} font + * @param {string} font * The font family value. * @param {object} nodeFront * The NodeActor that will used to retrieve the dataURL for the font @@ -558,7 +558,7 @@ TooltipsOverlay.prototype = { /** * Set the content of the preview tooltip to display a variable preview. * - * @param {Object} tooltipParams + * @param {object} tooltipParams * See VariableTooltipHelper#setVariableTooltip `params`. * @return {Promise} A promise that resolves when the preview tooltip content is ready */ diff --git a/devtools/client/inspector/shared/utils.js b/devtools/client/inspector/shared/utils.js @@ -37,7 +37,7 @@ const HTML_NS = "http://www.w3.org/1999/xhtml"; * Current text editor value. * @param {number} insertionPoint * The index of the insertion point. - * @return {Boolean} True if the focus should advance; false if + * @return {boolean} True if the focus should advance; false if * the character should be inserted. */ function advanceValidate(keyCode, value, insertionPoint) { @@ -143,9 +143,9 @@ async function getLongString(longStringActorPromise) { * Returns a selector of the Element Rep from the grip. This is based on the * getElements() function in our devtools-reps component for a ElementNode. * - * @param {Object} grip + * @param {object} grip * Grip-like object that can be used with Reps. - * @return {String} selector of the element node. + * @return {string} selector of the element node. */ function getSelectorFromGrip(grip) { const { attributes, displayName } = grip.preview; @@ -185,7 +185,7 @@ function promiseWarn(error) { * * @params {NodeFront} nodeFront * The NodeFront for which we want to create a grip-like object. - * @returns {Object} a grip-like object that can be used with Reps. + * @returns {object} a grip-like object that can be used with Reps. */ function translateNodeFrontToGrip(nodeFront) { const { attributes } = nodeFront; diff --git a/devtools/client/inspector/shared/walker-event-listener.js b/devtools/client/inspector/shared/walker-event-listener.js @@ -11,7 +11,7 @@ class WalkerEventListener { /** * @param {Inspector} - inspector - * @param {Object} - listenerMap + * @param {object} - listenerMap * The structure of listenerMap should be as follows. * { * walkerEventName1: eventHandler1, diff --git a/devtools/client/inspector/store.js b/devtools/client/inspector/store.js @@ -38,7 +38,7 @@ module.exports = inspector => { * Augment the current Redux store with a slice reducer. * Call this method to add reducers on-demand after the initial store creation. * - * @param {String} key + * @param {string} key * Slice name. * @param {Function} reducer * Slice reducer function. diff --git a/devtools/client/inspector/test/browser_inspector_inspect_node_contextmenu.js b/devtools/client/inspector/test/browser_inspector_inspect_node_contextmenu.js @@ -82,8 +82,8 @@ add_task(async function () { * Pick a given element on the page with the 'Inspect Element' context menu entry and check * that the expected node is selected in the markup view. * - * @param {Object} options - * @param {Array<String>} options.selector: The selector of the element in the frame we + * @param {object} options + * @param {Array<string>} options.selector: The selector of the element in the frame we * want to select * @param {Function} options.nodeFrontGetter: A function that will be executed to retrieve * the nodeFront that should be selected as a result of the 'Inspect Element' action. @@ -110,8 +110,8 @@ async function testContextMenuWithinFrame({ selector, nodeFrontGetter }) { /** * Select a specific document in the toolbox frame picker * - * @param {String} frameUrl: The frame URL to select - * @param {Number} expectedFramesCount: The number of frames that should be displayed in + * @param {string} frameUrl: The frame URL to select + * @param {number} expectedFramesCount: The number of frames that should be displayed in * the frame picker */ async function changeToolboxToFrame(frameUrl, expectedFramesCount) { diff --git a/devtools/client/inspector/test/browser_inspector_pseudoclass-lock.js b/devtools/client/inspector/test/browser_inspector_pseudoclass-lock.js @@ -220,9 +220,9 @@ async function assertPseudoRemovedFromView( /** * Check that an element currently has a pseudo-class lock. * - * @param {String} selector The node selector to get the pseudo-class from - * @param {String} pseudo The pseudoclass to check for - * @return {Promise<Boolean>} + * @param {string} selector The node selector to get the pseudo-class from + * @param {string} pseudo The pseudoclass to check for + * @return {Promise<boolean>} */ function hasPseudoClassLock(selector, pseudoClass) { return SpecialPowers.spawn( diff --git a/devtools/client/inspector/test/head.js b/devtools/client/inspector/test/head.js @@ -43,7 +43,7 @@ registerCleanupFunction(function () { * Start the element picker and focus the content window. * * @param {Toolbox} toolbox - * @param {Boolean} skipFocus - Allow tests to bypass the focus event. + * @param {boolean} skipFocus - Allow tests to bypass the focus event. */ var startPicker = async function (toolbox, skipFocus) { info("Start the element picker"); @@ -85,11 +85,11 @@ var startEyeDropper = async function (toolbox) { * * @param {Inspector} inspector * Inspector instance - * @param {String} selector + * @param {string} selector * CSS selector to identify the click target - * @param {Number} x + * @param {number} x * X-offset from the top-left corner of the element matching the provided selector - * @param {Number} y + * @param {number} y * Y-offset from the top-left corner of the element matching the provided selector * @return {Promise} promise that resolves when the selection is updated with the picked * node. @@ -114,7 +114,7 @@ function pickElement(inspector, selector, x, y) { * * @param {Inspector} inspector * Inspector instance - * @param {String|Array} selector + * @param {string | Array} selector * CSS selector to identify the hover target. * Example: ".target" * If the element is at the bottom of a nested iframe stack, the selector should @@ -122,11 +122,11 @@ function pickElement(inspector, selector, x, y) { * The last item of the array should be the element selector within the deepest * nested iframe. Example: ["iframe#top", "iframe#nested", ".target"] - * @param {Number} x + * @param {number} x * X-offset from the top-left corner of the element matching the provided selector - * @param {Number} y + * @param {number} y * Y-offset from the top-left corner of the element matching the provided selector - * @param {Object} eventOptions + * @param {object} eventOptions * Options that will be passed to synthesizeMouse * @return {Promise} promise that resolves when both the "picker-node-hovered" and * "highlighter-shown" events are emitted. @@ -217,7 +217,7 @@ async function getBrowsingContextForNestedFrame(selectorArray = []) { * Highlight a node and set the inspector's current selection to the node or * the first match of the given css selector. * - * @param {String|NodeFront} selector + * @param {string | NodeFront} selector * @param {InspectorPanel} inspector * The instance of InspectorPanel currently loaded in the toolbox * @return a promise that resolves when the inspector is updated with the new @@ -238,7 +238,7 @@ async function selectAndHighlightNode(selector, inspector) { * Select node for a given selector, make it focusable and set focus in its * container element. * - * @param {String|NodeFront} selector + * @param {string | NodeFront} selector * @param {InspectorPanel} inspector The current inspector-panel instance. * @return {MarkupContainer} */ @@ -268,7 +268,7 @@ function clearCurrentNodeSelection(inspector) { /** * Right click on a node in the test page and click on the inspect menu item. * - * @param {String} selector The selector for the node to click on in the page. + * @param {string} selector The selector for the node to click on in the page. * @return {Promise} Resolves to the inspector when it has opened and is updated */ var clickOnInspectMenuItem = async function (selector) { @@ -299,7 +299,7 @@ var clickOnInspectMenuItem = async function (selector) { /** * Get the NodeFront for the document node inside a given iframe. * - * @param {String|NodeFront} frameSelector + * @param {string | NodeFront} frameSelector * A selector that matches the iframe the document node is in * @param {InspectorPanel} inspector * The instance of InspectorPanel currently loaded in the toolbox @@ -317,7 +317,7 @@ var getFrameDocument = async function (frameSelector, inspector) { /** * Get the NodeFront for the shadowRoot of a shadow host. * - * @param {String|NodeFront} hostSelector + * @param {string | NodeFront} hostSelector * Selector or front of the element to which the shadow root is attached. * @param {InspectorPanel} inspector * The instance of InspectorPanel currently loaded in the toolbox @@ -335,9 +335,9 @@ var getShadowRoot = async function (hostSelector, inspector) { /** * Get the NodeFront for a node that matches a given css selector inside a shadow root. * - * @param {String} selector + * @param {string} selector * CSS selector of the node inside the shadow root. - * @param {String|NodeFront} hostSelector + * @param {string | NodeFront} hostSelector * Selector or front of the element to which the shadow root is attached. * @param {InspectorPanel} inspector * The instance of InspectorPanel currently loaded in the toolbox @@ -392,10 +392,10 @@ function getContainerForNodeFront(nodeFront, { markup }) { * Get the MarkupContainer object instance that corresponds to the given * selector * - * @param {String|NodeFront} selector + * @param {string | NodeFront} selector * @param {InspectorPanel} inspector The instance of InspectorPanel currently * loaded in the toolbox - * @param {Boolean} Set to true in the event that the node shouldn't be found. + * @param {boolean} Set to true in the event that the node shouldn't be found. * @return {MarkupContainer} */ var getContainerForSelector = async function ( @@ -420,7 +420,7 @@ var getContainerForSelector = async function ( * Simulate a mouse-over on the markup-container (a line in the markup-view) * that corresponds to the selector passed. * - * @param {String|NodeFront} selector + * @param {string | NodeFront} selector * @param {InspectorPanel} inspector The instance of InspectorPanel currently * loaded in the toolbox * @return {Promise} Resolves when the container is hovered and the higlighter @@ -448,7 +448,7 @@ var hoverContainer = async function (selector, inspector) { * Simulate a click on the markup-container (a line in the markup-view) * that corresponds to the selector passed. * - * @param {String|NodeFront} selector + * @param {string | NodeFront} selector * @param {InspectorPanel} inspector The instance of InspectorPanel currently * loaded in the toolbox * @return {Promise} Resolves when the node has been selected. @@ -568,9 +568,9 @@ async function getNodeFrontForSelector(selector, inspector) { * * @param {Function} check A generator function that is expected to return true at some * stage. - * @param {String} desc A text description to be displayed when the polling starts. - * @param {Number} attemptes Optional number of times we poll. Defaults to 10. - * @param {Number} timeBetweenAttempts Optional time to wait between each attempt. + * @param {string} desc A text description to be displayed when the polling starts. + * @param {number} attemptes Optional number of times we poll. Defaults to 10. + * @param {number} timeBetweenAttempts Optional time to wait between each attempt. * Defaults to 200ms. */ async function poll(check, desc, attempts = 10, timeBetweenAttempts = 200) { @@ -591,7 +591,7 @@ async function poll(check, desc, attempts = 10, timeBetweenAttempts = 200) { * the tests cleaner, without exposing directly `inspector`, `highlighter`, and * `highlighterTestFront` if not needed. * - * @param {String} + * @param {string} * The highlighter's type * @return * A generator function that takes an object with `inspector` and `highlighterTestFront` @@ -751,15 +751,15 @@ const getHighlighterHelperFor = type => * * @param {Inspector} inspector * Inspector client object instance. - * @return {Object} Object with helper methods + * @return {object} Object with helper methods */ function getHighlighterTestHelpers(inspector) { /** * Return a promise which resolves when a highlighter triggers the given event. * - * @param {String} type + * @param {string} type * Highlighter type. - * @param {String} eventName + * @param {string} eventName * Name of the event to listen to. * @return {Promise} * Promise which resolves when the highlighter event occurs. @@ -806,7 +806,7 @@ function getHighlighterTestHelpers(inspector) { * editor * * @param {Toolbox} toolbox - * @param {String} href + * @param {string} href * Optional, if not provided, wait for the first editor to be ready * @return a promise that resolves to the editor when the stylesheet editor is * ready @@ -860,7 +860,7 @@ function waitForStyleEditor(toolbox, href) { * * @param {HTMLDocument} doc document with active element in question * @param {DOMNode} container element tested on focus containment - * @return {Boolean} + * @return {boolean} */ function containsFocus(doc, container) { let elm = doc.activeElement; @@ -891,7 +891,7 @@ var waitForTab = async function () { /** * Simulate the key input for the given input in the window. * - * @param {String} input + * @param {string} input * The string value to input * @param {Window} win * The window containing the panel @@ -907,7 +907,7 @@ function synthesizeKeys(input, win) { * * @param {Window} win * The window containing the panel - * @param {String} key + * @param {string} key * The string value to input */ function focusAndSendKey(win, key) { @@ -1009,26 +1009,26 @@ async function assertTooltipHiddenOnMouseOut(tooltip, target) { * Check the content of a `var()` tooltip on a given rule and property name. * * @param {CssRuleView} view - * @param {String} ruleSelector - * @param {String} propertyName - * @param {Object} tooltipExpected - * @param {String} tooltipExpected.header: The HTML for the top section + * @param {string} ruleSelector + * @param {string} propertyName + * @param {object} tooltipExpected + * @param {string} tooltipExpected.header: The HTML for the top section * (might be the only section when the variable is not a registered property and * there is no starting-style, nor computed value). - * @param {Array<String>} tooltipExpected.headerClasses: Classes applied on the header element + * @param {Array<string>} tooltipExpected.headerClasses: Classes applied on the header element * (no need to include `variable-value` which is always added). - * @param {String} tooltipExpected.computed: The HTML for the computed value section. - * @param {Array<String>} tooltipExpected.computedClasses: Classes applied on the computed value element. + * @param {string} tooltipExpected.computed: The HTML for the computed value section. + * @param {Array<string>} tooltipExpected.computedClasses: Classes applied on the computed value element. * @param {Integer} tooltipExpected.index: The index in the property value for the variable * element we want to check. Defaults to 0 so we can quickly check values when only * one variable is used. - * @param {Boolean} tooltipExpected.isMatched: Is the element matched or unmatched, defaults + * @param {boolean} tooltipExpected.isMatched: Is the element matched or unmatched, defaults * to true. - * @param {String} tooltipExpected.startingStyle: The HTML for the starting-style section. + * @param {string} tooltipExpected.startingStyle: The HTML for the starting-style section. * Pass undefined if the tooltip isn't supposed to have a `@starting-style` section. - * @param {Array<String>} tooltipExpected.startingStyleClasses: Classes applied on the + * @param {Array<string>} tooltipExpected.startingStyleClasses: Classes applied on the * starting-style value element. - * @param {Object} tooltipExpected.registeredProperty: Object whose properties should match + * @param {object} tooltipExpected.registeredProperty: Object whose properties should match * the displayed registered property fields, e.g: * {syntax:`"<color>"`, inherits:"true", "initial-value": "10px"} * The properties values are the HTML of the dd elements. @@ -1170,9 +1170,9 @@ async function assertVariableTooltipForProperty( * Get the text displayed for a given DOM Element's textContent within the * markup view. * - * @param {String} selector + * @param {string} selector * @param {InspectorPanel} inspector - * @return {String} The text displayed in the markup view + * @return {string} The text displayed in the markup view */ async function getDisplayedNodeTextContent(selector, inspector) { // We have to ensure that the textContent is displayed, for that the DOM @@ -1195,11 +1195,11 @@ async function getDisplayedNodeTextContent(selector, inspector) { * * @param {CssRuleView} view * The instance of the rule-view panel - * @param {String} selector + * @param {string} selector * The selector in the rule-view to look for the property in - * @param {String} property + * @param {string} property * The name of the property - * @param {Boolean} show + * @param {boolean} show * If true, the shapes highlighter is being shown. If false, it is being hidden * @param {Options} options * Config option for the shapes highlighter. Contains: @@ -1252,7 +1252,7 @@ async function toggleShapesHighlighter( * The current inspector instance. * @param {MarkupContainer} container * The markup container to click on. - * @param {Object} modifiers + * @param {object} modifiers * options.altKey {Boolean} Use the altKey modifier, to recursively apply * the action to all the children of the container. */ @@ -1294,7 +1294,7 @@ async function simulateColorPickerChange(colorPicker, newRgba) { /** * Assert method to compare the current content of the markupview to a text based tree. * - * @param {String} tree + * @param {string} tree * Multiline string representing the markup view tree, for instance: * `root * child1 @@ -1308,7 +1308,7 @@ async function simulateColorPickerChange(colorPicker, newRgba) { * node in the markup view. Some suffixes are supported: * - !slotted -> indicates that the line corresponds to the slotted version * - !ignore-children -> the node might have children but do not assert them - * @param {String} selector + * @param {string} selector * A CSS selector that will uniquely match the "root" element from the tree * @param {Inspector} inspector * The inspector instance. @@ -1465,10 +1465,10 @@ function waitForNMutations(inspector, type, count) { * in the eyedropper label. * * @param {HighlighterTestFront} highlighterTestFront - * @param {Number} x - * @param {Number} y - * @param {String} expectedColor: Hexa string of the expected color - * @param {String} assertionDescription + * @param {number} x + * @param {number} y + * @param {string} expectedColor: Hexa string of the expected color + * @param {string} assertionDescription */ async function checkEyeDropperColorAt( highlighterTestFront, @@ -1539,8 +1539,8 @@ function reflowContentPage() { /** * Get all box-model regions' adjusted boxquads for the given element * - * @param {String|Array} selector The node selector to target a given element - * @return {Promise<Object>} A promise that resolves with an object with each property of + * @param {string | Array} selector The node selector to target a given element + * @return {Promise<object>} A promise that resolves with an object with each property of * a box-model region, each of them being an object with the p1/p2/p3/p4 properties. */ async function getAllAdjustedQuadsForContentPageElement( @@ -1587,7 +1587,7 @@ async function getAllAdjustedQuadsForContentPageElement( * given node boxquads. * * @param {HighlighterTestFront} highlighterTestFront - * @param {String} selector The node selector to get the boxQuads from + * @param {string} selector The node selector to get the boxQuads from */ async function isNodeCorrectlyHighlighted(highlighterTestFront, selector) { const boxModel = await highlighterTestFront.getBoxModelStatus(); @@ -1618,8 +1618,8 @@ async function isNodeCorrectlyHighlighted(highlighterTestFront, selector) { /** * Get the position and size of the measuring tool. * - * @param {Object} Object returned by getHighlighterHelperFor() - * @return {Promise<Object>} A promise that resolves with an object containing + * @param {object} Object returned by getHighlighterHelperFor() + * @return {Promise<object>} A promise that resolves with an object containing * the x, y, width, and height properties of the measuring tool which has * been drawn on-screen */ diff --git a/devtools/client/inspector/test/search/browser_inspector_search-05.js b/devtools/client/inspector/test/search/browser_inspector_search-05.js @@ -85,8 +85,8 @@ const checkCorrectButton = async function (inspector, frameSelector) { * Gets the currently selected nodefront. It also finds the * document node which contains the node. * - * @param {Object} inspector - * @returns {Object} + * @param {object} inspector + * @returns {object} * nodeFront - The currently selected nodeFront * document - The document which contains the node. */ diff --git a/devtools/client/inspector/test/shared-head.js b/devtools/client/inspector/test/shared-head.js @@ -18,7 +18,7 @@ var { /** * Open the toolbox, with the inspector tool visible. * - * @param {String} hostType Optional hostType, as defined in Toolbox.HostType + * @param {string} hostType Optional hostType, as defined in Toolbox.HostType * @return {Promise} A promise that resolves when the inspector is ready.The promise * resolves with an object containing the following properties: * - toolbox @@ -44,9 +44,9 @@ var openInspector = async function (hostType) { * Open the toolbox, with the inspector tool visible, and the one of the sidebar * tabs selected. * - * @param {String} id + * @param {string} id * The ID of the sidebar tab to be opened - * @return {Promise<Object>} A promise that resolves when the inspector is ready and the tab is + * @return {Promise<object>} A promise that resolves when the inspector is ready and the tab is * visible and ready. The promise resolves with an object containing the * following properties: * - toolbox @@ -82,8 +82,8 @@ var openInspectorSidebarTab = async function (id) { * Open the toolbox, with the inspector tool visible, and the rule-view * sidebar tab selected. * - * @param {Object} options - * @param {Boolean} options.overrideDebounce: Whether to replace the rule view debounce + * @param {object} options + * @param {boolean} options.overrideDebounce: Whether to replace the rule view debounce * method with manual debounce (requires explicit calls to trigger the debounced calls). * Defaults to true. * @return a promise that resolves when the inspector is ready and the rule view @@ -219,7 +219,7 @@ function selectLayoutView(inspector) { * Get the NodeFront for a node that matches a given css selector, via the * protocol. * - * @param {String|NodeFront} selector + * @param {string | NodeFront} selector * @param {InspectorPanel} inspector The instance of InspectorPanel currently * loaded in the toolbox * @return {Promise} Resolves to the NodeFront instance @@ -235,13 +235,13 @@ function getNodeFront(selector, { walker }) { * Set the inspector's current selection to the first match of the given css * selector * - * @param {String|NodeFront} selector + * @param {string | NodeFront} selector * @param {InspectorPanel} inspector * The instance of InspectorPanel currently loaded in the toolbox. - * @param {String} reason + * @param {string} reason * Defaults to "test" which instructs the inspector not to highlight the * node upon selection. - * @param {Boolean} isSlotted + * @param {boolean} isSlotted * Is the selection representing the slotted version the node. * @return {Promise} Resolves when the inspector is updated with the new node */ @@ -382,9 +382,9 @@ async function getNodeFrontInFrames(selectors, inspector) { * Ex: ["frame.first-frame", ..., "frame.last-frame", ".target-node"] * @param {InspectorPanel} inspector * See `selectNode` - * @param {String} reason + * @param {string} reason * See `selectNode` - * @param {Boolean} isSlotted + * @param {boolean} isSlotted * See `selectNode` * @return {NodeFront} The selected node front. */ @@ -433,10 +433,10 @@ function manualDebounce() { /** * Get the requested rule style property from the current browser. * - * @param {Number} styleSheetIndex - * @param {Number} ruleIndex - * @param {String} name - * @return {String} The value, if found, null otherwise + * @param {number} styleSheetIndex + * @param {number} ruleIndex + * @param {string} name + * @return {string} The value, if found, null otherwise */ async function getRulePropertyValue(styleSheetIndex, ruleIndex, name) { @@ -471,11 +471,11 @@ async function getRulePropertyValue(styleSheetIndex, ruleIndex, name) { /** * Get the requested computed style property from the current browser. * - * @param {String} selector + * @param {string} selector * The selector used to obtain the element. - * @param {String} pseudo + * @param {string} pseudo * pseudo id to query, or null. - * @param {String} propName + * @param {string} propName * name of the property. */ async function getComputedStyleProperty(selector, pseudo, propName) { @@ -495,13 +495,13 @@ async function getComputedStyleProperty(selector, pseudo, propName) { * Wait until the requested computed style property has the * expected value in the the current browser. * - * @param {String} selector + * @param {string} selector * The selector used to obtain the element. - * @param {String} pseudo + * @param {string} pseudo * pseudo id to query, or null. - * @param {String} propName + * @param {string} propName * name of the property. - * @param {String} expected + * @param {string} expected * expected value of property */ async function waitForComputedStyleProperty( @@ -584,10 +584,10 @@ var focusEditableField = async function ( * * @param {CssRuleView} view * The instance of the rule-view panel - * @param {String} selectorText + * @param {string} selectorText * The selector in the rule-view for which the rule * object is wanted - * @param {Number} index + * @param {number} index * If there are more than 1 rule with the same selector, you may pass a * index to determine which of the rules you want. * @return {DOMNode} @@ -617,16 +617,16 @@ function getRuleViewRule(view, selectorText, index = 0) { * * @param {CssRuleView} view * The instance of the rule-view panel - * @param {String} selectorText + * @param {string} selectorText * The selector in the rule-view to look for the property in - * @param {String} propertyName + * @param {string} propertyName * The name of the property - * @param {Object=} options - * @param {Boolean=} options.wait + * @param {object=} options + * @param {boolean=} options.wait * When true, returns a promise which waits until a valid rule view * property can be retrieved for the provided selectorText & propertyName. * Defaults to false. - * @return {Object} An object like {nameSpan: DOMNode, valueSpan: DOMNode} + * @return {object} An object like {nameSpan: DOMNode, valueSpan: DOMNode} */ function getRuleViewProperty(view, selectorText, propertyName, options = {}) { if (options.wait) { @@ -661,11 +661,11 @@ function _syncGetRuleViewProperty(view, selectorText, propertyName) { * * @param {CssRuleView} view * The instance of the rule-view panel - * @param {String} selectorText + * @param {string} selectorText * The selector in the rule-view to look for the property in - * @param {String} propertyName + * @param {string} propertyName * The name of the property - * @return {String} The property value + * @return {string} The property value */ function getRuleViewPropertyValue(view, selectorText, propertyName) { return getRuleViewProperty(view, selectorText, propertyName).valueSpan @@ -678,7 +678,7 @@ function getRuleViewPropertyValue(view, selectorText, propertyName) { * * @param {CssRuleView} view * The instance of the rule-view panel - * @param {String} selectorText + * @param {string} selectorText * The selector in the rule-view to look for * @return {DOMNode} The selector DOM element */ @@ -694,7 +694,7 @@ function getRuleViewSelector(view, selectorText) { * * @param {CssRuleView} view * The instance of the rule-view panel - * @param {Number} index + * @param {number} index * The index of the link to get * @return {DOMNode|null} The link if any at this rule index, or null if it doesn't exist */ @@ -708,9 +708,9 @@ function getRuleViewLinkByIndex(view, index) { * * @param {CssRuleView} view * The instance of the rule-view panel - * @param {Number} index + * @param {number} index * The index of the link to get - * @return {String} The string at this index + * @return {string} The string at this index */ function getRuleViewLinkTextByIndex(view, index) { const link = getRuleViewLinkByIndex(view, index); @@ -752,7 +752,7 @@ var focusNewRuleViewProperty = async function (ruleEditor) { * * @param {RuleEditor} ruleEditor * The instance of RuleEditor that will receive the new property(ies) - * @param {String} inputValue + * @param {string} inputValue * The text to be entered in the new property name field * @return a promise that resolves when the new property name has been entered * and once the value field is focused @@ -779,7 +779,7 @@ var createNewRuleViewProperty = async function (ruleEditor, inputValue) { * * @param {CssRuleView} view * The instance of the rule-view panel - * @param {String} searchValue + * @param {string} searchValue * The filter search value * @return a promise that resolves when the rule-view is filtered for the * search term @@ -831,7 +831,7 @@ function openStyleContextMenuAndGetAllItems(view, target) { * Open the inspector menu and return all of it's items in a flat array * * @param {InspectorPanel} inspector - * @param {Object} options to pass into openMenu + * @param {object} options to pass into openMenu * @return An array of MenuItems */ function openContextMenuAndGetAllItems(inspector, options) { @@ -946,8 +946,8 @@ function setContentPageElementProperty(selector, propertyName, propertyValue) { /** * Get all the attributes for a DOM Node living in the content page. * - * @param {String} selector The node selector - * @returns {Array<Object>} An array of {name, value} objects. + * @param {string} selector The node selector + * @returns {Array<object>} An array of {name, value} objects. */ async function getContentPageElementAttributes(selector) { return SpecialPowers.spawn( @@ -966,9 +966,9 @@ async function getContentPageElementAttributes(selector) { /** * Get an attribute on a DOM Node living in the content page. * - * @param {String} selector The node selector - * @param {String} attribute The attribute name - * @return {String} value The attribute value + * @param {string} selector The node selector + * @param {string} attribute The attribute name + * @return {string} value The attribute value */ async function getContentPageElementAttribute(selector, attribute) { return SpecialPowers.spawn( @@ -983,9 +983,9 @@ async function getContentPageElementAttribute(selector, attribute) { /** * Set an attribute on a DOM Node living in the content page. * - * @param {String} selector The node selector - * @param {String} attribute The attribute name - * @param {String} value The attribute value + * @param {string} selector The node selector + * @param {string} attribute The attribute name + * @param {string} value The attribute value */ async function setContentPageElementAttribute(selector, attribute, value) { return SpecialPowers.spawn( @@ -1002,8 +1002,8 @@ async function setContentPageElementAttribute(selector, attribute, value) { /** * Remove an attribute from a DOM Node living in the content page. * - * @param {String} selector The node selector - * @param {String} attribute The attribute name + * @param {string} selector The node selector + * @param {string} attribute The attribute name */ async function removeContentPageElementAttribute(selector, attribute) { return SpecialPowers.spawn( @@ -1020,9 +1020,9 @@ async function removeContentPageElementAttribute(selector, attribute) { * * @param {CssRuleView} ruleView * The instance of the rule-view panel - * @param {Number} childrenIndex + * @param {number} childrenIndex * The children index of the element to get - * @param {Number} nodeIndex + * @param {number} nodeIndex * The child node index of the element to get * @return {DOMNode} The rule editor if any at this index */ @@ -1043,9 +1043,9 @@ function getRuleViewRuleEditor(ruleView, childrenIndex, nodeIndex) { * * @param {RuleView} ruleView * Instance of RuleView. - * @param {Number} ruleIndex + * @param {number} ruleIndex * The index of the CSS rule where to find the declaration. - * @param {Object} declaration + * @param {object} declaration * An object representing the target declaration e.g. { color: red }. * The first TextProperty instance which matches will be returned. * @return {TextProperty} @@ -1073,11 +1073,11 @@ function getTextProperty(ruleView, ruleIndex, declaration) { * The instance of the rule-view panel * @param {TextProperty} textProp * The instance of the TextProperty to be changed - * @param {String} value + * @param {string} value * The new value to be used. If null is passed, then the value will be * deleted - * @param {Object} options - * @param {Boolean} options.blurNewProperty + * @param {object} options + * @param {boolean} options.blurNewProperty * After the value has been changed, a new property would have been * focused. This parameter is true by default, and that causes the new * property to be blurred. Set to false if you don't want this. diff --git a/devtools/client/inspector/toolsidebar.js b/devtools/client/inspector/toolsidebar.js @@ -85,11 +85,11 @@ class ToolSidebar extends EventEmitter { /** * Register a side-panel tab. * - * @param {String} tab uniq id - * @param {String} title tab title + * @param {string} tab uniq id + * @param {string} title tab title * @param {React.Component} panel component. See `InspectorPanelTab` as an example. - * @param {Boolean} selected true if the panel should be selected - * @param {Number} index the position where the tab should be inserted + * @param {boolean} selected true if the panel should be selected + * @param {number} index the position where the tab should be inserted */ addTab(id, title, panel, selected, index) { this.#tabbar.addTab(id, title, selected, panel, null, index); @@ -100,10 +100,10 @@ class ToolSidebar extends EventEmitter { * Helper API for adding side-panels that use existing DOM nodes * (defined within inspector.xhtml) as the content. * - * @param {String} tab uniq id - * @param {String} title tab title - * @param {Boolean} selected true if the panel should be selected - * @param {Number} index the position where the tab should be inserted + * @param {string} tab uniq id + * @param {string} title tab title + * @param {boolean} selected true if the panel should be selected + * @param {number} index the position where the tab should be inserted */ addExistingTab(id, title, selected, index) { const panel = this.InspectorTabPanel({ @@ -119,11 +119,11 @@ class ToolSidebar extends EventEmitter { /** * Queues a side-panel tab to be added.. * - * @param {String} tab uniq id - * @param {String} title tab title + * @param {string} tab uniq id + * @param {string} title tab title * @param {React.Component} panel component. See `InspectorPanelTab` as an example. - * @param {Boolean} selected true if the panel should be selected - * @param {Number} index the position where the tab should be inserted + * @param {boolean} selected true if the panel should be selected + * @param {number} index the position where the tab should be inserted */ queueTab(id, title, panel, selected, index) { this.#tabbar.queueTab(id, title, selected, panel, null, index); @@ -134,10 +134,10 @@ class ToolSidebar extends EventEmitter { * Helper API for queuing side-panels that use existing DOM nodes * (defined within inspector.xhtml) as the content. * - * @param {String} tab uniq id - * @param {String} title tab title - * @param {Boolean} selected true if the panel should be selected - * @param {Number} index the position where the tab should be inserted + * @param {string} tab uniq id + * @param {string} title tab title + * @param {boolean} selected true if the panel should be selected + * @param {number} index the position where the tab should be inserted */ queueExistingTab(id, title, selected, index) { const panel = this.InspectorTabPanel({ @@ -153,7 +153,7 @@ class ToolSidebar extends EventEmitter { /** * Remove an existing tab. * - * @param {String} tabId The ID of the tab that was used to register it, or + * @param {string} tabId The ID of the tab that was used to register it, or * the tab id attribute value if the tab existed before the sidebar * got created. */ @@ -166,8 +166,8 @@ class ToolSidebar extends EventEmitter { /** * Show or hide a specific tab. * - * @param {Boolean} isVisible True to show the tab/tabpanel, False to hide it. - * @param {String} id The ID of the tab to be hidden. + * @param {boolean} isVisible True to show the tab/tabpanel, False to hide it. + * @param {string} id The ID of the tab to be hidden. */ toggleTab(isVisible, id) { this.#tabbar.toggleTab(id, isVisible); @@ -190,7 +190,7 @@ class ToolSidebar extends EventEmitter { /** * Returns the requested tab panel based on the id. * - * @param {String} id + * @param {string} id * @return {DOMNode} */ getTabPanel(id) { @@ -224,9 +224,9 @@ class ToolSidebar extends EventEmitter { /** * Log toolClosed and toolOpened events on telemetry. * - * @param {String} currentToolId + * @param {string} currentToolId * id of the tool being selected. - * @param {String} previousToolId + * @param {string} previousToolId * id of the previously selected tool. */ updateTelemetryOnChange(currentToolId, previousToolId) { @@ -256,7 +256,7 @@ class ToolSidebar extends EventEmitter { * the permitted length of event telemetry property values and what we actually * want to see in our telemetry. * - * @param {String} id + * @param {string} id * The panel id we would like to process. */ getTelemetryPanelNameOrOther(id) { @@ -280,7 +280,7 @@ class ToolSidebar extends EventEmitter { /** * Show the sidebar. * - * @param {String} id + * @param {string} id * The sidebar tab id to select. */ show(id) { diff --git a/devtools/client/jsonview/json-viewer.mjs b/devtools/client/jsonview/json-viewer.mjs @@ -296,7 +296,7 @@ input.actions = { /** * Helper for copying a string to the clipboard. * - * @param {String} string The text to be copied. + * @param {string} string The text to be copied. */ function copyString(string) { document.addEventListener( @@ -314,8 +314,8 @@ function copyString(string) { /** * Helper for dispatching an event. It's handled in chrome scope. * - * @param {String} type Event detail type - * @param {Object} value Event detail value + * @param {string} type Event detail type + * @param {object} value Event detail value */ function dispatchEvent(type, value) { const data = { diff --git a/devtools/client/jsonview/test/browser_jsonview_url_linkification.js b/devtools/client/jsonview/test/browser_jsonview_url_linkification.js @@ -49,7 +49,7 @@ add_task(async function () { * Assert that the expected link is displayed and that clicking on it navigates to the * expected url. * - * @param {Object} option object containing: + * @param {object} option object containing: * - browser (mandatory): the browser the tab will be opened in. * - url (mandatory): The url we should navigate to. * - urlText: The expected displayed text of the url. diff --git a/devtools/client/jsonview/test/head.js b/devtools/client/jsonview/test/head.js @@ -24,10 +24,10 @@ registerCleanupFunction(() => { /** * Add a new test tab in the browser and load the given url. * - * @param {String} url + * @param {string} url * The url to be loaded in the new tab. * - * @param {Object} [optional] + * @param {object} [optional] * An object with the following optional properties: * - appReadyState: The readyState of the JSON Viewer app that you want to * wait for. Its value can be one of: @@ -219,8 +219,8 @@ function getElementAttr(selector, attr) { /** * Return the text of a row given its index, e.g. `key: "value"` * - * @param {Number} rowIndex - * @returns {Promise<String>} + * @param {number} rowIndex + * @returns {Promise<string>} */ async function getRowText(rowIndex) { const key = await getElementText( diff --git a/devtools/client/memory/actions/snapshot.js b/devtools/client/memory/actions/snapshot.js @@ -34,7 +34,7 @@ const TaskCache = require("resource://devtools/client/memory/actions/task-cache. * * @param {MemoryFront} * @param {HeapAnalysesClient} - * @param {Object} + * @param {object} */ exports.takeSnapshotAndCensus = function (front, heapWorker) { return async function ({ dispatch, getState }) { @@ -104,7 +104,7 @@ exports.selectSnapshotAndRefresh = function (heapWorker, id) { * Take a snapshot and return its id on success, or null on failure. * * @param {MemoryFront} front - * @returns {Number|null} + * @returns {number | null} */ const takeSnapshot = (exports.takeSnapshot = function (front) { return async function ({ dispatch, getState }) { @@ -354,8 +354,8 @@ exports.focusIndividual = function (node) { * * @param {HeapAnalysesClient} heapWorker * @param {SnapshotId} id - * @param {Object} censusBreakdown - * @param {Set<Number> | Number} reportLeafIndex + * @param {object} censusBreakdown + * @param {Set<number> | number} reportLeafIndex */ const fetchIndividuals = (exports.fetchIndividuals = function ( heapWorker, diff --git a/devtools/client/memory/components/Heap.js b/devtools/client/memory/components/Heap.js @@ -101,7 +101,7 @@ function getState(view, snapshot, diffing, individuals) { * @param {models.view} view * @param {snapshotModel} snapshot * - * @returns {Boolean} + * @returns {boolean} */ function shouldDisplayStatus(state, view, snapshot) { switch (state) { @@ -129,7 +129,7 @@ function shouldDisplayStatus(state, view, snapshot) { * @param {snapshotState|diffingState|dominatorTreeState} state * @param {diffingModel} diffing * - * @returns {String} + * @returns {string} */ function getStateStatusText(state, diffing) { if (state === diffingState.SELECTING) { @@ -149,7 +149,7 @@ function getStateStatusText(state, diffing) { * * @param {diffingModel} diffing * - * @returns {Boolean} + * @returns {boolean} */ function shouldDisplayThrobber(diffing) { return !diffing || diffing.state !== diffingState.SELECTING; diff --git a/devtools/client/memory/components/tree-map/canvas-utils.js b/devtools/client/memory/components/tree-map/canvas-utils.js @@ -27,8 +27,8 @@ const FULLSCREEN_STYLE = { * Create the canvases, resize handlers, and return references to them all * * @param {HTMLDivElement} parentEl - * @param {Number} debounceRate - * @return {Object} + * @param {number} debounceRate + * @return {object} */ function Canvases(parentEl, debounceRate) { EventEmitter.decorate(this); @@ -74,8 +74,8 @@ function createContainingDiv(parentEl) { * Create a canvas and context * * @param {HTMLDivElement} container - * @param {String} className - * @return {Object} { canvas, ctx } + * @param {string} className + * @return {object} { canvas, ctx } */ function createCanvas(container, className) { const window = container.ownerDocument.defaultView; @@ -98,8 +98,8 @@ function createCanvas(container, className) { * Resize the canvases' resolutions, and fires out the onResize callback * * @param {HTMLDivElement} container - * @param {Object} canvases - * @param {Number} debounceRate + * @param {object} canvases + * @param {number} debounceRate */ function handleResizes(canvases, debounceRate) { const { container, main, zoom } = canvases; diff --git a/devtools/client/memory/components/tree-map/color-coarse-type.js b/devtools/client/memory/components/tree-map/color-coarse-type.js @@ -20,7 +20,7 @@ const L = 0.9; /** * Recursively find the index of the coarse type of a node * - * @param {Object} node + * @param {object} node * d3 treemap * @return {Integer} * index @@ -38,8 +38,8 @@ function findCoarseTypeIndex(node) { /** * Decide a color value for depth to be used in the HSL computation * - * @param {Object} node - * @return {Number} + * @param {object} node + * @return {number} */ function depthColorFactor(node) { return Math.min(1, node.depth / DEPTH_FACTOR); @@ -48,8 +48,8 @@ function depthColorFactor(node) { /** * Decide a color value for type to be used in the HSL computation * - * @param {Object} node - * @return {Number} + * @param {object} node + * @return {number} */ function typeColorFactor(node) { return findCoarseTypeIndex(node) / TYPE_FACTOR; @@ -58,7 +58,7 @@ function typeColorFactor(node) { /** * Color a node * - * @param {Object} node + * @param {object} node * @return {Array} HSL values ranged 0-1 */ module.exports = function colorCoarseType(node) { diff --git a/devtools/client/memory/components/tree-map/drag-zoom.js b/devtools/client/memory/components/tree-map/drag-zoom.js @@ -80,7 +80,7 @@ module.exports = DragZoom; * Only these smoothed values and the container CSS are updated by the loop. * * @param {HTMLDivElement} container - * @param {Object} dragZoom + * @param {object} dragZoom * The values that represent the current dragZoom state * @param {Function} requestAnimationFrame */ @@ -147,7 +147,7 @@ function createUpdateLoop(container, dragZoom, requestAnimationFrame) { /** * Set the various event listeners and return a function to remove them * - * @param {Object} dragZoom + * @param {object} dragZoom * @param {HTMLElement} container * @param {Function} update * @return {Function} The function to remove the handlers @@ -179,7 +179,7 @@ function setHandlers(dragZoom, container, update, debounceRate) { * object with new translate and offset values. * * @param {HTMLElement} container - * @param {Object} dragZoom + * @param {object} dragZoom * @param {Function} changed * @param {Function} update */ @@ -235,7 +235,7 @@ function setDragHandlers(container, dragZoom, emitChanged, update) { * loop is called, and the changed event is emitted. * * @param {HTMLDivElement} container - * @param {Object} dragZoom + * @param {object} dragZoom * @param {Function} changed * @param {Function} update */ @@ -295,7 +295,7 @@ function setScrollHandlers(container, dragZoom, emitChanged, update) { * Account for the various mouse wheel event types, per pixel or per line * * @param {WheelEvent} event - * @return {Number} The scroll size in pixels + * @return {number} The scroll size in pixels */ function getScrollDelta(event) { if (event.deltaMode === LINE_SCROLL_MODE) { @@ -310,7 +310,7 @@ function getScrollDelta(event) { * `dragZoom` object. * * @param {HTMLDivElement} container - * @param {Object} dragZoom + * @param {object} dragZoom */ function keepInView(container, dragZoom) { const { devicePixelRatio } = container.ownerDocument.defaultView; diff --git a/devtools/client/memory/components/tree-map/draw.js b/devtools/client/memory/components/tree-map/draw.js @@ -43,11 +43,11 @@ const COUNT_LABEL = L10N.getStr("tree-map.node-count"); /** * Setup and start drawing the treemap visualization * - * @param {Object} report - * @param {Object} canvases + * @param {object} report + * @param {object} canvases * A CanvasUtils object that contains references to the main and zoom * canvases and contexts - * @param {Object} dragZoom + * @param {object} dragZoom * A DragZoom object representing the current state of the dragging * and zooming behavior */ @@ -102,7 +102,7 @@ const configureD3Treemap = (exports.configureD3Treemap = function (canvas) { /** * Create treemap nodes from a census report that are sorted by depth * - * @param {Object} report + * @param {object} report * @return {Array} An array of d3 treemap nodes * // https://github.com/mbostock/d3/wiki/Treemap-Layout * parent - the parent node, or null for the root. @@ -128,11 +128,11 @@ const configureD3Treemap = (exports.configureD3Treemap = function (canvas) { * it's smaller than the "..." text. * * @param {CanvasRenderingContext2D} ctx - * @param {Number} x + * @param {number} x * the position of the text - * @param {Number} y + * @param {number} y * the position of the text - * @param {Number} innerWidth + * @param {number} innerWidth * the inner width of the containing treemap cell * @param {Text} name */ @@ -164,9 +164,9 @@ const drawTruncatedName = (exports.drawTruncatedName = function ( * ... * * @param {CanvasRenderingContext2D} ctx - * @param {Object} node - * @param {Number} borderWidth - * @param {Object} dragZoom + * @param {object} node + * @param {number} borderWidth + * @param {object} dragZoom * @param {Array} padding */ const drawText = (exports.drawText = function ( @@ -228,10 +228,10 @@ const drawText = (exports.drawText = function ( * Draw a box given a node * * @param {CanvasRenderingContext2D} ctx - * @param {Object} node - * @param {Number} borderWidth - * @param {Number} ratio - * @param {Object} dragZoom + * @param {object} node + * @param {number} borderWidth + * @param {number} ratio + * @param {object} dragZoom * @param {Array} padding */ const drawBox = (exports.drawBox = function ( @@ -305,7 +305,7 @@ const drawTreemap = (exports.drawTreemap = function ( * essentially reversing the transform of the containing element. * * @param {HTMLCanvasElement} canvas - * @param {Object} dragZoom + * @param {object} dragZoom */ const positionZoomedCanvas = function (canvas, dragZoom) { const scale = 1 / (1 + dragZoom.zoom); diff --git a/devtools/client/memory/components/tree-map/start.js b/devtools/client/memory/components/tree-map/start.js @@ -14,9 +14,9 @@ const CanvasUtils = require("resource://devtools/client/memory/components/tree-m * Start the tree map visualization * * @param {HTMLDivElement} container - * @param {Object} report + * @param {object} report * the report from a census - * @param {Number} debounceRate + * @param {number} debounceRate */ module.exports = function startVisualization( parentEl, diff --git a/devtools/client/memory/dominator-tree-lazy-children.js b/devtools/client/memory/dominator-tree-lazy-children.js @@ -10,7 +10,7 @@ * incrementally fetched from the `HeapAnalysesWorker`. * * @param {NodeId} parentNodeId - * @param {Number} siblingIndex + * @param {number} siblingIndex */ function DominatorTreeLazyChildren(parentNodeId, siblingIndex) { this._parentNodeId = parentNodeId; @@ -22,7 +22,7 @@ function DominatorTreeLazyChildren(parentNodeId, siblingIndex) { * be used as the key in a hash table or as the `key` property for a React * component, for example. * - * @returns {String} + * @returns {string} */ DominatorTreeLazyChildren.prototype.key = function () { return `dominator-tree-lazy-children-${this._parentNodeId}-${this._siblingIndex}`; @@ -33,7 +33,7 @@ DominatorTreeLazyChildren.prototype.key = function () { * parent. Return false if it is a placeholder for loading more of its parent's * children. * - * @returns {Boolean} + * @returns {boolean} */ DominatorTreeLazyChildren.prototype.isFirstChild = function () { return this._siblingIndex === 0; @@ -51,7 +51,7 @@ DominatorTreeLazyChildren.prototype.parentNodeId = function () { /** * Get this subtree's index in its parent's children array. * - * @returns {Number} + * @returns {number} */ DominatorTreeLazyChildren.prototype.siblingIndex = function () { return this._siblingIndex; diff --git a/devtools/client/memory/test/browser/head.js b/devtools/client/memory/test/browser/head.js @@ -169,7 +169,7 @@ function getDisplayedSnapshotStatus(document) { /** * Get the index of the currently selected snapshot. * - * @return {Number} + * @return {number} */ function getSelectedSnapshotIndex(store) { const snapshots = store.getState().snapshots; @@ -225,7 +225,7 @@ function waitUntilCensusState(store, getCensus, expected) { /** * Mock out the requestAnimationFrame. * - * @return {Object} + * @return {object} * @function nextFrame * Call the last queued function * @function raf @@ -257,7 +257,7 @@ function createRAFMock() { * * @param {Float} a * @param {Float} b - * @return {Boolean} + * @return {boolean} */ function floatEquality(a, b) { const EPSILON = 0.00000000001; diff --git a/devtools/client/memory/test/chrome/head.js b/devtools/client/memory/test/chrome/head.js @@ -120,7 +120,7 @@ var TEST_NODE_ID_COUNTER = 0; * Create a mock DominatorTreeNode for testing, with sane defaults. Override any * property by providing it on `opts`. Optionally pass child nodes as well. * - * @param {Object} opts + * @param {object} opts * @param {Array<DominatorTreeNode>?} children * * @returns {DominatorTreeNode} diff --git a/devtools/client/memory/test/xpcshell/head.js b/devtools/client/memory/test/xpcshell/head.js @@ -155,11 +155,11 @@ async function createTempFile() { * If the action is async and defines a `status` property, this helper will wait * for the status to reach either "error" or "done". * - * @param {Object} store + * @param {object} store * Redux store where the action should be dispatched. - * @param {String} actionType + * @param {string} actionType * The actionType to wait for. - * @param {Number} repeat + * @param {number} repeat * Optional, number of time the action is expected to be dispatched. * Defaults to 1 * @return {Promise} diff --git a/devtools/client/memory/utils.js b/devtools/client/memory/utils.js @@ -30,7 +30,7 @@ const { * used as a title. * * @param {Snapshot} snapshot - * @return {String} + * @return {string} */ exports.getSnapshotTitle = function (snapshot) { if (!snapshot.creationTime) { @@ -68,7 +68,7 @@ function getCustomDisplaysHelper(pref) { * Returns custom displays defined in `devtools.memory.custom-census-displays` * pref. * - * @return {Object} + * @return {object} */ exports.getCustomCensusDisplays = function () { return getCustomDisplaysHelper(CUSTOM_CENSUS_DISPLAY_PREF); @@ -78,7 +78,7 @@ exports.getCustomCensusDisplays = function () { * Returns custom displays defined in * `devtools.memory.custom-label-displays` pref. * - * @return {Object} + * @return {object} */ exports.getCustomLabelDisplays = function () { return getCustomDisplaysHelper(CUSTOM_LABEL_DISPLAY_PREF); @@ -88,7 +88,7 @@ exports.getCustomLabelDisplays = function () { * Returns custom displays defined in * `devtools.memory.custom-tree-map-displays` pref. * - * @return {Object} + * @return {object} */ exports.getCustomTreeMapDisplays = function () { return getCustomDisplaysHelper(CUSTOM_TREE_MAP_DISPLAY_PREF); @@ -99,7 +99,7 @@ exports.getCustomTreeMapDisplays = function () { * concise than `getStatusTextFull`. * * @param {snapshotState | diffingState} state - * @return {String} + * @return {string} */ // eslint-disable-next-line complexity exports.getStatusText = function (state) { @@ -175,7 +175,7 @@ exports.getStatusText = function (state) { * more verbose than `getStatusText`. * * @param {snapshotState | diffingState} state - * @return {String} + * @return {string} */ // eslint-disable-next-line complexity exports.getStatusTextFull = function (state) { @@ -250,7 +250,7 @@ exports.getStatusTextFull = function (state) { * Return true if the snapshot is in a diffable state, false otherwise. * * @param {snapshotModel} snapshot - * @returns {Boolean} + * @returns {boolean} */ exports.snapshotIsDiffable = function snapshotIsDiffable(snapshot) { return ( @@ -321,11 +321,11 @@ exports.createSnapshot = function createSnapshot(state) { * Return true if the census is up to date with regards to the current filtering * and requested display, false otherwise. * - * @param {String} filter + * @param {string} filter * @param {censusDisplayModel} display * @param {censusModel} census * - * @returns {Boolean} + * @returns {boolean} */ exports.censusIsUpToDate = function (filter, display, census) { return ( @@ -340,8 +340,8 @@ exports.censusIsUpToDate = function (filter, display, census) { * Check to see if the snapshot is in a state that it can take a census. * * @param {SnapshotModel} A snapshot to check. - * @param {Boolean} Assert that the snapshot must be in a ready state. - * @returns {Boolean} + * @param {boolean} Assert that the snapshot must be in a ready state. + * @returns {boolean} */ exports.canTakeCensus = function (snapshot) { return ( @@ -358,7 +358,7 @@ exports.canTakeCensus = function (snapshot) { * otherwise. * * @param {SnapshotModel} snapshot - * @returns {Boolean} + * @returns {boolean} */ exports.dominatorTreeIsComputed = function (snapshot) { return ( @@ -374,7 +374,7 @@ exports.dominatorTreeIsComputed = function (snapshot) { * census. * * @param {SnapshotModel} snapshot - * @returns {Object|null} Either the census, or null if one hasn't completed + * @returns {object | null} Either the census, or null if one hasn't completed */ exports.getSavedCensus = function (snapshot) { if (snapshot.treeMap && snapshot.treeMap.state === treeMapState.SAVED) { @@ -391,7 +391,7 @@ exports.getSavedCensus = function (snapshot) { * snapshot represents. * * @param {CensusModel} census - * @return {Object} + * @return {object} */ exports.getSnapshotTotals = function (census) { let bytes = 0; @@ -410,15 +410,15 @@ exports.getSnapshotTotals = function (census) { * Takes some configurations and opens up a file picker and returns * a promise to the chosen file if successful. * - * @param {String} .title + * @param {string} .title * The title displayed in the file picker window. - * @param {Array<Array<String>>} .filters + * @param {Array<Array<string>>} .filters * An array of filters to display in the file picker. Each filter in the array * is a duple of two strings, one a name for the filter, and one the filter itself * (like "*.json"). - * @param {String} .defaultName + * @param {string} .defaultName * The default name chosen by the file picker window. - * @param {String} .mode + * @param {string} .mode * The mode that this filepicker should open in. Can be "open" or "save". * @return {Promise<?nsIFile>} * The file selected by the user, or null, if cancelled. @@ -458,8 +458,8 @@ exports.openFilePicker = function ({ title, filters, defaultName, mode }) { * Format the provided number with a space every 3 digits, and optionally * prefixed by its sign. * - * @param {Number} number - * @param {Boolean} showSign (defaults to false) + * @param {number} number + * @param {boolean} showSign (defaults to false) */ exports.formatNumber = function (number, showSign = false) { const rounded = Math.round(number); @@ -483,8 +483,8 @@ exports.formatNumber = function (number, showSign = false) { * Format the provided percentage following the same logic as formatNumber and * an additional % suffix. * - * @param {Number} percent - * @param {Boolean} showSign (defaults to false) + * @param {number} percent + * @param {boolean} showSign (defaults to false) */ exports.formatPercent = function (percent, showSign = false) { return exports.L10N.getFormatStr( @@ -497,11 +497,11 @@ exports.formatPercent = function (percent, showSign = false) { * Change an HSL color array with values ranged 0-1 to a properly formatted * ctx.fillStyle string. * - * @param {Number} h + * @param {number} h * hue values ranged between [0 - 1] - * @param {Number} s + * @param {number} s * hue values ranged between [0 - 1] - * @param {Number} l + * @param {number} l * hue values ranged between [0 - 1] * @return {type} */ @@ -516,11 +516,11 @@ exports.hslToStyle = function (h, s, l) { /** * Linearly interpolate between 2 numbers. * - * @param {Number} a - * @param {Number} b - * @param {Number} t + * @param {number} a + * @param {number} b + * @param {number} t * A value of 0 returns a, and 1 returns b - * @return {Number} + * @return {number} */ exports.lerp = function (a, b, t) { return a * (1 - t) + b * t; @@ -529,9 +529,9 @@ exports.lerp = function (a, b, t) { /** * Format a number of bytes as human readable, e.g. 13434 => '13KiB'. * - * @param {Number} n + * @param {number} n * Number of bytes - * @return {String} + * @return {string} */ exports.formatAbbreviatedBytes = function (n) { if (n < BYTES) { diff --git a/devtools/client/netmonitor/initializer.js b/devtools/client/netmonitor/initializer.js @@ -29,7 +29,7 @@ EventEmitter.decorate(window); /** * This is the initialization point for the Network monitor. * - * @param {Object} api Allows reusing existing API object. + * @param {object} api Allows reusing existing API object. */ function initialize(api) { const app = new NetMonitorApp(api); diff --git a/devtools/client/netmonitor/src/actions/ui.js b/devtools/client/netmonitor/src/actions/ui.js @@ -101,7 +101,7 @@ function disableBrowserCache(disabled) { /** * Change performance statistics panel open state. * - * @param {Object} connector - connector object to the backend + * @param {object} connector - connector object to the backend * @param {boolean} visible - expected performance statistics panel open state */ function openStatistics(connector, open) { @@ -180,7 +180,7 @@ function toggleColumn(column) { /** * Set width of multiple columns * - * @param {array} widths - array of pairs {name, width} + * @param {Array} widths - array of pairs {name, width} */ function setColumnsWidth(widths) { return { diff --git a/devtools/client/netmonitor/src/api.js b/devtools/client/netmonitor/src/api.js @@ -160,7 +160,7 @@ NetMonitorAPI.prototype = { /** * Add listener for `onRequestFinished` events. * - * @param {Object} listener + * @param {object} listener * The listener to be called it's expected to be * a function that takes ({harEntry, requestId}) * as first argument. @@ -202,7 +202,7 @@ NetMonitorAPI.prototype = { /** * Resends a given network request * - * @param {String} requestId + * @param {string} requestId * Id of the network request */ resendRequest(requestId) { diff --git a/devtools/client/netmonitor/src/app.js b/devtools/client/netmonitor/src/app.js @@ -45,7 +45,7 @@ const SearchDispatcher = require("resource://devtools/client/netmonitor/src/work * This object can be consumed by other panels (e.g. Console * is using inspectRequest), by the Launchpad (bootstrap), etc. * - * @param {Object} api An existing API object to be reused. + * @param {object} api An existing API object to be reused. */ function NetMonitorApp(api) { this.api = api; diff --git a/devtools/client/netmonitor/src/components/CustomRequestPanel.js b/devtools/client/netmonitor/src/components/CustomRequestPanel.js @@ -84,7 +84,7 @@ class CustomRequestPanel extends Component { * the given name regex and divider character. * * @param {string} text - Text of list - * @return {array} array of headers info {name, value} + * @return {Array} array of headers info {name, value} */ parseRequestText(text, namereg, divider) { const regex = new RegExp(`(${namereg})\\${divider}\\s*(\\S.*)`); @@ -103,8 +103,8 @@ class CustomRequestPanel extends Component { /** * Update Custom Request Fields * - * @param {Object} evt click event - * @param {Object} request current request + * @param {object} evt click event + * @param {object} request current request * @param {updateRequest} updateRequest action */ updateCustomRequestFields(evt, request, updateRequest) { diff --git a/devtools/client/netmonitor/src/components/messages/parsers/socket-io/binary.js b/devtools/client/netmonitor/src/components/messages/parsers/socket-io/binary.js @@ -15,9 +15,9 @@ /** * Reconstructs a binary packet from its placeholder packet and buffers * - * @param {Object} packet - event packet with placeholders + * @param {object} packet - event packet with placeholders * @param {Array} buffers - binary buffers to put in placeholder positions - * @return {Object} reconstructed packet + * @return {object} reconstructed packet * @api public */ diff --git a/devtools/client/netmonitor/src/components/messages/parsers/socket-io/component-emitter.js b/devtools/client/netmonitor/src/components/messages/parsers/socket-io/component-emitter.js @@ -26,8 +26,8 @@ function Emitter(obj) { /** * Mixin the emitter properties. * - * @param {Object} obj - * @return {Object} + * @param {object} obj + * @return {object} * @api private */ @@ -41,7 +41,7 @@ function mixin(obj) { /** * Listen on the given `event` with `fn`. * - * @param {String} event + * @param {string} event * @param {Function} fn * @return {Emitter} * @api public @@ -56,7 +56,7 @@ Emitter.prototype.on = function (event, fn) { /** * Emit `event` with the given args. * - * @param {String} event + * @param {string} event * @param {Mixed} ... * @return {Emitter} */ diff --git a/devtools/client/netmonitor/src/components/messages/parsers/socket-io/index.js b/devtools/client/netmonitor/src/components/messages/parsers/socket-io/index.js @@ -76,7 +76,7 @@ const BINARY_ACK = 6; /** * A socket.io Decoder instance * - * @return {Object} decoder + * @return {object} decoder * @api public */ @@ -95,7 +95,7 @@ Emitter(Decoder.prototype); * be constructed whenever a packet of type BINARY_EVENT is * decoded. * - * @param {Object} packet + * @param {object} packet * @return {BinaryReconstructor} initialized reconstructor * @api private */ @@ -110,7 +110,7 @@ function BinaryReconstructor(packet) { * after a BINARY_EVENT packet. * * @param {Buffer | ArrayBuffer} binData - the raw binary data received - * @return {null | Object} returns null if more binary data is expected or + * @return {null | object} returns null if more binary data is expected or * a reconstructed packet object if all buffers have been received. * @api private */ @@ -140,8 +140,8 @@ BinaryReconstructor.prototype.finishedReconstruction = function () { /** * Decodes an encoded packet string into packet JSON. * - * @param {String} obj - encoded packet - * @return {Object} packet + * @param {string} obj - encoded packet + * @return {object} packet * @api public */ @@ -181,8 +181,8 @@ Decoder.prototype.add = function (obj) { /** * Decode a packet String (JSON data) * - * @param {String} str - * @return {Object} packet + * @param {string} str + * @return {object} packet * @api private */ // eslint-disable-next-line complexity diff --git a/devtools/client/netmonitor/src/components/request-details/CookiesPanel.js b/devtools/client/netmonitor/src/components/request-details/CookiesPanel.js @@ -92,8 +92,8 @@ class CookiesPanel extends Component { * Mapping array to dict for TreeView usage. * Since TreeView only support Object(dict) format. * - * @param {Object[]} arr - key-value pair array like cookies or params - * @returns {Object} + * @param {object[]} arr - key-value pair array like cookies or params + * @returns {object} */ getProperties(arr, title) { const cookies = arr.reduce((map, obj) => { @@ -118,7 +118,7 @@ class CookiesPanel extends Component { * Custom rendering method passed to PropertiesView. It's * responsible to filter out level 0 node in the tree * - * @param {Object} props + * @param {object} props */ renderRow(props) { const { level } = props.member; @@ -133,7 +133,7 @@ class CookiesPanel extends Component { /** * Get the selected cookies path * - * @param {Object} searchResult + * @param {object} searchResult * @returns {string} */ getTargetCookiePath(searchResult) { diff --git a/devtools/client/netmonitor/src/components/request-details/RequestPanel.js b/devtools/client/netmonitor/src/components/request-details/RequestPanel.js @@ -132,8 +132,8 @@ class RequestPanel extends Component { * This function is not sorting result properties since it can * results in unexpected order of params. See bug 1469533 * - * @param {Object[]} arr - key-value pair array or form params - * @returns {Object} Rep compatible object + * @param {object[]} arr - key-value pair array or form params + * @returns {object} Rep compatible object */ getProperties(arr) { return arr.reduce((map, obj) => { diff --git a/devtools/client/netmonitor/src/components/request-details/ResponsePanel.js b/devtools/client/netmonitor/src/components/request-details/ResponsePanel.js @@ -261,7 +261,7 @@ class ResponsePanel extends Component { * Pick correct component, componentprops, and other needed data to render * the given response * - * @returns {Object} shape: + * @returns {object} shape: * {component}: React component used to render response * {Object} componetProps: Props passed to component * {Error} error: JSON parsing error diff --git a/devtools/client/netmonitor/src/connector/firefox-data-provider.js b/devtools/client/netmonitor/src/connector/firefox-data-provider.js @@ -30,9 +30,9 @@ class FirefoxDataProvider { /** * Constructor for data provider * - * @param {Object} commands Object defined from devtools/shared/commands to interact with the devtools backend - * @param {Object} actions set of actions fired during data fetching process. - * @param {Object} owner all events are fired on this object. + * @param {object} commands Object defined from devtools/shared/commands to interact with the devtools backend + * @param {object} actions set of actions fired during data fetching process. + * @param {object} owner all events are fired on this object. */ constructor({ commands, actions, owner }) { // Options diff --git a/devtools/client/netmonitor/src/connector/index.js b/devtools/client/netmonitor/src/connector/index.js @@ -73,9 +73,9 @@ class Connector { /** * Connect to the backend. * - * @param {Object} connection object with e.g. reference to the Toolbox. - * @param {Object} actions (optional) is used to fire Redux actions to update store. - * @param {Object} getState (optional) is used to get access to the state. + * @param {object} connection object with e.g. reference to the Toolbox. + * @param {object} actions (optional) is used to fire Redux actions to update store. + * @param {object} getState (optional) is used to get access to the state. */ async connect(connection, actions, getState) { this.actions = actions; diff --git a/devtools/client/netmonitor/src/har/har-builder.js b/devtools/client/netmonitor/src/har/har-builder.js @@ -25,19 +25,19 @@ const { * https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HAR/Overview.html * http://www.softwareishard.com/blog/har-12-spec/ * - * @param {Object} options + * @param {object} options * configuration object - * @param {Boolean} options.connector + * @param {boolean} options.connector * Set to true to include HTTP response bodies in the result data * structure. - * @param {String} options.id + * @param {string} options.id * ID of the exported page. - * @param {Boolean} options.includeResponseBodies + * @param {boolean} options.includeResponseBodies * Set to true to include HTTP response bodies in the result data * structure. * @param {Array} options.items * List of network events to be exported. - * @param {Boolean} options.supportsMultiplePages + * @param {boolean} options.supportsMultiplePages * Set to true to create distinct page entries for each navigation. */ var HarBuilder = function (options) { @@ -268,7 +268,7 @@ HarBuilder.prototype = { * Fetch all header values from the backend (if necessary) and * build the result HAR structure. * - * @param {Object} input Request or response header object. + * @param {object} input Request or response header object. */ buildHeaders(input) { if (!input) { diff --git a/devtools/client/netmonitor/src/har/har-exporter.js b/devtools/client/netmonitor/src/har/har-exporter.js @@ -117,7 +117,7 @@ const HarExporter = { * Helper to save the har file into a .zip file * * @param {nsIFIle} file The final zip file - * @param {String} fileName Name of the har file within the zip file + * @param {string} fileName Name of the har file within the zip file * @param {ArrayBuffer} buffer Content of the har file */ _zip(file, fileName, buffer) { diff --git a/devtools/client/netmonitor/src/har/har-utils.js b/devtools/client/netmonitor/src/har/har-utils.js @@ -57,8 +57,8 @@ var HarUtils = { * * @param {File} file Target file where the HAR string (JSON) * should be stored. - * @param {String} jsonString HAR data (JSON or JSONP) - * @param {Boolean} compress The result file is zipped if set to true. + * @param {string} jsonString HAR data (JSON or JSONP) + * @param {boolean} compress The result file is zipped if set to true. */ saveToFile(file, jsonString, compress) { const openFlags = diff --git a/devtools/client/netmonitor/src/har/test/head.js b/devtools/client/netmonitor/src/har/test/head.js @@ -18,7 +18,7 @@ const HAR_EXAMPLE_URL = /** * Trigger a "copy all as har" from the context menu of the requests list. - * @param {Object} monitor + * @param {object} monitor * The network monitor object */ async function copyAllAsHARWithContextMenu(monitor, { asString = false } = {}) { @@ -47,7 +47,7 @@ async function copyAllAsHARWithContextMenu(monitor, { asString = false } = {}) { /** * Trigger a "save as har" from the context menu of the requests list. - * @param {Object} monitor + * @param {object} monitor * The network monitor object */ async function saveAsHARWithContextMenu(monitor, { asString = false } = {}) { diff --git a/devtools/client/netmonitor/src/utils/context-menu-utils.js b/devtools/client/netmonitor/src/utils/context-menu-utils.js @@ -19,7 +19,7 @@ function baseCopyFormatter({ name, value, hasChildren }) { * The default format for the content copied to the clipboard when the `Copy All` * option is selected. * - * @param {Object} object The whole data object + * @param {object} object The whole data object */ function baseCopyAllFormatter(object) { return JSON.stringify(object, null, "\t"); diff --git a/devtools/client/netmonitor/src/utils/format-utils.js b/devtools/client/netmonitor/src/utils/format-utils.js @@ -107,7 +107,7 @@ function getFormattedIPAndPort(ip, port) { * Based on unix conventions * See xpcom/threads/nsISupportsPriority.idl * - * @param {Number} priority - request priority + * @param {number} priority - request priority */ function getRequestPriorityAsText(priority) { if (priority < PRIORITY_HIGH) { diff --git a/devtools/client/netmonitor/src/utils/request-utils.js b/devtools/client/netmonitor/src/utils/request-utils.js @@ -47,7 +47,7 @@ const CONTENT_MIME_TYPE_ABBREVIATIONS = new Map([ * @param {object} headers - the "requestHeaders". * @param {object} uploadHeaders - the "requestHeadersFromUploadStream". * @param {object} postData - the "requestPostData". - * @return {array} a promise list that is resolved with the extracted form data. + * @return {Array} a promise list that is resolved with the extracted form data. */ async function getFormDataSections( headers, @@ -106,7 +106,7 @@ async function fetchHeaders(headers, getLongString) { * * @param {function} requestData - requestData function for lazily fetch data * @param {object} request - request object - * @param {array} updateTypes - a list of network event update types + * @param {Array} updateTypes - a list of network event update types */ function fetchNetworkUpdatePacket(requestData, request, updateTypes) { const promises = []; @@ -159,7 +159,7 @@ function formDataURI(mimeType, encoding, text) { /** * Write out a list of headers into a chunk of text * - * @param {array} headers - array of headers info { name, value } + * @param {Array} headers - array of headers info { name, value } * @param {string} preHeaderText - first line of the headers request/response * @return {string} list of headers in text format */ @@ -405,7 +405,7 @@ function getUrlToolTip(urlDetails) { * Parse a url's query string into its components * * @param {string} query - query string of a url portion - * @return {array} array of query params { name, value } + * @return {Array} array of query params { name, value } */ function parseQueryString(query) { if (!query) { @@ -429,7 +429,7 @@ function parseQueryString(query) { * Parse a string of formdata sections into its components * * @param {string} sections - sections of formdata joined by & - * @return {array} array of formdata params { name, value } + * @return {Array} array of formdata params { name, value } */ function parseFormData(sections) { if (!sections) { @@ -708,7 +708,7 @@ function isBase64(payload) { * and returning the stripped chars in the strippedChars property * This function also handles Base64 encoded JSON. * - * @returns {Object} shape: + * @returns {object} shape: * {Object} json: parsed JSON object * {Error} error: JSON parsing error * {string} strippedChars: XSSI stripped chars removed from JSON payload @@ -770,7 +770,7 @@ function parseJSON(payloadUnclean) { * * @param {string} payloadUnclean: JSON payload that may or may have a * XSSI prevention sequence - * @returns {Object} Shape: + * @returns {object} Shape: * {string} payload: the JSON witht the XSSI prevention sequence removed * {string} strippedChars: XSSI string that was removed, null if no XSSI * prevention sequence was found diff --git a/devtools/client/netmonitor/src/widgets/HeadersPanelContextMenu.js b/devtools/client/netmonitor/src/widgets/HeadersPanelContextMenu.js @@ -34,8 +34,8 @@ class HeadersPanelContextMenu { /** * Handle the context menu opening. * - * @param {Object} event open event - * @param {Object} selection object representing the current selection + * @param {object} event open event + * @param {object} selection object representing the current selection */ open(event = {}, selection) { const { target } = event; @@ -82,8 +82,8 @@ class HeadersPanelContextMenu { /** * Copies all. * - * @param {Object} object the whole tree data - * @param {Object} selection object representing the current selection + * @param {object} object the whole tree data + * @param {object} selection object representing the current selection */ copyAll(object, selection) { let buffer = ""; @@ -107,8 +107,8 @@ class HeadersPanelContextMenu { /** * Copies the value of a single item. * - * @param {Object} object data object for specific node - * @param {Object} selection object representing the current selection + * @param {object} object data object for specific node + * @param {object} selection object representing the current selection */ copyValue(object, selection) { let buffer = ""; diff --git a/devtools/client/netmonitor/src/widgets/PropertiesViewContextMenu.js b/devtools/client/netmonitor/src/widgets/PropertiesViewContextMenu.js @@ -34,11 +34,11 @@ class PropertiesViewContextMenu { /** * Handle the context menu opening. * - * @param {Object} event open event - * @param {Object} selection object representing the current selection - * @param {Object} data object containing information - * @param {Object} data.member member of the right-clicked row - * @param {Object} data.object the whole tree data (can be optional) + * @param {object} event open event + * @param {object} selection object representing the current selection + * @param {object} data object containing information + * @param {object} data.member member of the right-clicked row + * @param {object} data.object the whole tree data (can be optional) */ open(event = {}, selection, { member, object }) { const menuItems = [ @@ -66,8 +66,8 @@ class PropertiesViewContextMenu { /** * Copies all. * - * @param {Object} object the whole tree data - * @param {Object} selection object representing the current selection + * @param {object} object the whole tree data + * @param {object} selection object representing the current selection */ copyAll(object, selection) { let buffer = ""; @@ -91,8 +91,8 @@ class PropertiesViewContextMenu { /** * Copies the value of a single item. * - * @param {Object} member member of the right-clicked row - * @param {Object} selection object representing the current selection + * @param {object} member member of the right-clicked row + * @param {object} selection object representing the current selection */ copyValue(member, selection) { let buffer = ""; diff --git a/devtools/client/netmonitor/src/widgets/WaterfallBackground.js b/devtools/client/netmonitor/src/widgets/WaterfallBackground.js @@ -146,7 +146,7 @@ class WaterfallBackground { /** * Retrieve a color defined for the provided theme as a rgba array. * - * @param {String} colorVariableName + * @param {string} colorVariableName * The name of the variable defining the color * @return {Array} RGBA array for the color. */ diff --git a/devtools/client/netmonitor/test/browser_net_statistics-content.js b/devtools/client/netmonitor/test/browser_net_statistics-content.js @@ -254,7 +254,7 @@ async function assertChartContent( * on the condition. * * @param {Array} requests - * @param {String} field + * @param {string} field * @param {Function} condition * @returns {number} */ @@ -269,10 +269,10 @@ function accumulate(requests, field, condition = () => true) { /** * Assert that two values are equal or different by up to a specific margin * - * @param {Number} actual - * @param {Number} expected - * @param {Number} margin - * @param {String} comment + * @param {number} actual + * @param {number} expected + * @param {number} margin + * @param {string} comment */ function isSimilar(actual, expected, margin, comment) { Assert.greaterOrEqual(actual, expected - margin, comment); diff --git a/devtools/client/netmonitor/test/browser_net_waterfall-resize.js b/devtools/client/netmonitor/test/browser_net_waterfall-resize.js @@ -66,7 +66,7 @@ add_task(async function () { * * @param {Document} doc * Netmonitor document. - * @param {function=} predicate + * @param {Function=} predicate * Optional predicate to avoid returning erroneous width. On windows CI, * the second measure is hard to get right, so we use the predicate to make * sure we retrieve the good size. diff --git a/devtools/client/netmonitor/test/head.js b/devtools/client/netmonitor/test/head.js @@ -443,7 +443,7 @@ function restartNetMonitor(monitor, { requestCount }) { /** * Clears the network requests in the UI * - * @param {Object} monitor + * @param {object} monitor * The netmonitor instance used for retrieving a context menu element. */ async function clearNetworkEvents(monitor) { @@ -479,11 +479,11 @@ function teardown(monitor, privateWindow) { /** * Wait for the request(s) to be fully notified to the frontend. * - * @param {Object} monitor + * @param {object} monitor * The netmonitor instance used for retrieving a context menu element. - * @param {Number} getRequests + * @param {number} getRequests * The number of request to wait for - * @param {Object} options (optional) + * @param {object} options (optional) * - expectedEventTimings {Number} Number of EVENT_TIMINGS events to wait for. * In case of filtering, we get less of such events. */ @@ -1143,7 +1143,7 @@ async function showColumn(monitor, column) { /** * Select a request and switch to its response panel. * - * @param {Number} index The request index to be selected + * @param {number} index The request index to be selected */ async function selectIndexAndWaitForSourceEditor(monitor, index) { const { document } = monitor.panelWin; @@ -1169,9 +1169,9 @@ async function selectIndexAndWaitForSourceEditor(monitor, index) { /** * Helper function for executing XHRs on a test page. * - * @param {Object} monitor - * @param {Object} tab - The current browser tab - * @param {Number} count - Number of requests to be executed. + * @param {object} monitor + * @param {object} tab - The current browser tab + * @param {number} count - Number of requests to be executed. */ async function performRequests(monitor, tab, count) { const wait = waitForNetworkEvents(monitor, count); @@ -1228,10 +1228,10 @@ function getSettingsMenuItem(monitor, itemKey) { /** * Wait for lazy fields to be loaded in a request. * - * @param {Object} Store - redux store containing request list. + * @param {object} Store - redux store containing request list. * @param {Array} fields - array of strings which contain field names to be checked - * @param {Number} id - The id of the request whose data we need to wait for - * @param {Number} index - The position of the request in the sorted request list. + * @param {number} id - The id of the request whose data we need to wait for + * @param {number} index - The position of the request in the sorted request list. */ function waitForRequestData(store, fields, id, index = 0) { return waitUntil(() => { @@ -1301,7 +1301,7 @@ function queryTelemetryEvents(query) { /** * Check that the provided requests match the requests displayed in the netmonitor. * - * @param {array} requests + * @param {Array} requests * The expected requests. * @param {object} monitor * The netmonitor instance. @@ -1439,11 +1439,11 @@ async function waitForDOMIfNeeded(target, selector, expectedLength = 1) { * * @param {Element} element * Target request list item to be right clicked to bring up its context menu. - * @param {Object} monitor + * @param {object} monitor * The netmonitor instance used for retrieving a context menu element. - * @param {Object} store + * @param {object} store * The redux store (wait-service middleware required). - * @param {String} action + * @param {string} action * The action, block or unblock, to construct a corresponding context menu id. */ async function toggleBlockedUrl(element, monitor, store, action = "block") { @@ -1465,7 +1465,7 @@ async function toggleBlockedUrl(element, monitor, store, action = "block") { * * @param {Element} element * Target element to be clicked - * @param {Object} monitor + * @param {object} monitor * The netmonitor instance used for retrieving the window. */ @@ -1519,7 +1519,7 @@ function compareValues(first, second) { * * @param {Document} doc * Network panel document. - * @param {String} name + * @param {string} name * Network panel sidebar tab name. */ const clickOnSidebarTab = (doc, name) => { @@ -1541,7 +1541,7 @@ const clickOnSidebarTab = (doc, name) => { * * @param {string} pattern * The URL pattern to add to block requests. - * @param {Object} monitor + * @param {object} monitor * The netmonitor instance. */ async function addBlockedRequest(pattern, monitor) { @@ -1583,7 +1583,7 @@ function checkRequestListItemBlocked(item) { * * @param {string} string * The string to type. - * @param {Object} monitor + * @param {object} monitor * The netmonitor instance used to type the string. */ function typeInNetmonitor(string, monitor) { @@ -1595,7 +1595,7 @@ function typeInNetmonitor(string, monitor) { /** * Opens/ closes the URL preview in the headers side panel * - * @param {Boolean} shouldExpand + * @param {boolean} shouldExpand * @param {NetMonitorPanel} monitor * @returns */ @@ -1620,8 +1620,8 @@ async function toggleUrlPreview(shouldExpand, monitor) { /** * Wait for the eager evaluated result from the split console * - * @param {Object} hud - * @param {String} text - expected evaluation result + * @param {object} hud + * @param {string} text - expected evaluation result */ async function waitForEagerEvaluationResult(hud, text) { await waitUntil(() => { @@ -1641,7 +1641,7 @@ async function waitForEagerEvaluationResult(hud, text) { * Assert the contents of the filter urls autocomplete box * * @param {Array} expected - * @param {Object} document + * @param {object} document */ function testAutocompleteContents(expected, document) { expected.forEach(function (item, i) { diff --git a/devtools/client/netmonitor/test/network-overrides-test-helpers.js b/devtools/client/netmonitor/test/network-overrides-test-helpers.js @@ -163,11 +163,11 @@ function assertOverrideCellStatus(request, { overridden }) { /** * Open the netmonitor context menu on the provided element * - * @param {Object} monitor + * @param {object} monitor * The network monitor object * @param {Element} el * The element on which the menu should be opened - * @param {String} id + * @param {string} id * The id of the context menu item */ async function openContextMenuForItem(monitor, el, id) { diff --git a/devtools/client/performance-new/components/aboutprofiling/AboutProfiling.js b/devtools/client/performance-new/components/aboutprofiling/AboutProfiling.js @@ -63,12 +63,12 @@ function encodeShellValue(value) { /** * @typedef {import("../../@types/perf").RecordingSettings} RecordingSettings * - * @typedef {Object} ButtonStateProps + * @typedef {object} ButtonStateProps * @property {RecordingSettings} recordingSettings * * @typedef {ButtonStateProps} ButtonProps * - * @typedef {Object} ButtonState + * @typedef {object} ButtonState * @property {boolean} hasDeveloperOptions */ @@ -236,7 +236,7 @@ const MoreActionsButton = connect(mapStateToButtonProps)(MoreActionsButtonImpl); /** * @typedef {import("../../@types/perf").PageContext} PageContext * - * @typedef {Object} StateProps + * @typedef {object} StateProps * @property {boolean?} isSupportedPlatform * @property {PageContext} pageContext * @property {string | null} promptEnvRestart diff --git a/devtools/client/performance-new/components/aboutprofiling/DirectoryPicker.js b/devtools/client/performance-new/components/aboutprofiling/DirectoryPicker.js @@ -4,7 +4,7 @@ // @ts-check /** - * @typedef {Object} Props + * @typedef {object} Props * @property {string[]} dirs * @property {() => void} onAdd * @property {(index: number) => void} onRemove diff --git a/devtools/client/performance-new/components/aboutprofiling/Presets.js b/devtools/client/performance-new/components/aboutprofiling/Presets.js @@ -31,7 +31,7 @@ const Localized = createFactory( ); /** - * @typedef {Object} PresetProps + * @typedef {object} PresetProps * @property {string} presetName * @property {boolean} selected * @property {import("../../@types/perf").PresetDefinition | null} preset @@ -90,13 +90,13 @@ class Preset extends PureComponent { } /** - * @typedef {Object} StateProps + * @typedef {object} StateProps * @property {string} selectedPresetName * @property {import("../../@types/perf").Presets} presets */ /** - * @typedef {Object} ThunkDispatchProps + * @typedef {object} ThunkDispatchProps * @property {typeof actions.changePreset} changePreset */ diff --git a/devtools/client/performance-new/components/aboutprofiling/Range.js b/devtools/client/performance-new/components/aboutprofiling/Range.js @@ -8,7 +8,7 @@ */ /** - * @typedef {Object} Props + * @typedef {object} Props * @property {number} value * @property {React.ReactNode} label * @property {string} id diff --git a/devtools/client/performance-new/components/aboutprofiling/Settings.js b/devtools/client/performance-new/components/aboutprofiling/Settings.js @@ -4,7 +4,7 @@ // @ts-check /** - * @typedef {Object} StateProps + * @typedef {object} StateProps * @property {number} interval * @property {number} entries * @property {string[]} features @@ -15,7 +15,7 @@ */ /** - * @typedef {Object} ThunkDispatchProps + * @typedef {object} ThunkDispatchProps * @property {typeof actions.changeInterval} changeInterval * @property {typeof actions.changeEntries} changeEntries * @property {typeof actions.changeFeatures} changeFeatures @@ -28,7 +28,7 @@ */ /** - * @typedef {Object} State + * @typedef {object} State * @property {null | string} temporaryThreadText */ diff --git a/devtools/client/performance-new/components/panel/DevToolsPanel.js b/devtools/client/performance-new/components/panel/DevToolsPanel.js @@ -9,12 +9,12 @@ */ /** - * @typedef {Object} StateProps + * @typedef {object} StateProps * @property {boolean?} isSupportedPlatform */ /** - * @typedef {Object} OwnProps + * @typedef {object} OwnProps * @property {import("../../@types/perf").PerfFront} perfFront * @property {import("../../@types/perf").OnProfileReceived} onProfileReceived * @property {() => void} onEditSettingsLinkClicked diff --git a/devtools/client/performance-new/components/panel/DevToolsPresetSelection.js b/devtools/client/performance-new/components/panel/DevToolsPresetSelection.js @@ -9,7 +9,7 @@ */ /** - * @typedef {Object} StateProps + * @typedef {object} StateProps * @property {string} presetName * @property {number} interval * @property {string[]} threads @@ -18,12 +18,12 @@ */ /** - * @typedef {Object} ThunkDispatchProps + * @typedef {object} ThunkDispatchProps * @property {typeof actions.changePreset} changePreset */ /** - * @typedef {Object} OwnProps + * @typedef {object} OwnProps * @property {() => void} onEditSettingsLinkClicked */ diff --git a/devtools/client/performance-new/components/panel/OnboardingMessage.js b/devtools/client/performance-new/components/panel/OnboardingMessage.js @@ -8,7 +8,7 @@ */ /** - * @typedef {Object} State + * @typedef {object} State * @property {boolean} isOnboardingEnabled */ diff --git a/devtools/client/performance-new/components/panel/ProfilerEventHandling.js b/devtools/client/performance-new/components/panel/ProfilerEventHandling.js @@ -17,20 +17,20 @@ */ /** - * @typedef {Object} StateProps + * @typedef {object} StateProps * @property {RecordingState} recordingState * @property {boolean?} isSupportedPlatform */ /** - * @typedef {Object} ThunkDispatchProps + * @typedef {object} ThunkDispatchProps * @property {typeof actions.reportProfilerReady} reportProfilerReady * @property {typeof actions.reportProfilerStarted} reportProfilerStarted * @property {typeof actions.reportProfilerStopped} reportProfilerStopped */ /** - * @typedef {Object} OwnProps + * @typedef {object} OwnProps * @property {PerfFront} perfFront * @property {RootTraits} traits */ diff --git a/devtools/client/performance-new/components/panel/RecordingButton.js b/devtools/client/performance-new/components/panel/RecordingButton.js @@ -9,7 +9,7 @@ */ /** - * @typedef {Object} StateProps + * @typedef {object} StateProps * @property {RecordingState} recordingState * @property {boolean | null} isSupportedPlatform * @property {boolean} recordingUnexpectedlyStopped @@ -17,13 +17,13 @@ */ /** - * @typedef {Object} OwnProps + * @typedef {object} OwnProps * @property {import("../../@types/perf").OnProfileReceived} onProfileReceived * @property {import("../../@types/perf").PerfFront} perfFront */ /** - * @typedef {Object} ThunkDispatchProps + * @typedef {object} ThunkDispatchProps * @property {typeof actions.startRecording} startRecording * @property {typeof actions.getProfileAndStopProfiler} getProfileAndStopProfiler * @property {typeof actions.stopProfilerAndDiscardProfile} stopProfilerAndDiscardProfile diff --git a/devtools/client/performance-new/components/panel/ToolboxHighlightController.js b/devtools/client/performance-new/components/panel/ToolboxHighlightController.js @@ -4,12 +4,12 @@ // @ts-check /** - * @typedef {Object} StateProps + * @typedef {object} StateProps * @property {RecordingState} recordingState */ /** - * @typedef {Object} OwnProps + * @typedef {object} OwnProps * @property {any} toolbox */ diff --git a/devtools/client/performance-new/components/shared/ProfilerPreferenceObserver.js b/devtools/client/performance-new/components/shared/ProfilerPreferenceObserver.js @@ -13,14 +13,14 @@ */ /** - * @typedef {Object} StateProps + * @typedef {object} StateProps * @property {import("../../@types/perf").RecordingSettings} recordingSettingsFromRedux * @property {import("../../@types/perf").PageContext} pageContext * @property {string[]} supportedFeatures */ /** - * @typedef {Object} ThunkDispatchProps + * @typedef {object} ThunkDispatchProps * @property {typeof actions.updateSettingsFromPreferences} updateSettingsFromPreferences */ diff --git a/devtools/client/performance-new/popup/logic.sys.mjs b/devtools/client/performance-new/popup/logic.sys.mjs @@ -13,7 +13,7 @@ */ /** - * @typedef {Object} State - The mutable state of the popup. + * @typedef {object} State - The mutable state of the popup. * @property {Array<() => void>} cleanup - Functions to cleanup once the view is hidden. * @property {boolean} isInfoCollapsed */ diff --git a/devtools/client/performance-new/shared/browser.js b/devtools/client/performance-new/shared/browser.js @@ -47,7 +47,7 @@ const UI_BASE_URL_PATH_DEFAULT = "/from-browser"; * profiler.firefox.com to be analyzed. This function opens up profiler.firefox.com * into a new browser tab. * - * @typedef {Object} OpenProfilerOptions + * @typedef {object} OpenProfilerOptions * @property {ProfilerViewMode | undefined} [profilerViewMode] - View mode for the Firefox Profiler * front-end timeline. While opening the url, we should append a query string * if a view other than "full" needs to be displayed. diff --git a/devtools/client/performance-new/test/browser/helpers.js b/devtools/client/performance-new/test/browser/helpers.js @@ -521,7 +521,7 @@ async function withDevToolsPanel(url, callback, aWindow = window) { * interactions, since the about:profiling page does not include buttons to control * the recording. * - * @returns {Object} + * @returns {object} */ function getActiveConfiguration() { const BackgroundJSM = ChromeUtils.importESModule( diff --git a/devtools/client/responsive/actions/devices.js b/devtools/client/responsive/actions/devices.js @@ -42,7 +42,7 @@ const DISPLAYED_DEVICES_PREF = "devtools.responsive.html.displayedDeviceList"; /** * Returns an object containing the user preference of displayed devices. * - * @return {Object} containing two Sets: + * @return {object} containing two Sets: * - added: Names of the devices that were explicitly enabled by the user * - removed: Names of the devices that were explicitly removed by the user */ @@ -71,7 +71,7 @@ function loadPreferredDevices() { /** * Update the displayed device list preference with the given device list. * - * @param {Object} containing two Sets: + * @param {object} containing two Sets: * - added: Names of the devices that were explicitly enabled by the user * - removed: Names of the devices that were explicitly removed by the user */ diff --git a/devtools/client/responsive/components/App.js b/devtools/client/responsive/components/App.js @@ -259,7 +259,7 @@ class App extends PureComponent { * Dispatches the rotateViewport action creator. This utilized by the RDM toolbar as * a prop. * - * @param {Number} id + * @param {number} id * The viewport ID. */ onRotateViewport(id) { diff --git a/devtools/client/responsive/components/DeviceForm.js b/devtools/client/responsive/components/DeviceForm.js @@ -110,9 +110,9 @@ class DeviceForm extends PureComponent { /** * Validates the name field's value. * - * @param {String} value + * @param {string} value * The input field value for the device name. - * @return {Boolean} true if device name is valid, false otherwise. + * @return {boolean} true if device name is valid, false otherwise. */ validateNameField(value) { const nameFieldValue = value.trim(); diff --git a/devtools/client/responsive/test/browser/head.js b/devtools/client/responsive/test/browser/head.js @@ -343,14 +343,14 @@ function dragElementBy(selector, x, y, ui) { * * @param {ResponsiveUI} ui * The ResponsiveUI instance. - * @param {String} selector + * @param {string} selector * The css selector of the resize handler, eg .viewport-horizontal-resize-handle. * @param {Array<number>} moveBy * Array of 2 integers representing the x,y distance of the resize action. * @param {Array<number>} moveBy * Array of 2 integers representing the actual resize performed. - * @param {Object} options - * @param {Boolean} options.hasDevice + * @param {object} options + * @param {boolean} options.hasDevice * Whether a device is currently set and will be overridden by the resize */ async function testViewportResize( @@ -951,8 +951,8 @@ async function waitForDeviceAndViewportState(ui) { * The ResponsiveUI instance. * @param {Integer} expected * The expected dpr for the content page. - * @param {Object} options - * @param {Boolean} options.waitForTargetConfiguration + * @param {object} options + * @param {boolean} options.waitForTargetConfiguration * If set to true, the function will wait for the targetConfigurationCommand configuration * to reflect the ratio that was set. This can be used to prevent pending requests * to the actor. diff --git a/devtools/client/responsive/ui.js b/devtools/client/responsive/ui.js @@ -789,7 +789,7 @@ class ResponsiveUI { /** * Restores the previous actor state. * - * @param {Boolean} isTargetSwitching + * @param {boolean} isTargetSwitching */ async restoreActorState(isTargetSwitching) { // It's possible the target will switch to a page loaded in the @@ -870,7 +870,7 @@ class ResponsiveUI { /** * Set or clear the emulated device pixel ratio. * - * @param {Number|null} dppx: The ratio to simulate. Set to null to disable the + * @param {number | null} dppx: The ratio to simulate. Set to null to disable the * simulation and roll back to the original ratio */ async updateDPPX(dppx = null) { @@ -913,9 +913,9 @@ class ResponsiveUI { /** * Set or clear the emulated user agent. * - * @param {String|null} userAgent: The user agent to set on the page. Set to null to revert + * @param {string | null} userAgent: The user agent to set on the page. Set to null to revert * the user agent to its original value - * @return {Boolean} Whether a reload is needed to apply the change. + * @return {boolean} Whether a reload is needed to apply the change. */ async updateUserAgent(userAgent) { const getConfigurationCustomUserAgent = () => @@ -950,9 +950,9 @@ class ResponsiveUI { /** * Sets the screen orientation values of the simulated device. * - * @param {String} type + * @param {string} type * The orientation type to update the current device screen to. - * @param {Number} angle + * @param {number} angle * The rotation angle to update the current device screen to. */ async updateScreenOrientation(type, angle) { @@ -965,7 +965,7 @@ class ResponsiveUI { /** * Sets whether or not maximum touch points are supported for the simulated device. * - * @param {Boolean} touchSimulationEnabled + * @param {boolean} touchSimulationEnabled * Whether or not touch is enabled for the simulated device. */ async updateMaxTouchPointsEnabled(touchSimulationEnabled) { @@ -977,7 +977,7 @@ class ResponsiveUI { /** * Sets whether or not the RDM UI should be left-aligned. * - * @param {Boolean} leftAlignmentEnabled + * @param {boolean} leftAlignmentEnabled * Whether or not the UI is left-aligned. */ updateUIAlignment(leftAlignmentEnabled) { @@ -990,9 +990,9 @@ class ResponsiveUI { /** * Sets the browser element to be the given width and height. * - * @param {Number} width + * @param {number} width * The viewport's width. - * @param {Number} height + * @param {number} height * The viewport's height. */ updateViewportSize(width, height) { diff --git a/devtools/client/responsive/utils/e10s.js b/devtools/client/responsive/utils/e10s.js @@ -15,7 +15,7 @@ const REQUEST_DONE_SUFFIX = ":Done"; * * @param {nsIMessageListenerManager} mm * The Message Manager - * @param {String} message + * @param {string} message * The message. It will be prefixed with the constant `MESSAGE_PREFIX` * @param {Function} listener * The listener function that processes the message. @@ -31,7 +31,7 @@ exports.on = on; * * @param {nsIMessageListenerManager} mm * The Message Manager - * @param {String} message + * @param {string} message * The message. It will be prefixed with the constant `MESSAGE_PREFIX` * @param {Function} listener * The listener function that processes the message. @@ -47,7 +47,7 @@ exports.off = off; * * @param {nsIMessageListenerManager} mm * The Message Manager - * @param {String} message + * @param {string} message * The message. It will be prefixed with the constant `MESSAGE_PREFIX` * @returns {Promise} * A promise that is resolved when the given message is emitted. @@ -68,9 +68,9 @@ exports.once = once; * * @param {nsIMessageListenerManager} mm * The Message Manager - * @param {String} message + * @param {string} message * The message. It will be prefixed with the constant `MESSAGE_PREFIX`. - * @param {Object} data + * @param {object} data * A JSON object containing data to be delivered to the listeners. */ function emit(mm, message, data) { @@ -84,10 +84,10 @@ exports.emit = emit; * * @param {nsIMessageListenerManager} mm * The Message Manager - * @param {String} message + * @param {string} message * The message. It will be prefixed with the constant `MESSAGE_PREFIX`, and * also suffixed with `REQUEST_DONE_SUFFIX` for the reply. - * @param {Object} data + * @param {object} data * A JSON object containing data to be delivered to the listeners. * @returns {Promise} * A promise that is resolved when the request is done. diff --git a/devtools/client/responsive/utils/key.js b/devtools/client/responsive/utils/key.js @@ -10,11 +10,11 @@ const { KeyCodes } = require("resource://devtools/client/shared/keycodes.js"); * Helper to check if the provided key matches one of the expected keys. * Keys will be prefixed with DOM_VK_ and should match a key in KeyCodes. * - * @param {String} key + * @param {string} key * the key to check (can be a keyCode). - * @param {...String} keys + * @param {...string} keys * list of possible keys allowed. - * @return {Boolean} true if the key matches one of the keys. + * @return {boolean} true if the key matches one of the keys. */ function isKeyIn(key, ...keys) { return keys.some(expectedKey => { diff --git a/devtools/client/responsive/utils/orientation.js b/devtools/client/responsive/utils/orientation.js @@ -16,17 +16,17 @@ const { * would be in relation to its current orientation. Otherwise, return the current * orientation and angle. * - * @param {Object} device + * @param {object} device * The device whose content is displayed in the viewport. Used to determine the * primary orientation. - * @param {Object} viewport + * @param {object} viewport * The viewport displaying device content. Used to determine the current * orientation type of the device while in RDM. - * @param {Number|null} angleToRotateTo + * @param {number | null} angleToRotateTo * Optional. The rotated angle specifies the degree to which the device WILL be * turned to. If undefined, then only return the current orientation and angle * of the device. - * @return {Object} the orientation of the device. + * @return {object} the orientation of the device. */ function getOrientation(device, viewport, angleToRotateTo = null) { const { width: deviceWidth, height: deviceHeight } = device; diff --git a/devtools/client/shared/WeakMapMap.js b/devtools/client/shared/WeakMapMap.js @@ -31,9 +31,9 @@ class WeakMapMap { * Returns the value associated to the key and nestedKey, or undefined if * there is none. * - * @param {Object} key + * @param {object} key * The key associated with the desired value. - * @param {String} nestedKey + * @param {string} nestedKey * The nested key associated with the desired value. */ get(key, nestedKey) { @@ -48,9 +48,9 @@ class WeakMapMap { * Returns the value associated to the key and nestedKey, or undefined if * there is none. * - * @param {Object} key + * @param {object} key * The key associated with the desired value. - * @param {String} nestedKey + * @param {string} nestedKey * The nested key associated with the desired value. */ has(key, nestedKey) { @@ -61,9 +61,9 @@ class WeakMapMap { /** * - * @param {Object} key + * @param {object} key * The key associated with the value. - * @param {String} nestedKey + * @param {string} nestedKey * The nested key associated with the value. * @param {any} value * The value to add. @@ -80,9 +80,9 @@ class WeakMapMap { /** * Removes the value associated to the key and nestedKey. * - * @param {Object} key + * @param {object} key * The key associated with the desired value. - * @param {String} nestedKey + * @param {string} nestedKey * The nested key associated with the desired value. * * @returns True if an element in the store has been removed successfully. diff --git a/devtools/client/shared/autocomplete-popup.js b/devtools/client/shared/autocomplete-popup.js @@ -29,7 +29,7 @@ class AutocompletePopup extends EventEmitter { /** * @param {Document} toolboxDoc * The toolbox document to attach the autocomplete popup panel. - * @param {Object} options + * @param {object} options * An object consiting any of the following options: * - listId {String} The id for the list <UL> element. * - position {String} The position for the tooltip ("top" or "bottom"). @@ -230,15 +230,15 @@ class AutocompletePopup extends EventEmitter { * * @param {Node} anchor * Optional node to anchor the panel to. Will default to this.input if it exists. - * @param {Number} xOffset + * @param {number} xOffset * Horizontal offset in pixels from the left of the node to the left * of the popup. - * @param {Number} yOffset + * @param {number} yOffset * Vertical offset in pixels from the top of the node to the starting * of the popup. - * @param {Number} index + * @param {number} index * The position of item to select. - * @param {Object} options: Check `selectItemAtIndex` for more information. + * @param {object} options: Check `selectItemAtIndex` for more information. */ async openPopup(anchor, xOffset = 0, yOffset = 0, index, options) { if (!anchor && this.#input) { @@ -277,9 +277,9 @@ class AutocompletePopup extends EventEmitter { /** * Select item at the provided index. * - * @param {Number} index + * @param {number} index * The position of the item to select. - * @param {Object} options: An object that can contain: + * @param {object} options: An object that can contain: * - {Boolean} preventSelectCallback: true to not call this.onSelectCallback as * during the initial autoSelect. */ @@ -380,10 +380,10 @@ class AutocompletePopup extends EventEmitter { /** * Get the autocomplete items array. * - * @param {Number} index + * @param {number} index * The index of the item what is wanted. * - * @return {Object} The autocomplete item at index index. + * @return {object} The autocomplete item at index index. */ getItemAtIndex(index) { return this.items[index]; @@ -404,9 +404,9 @@ class AutocompletePopup extends EventEmitter { * * @param {Array} items * The list of items you want displayed in the popup list. - * @param {Number} selectedIndex + * @param {number} selectedIndex * The position of the item to select. - * @param {Object} options: An object that can contain: + * @param {object} options: An object that can contain: * - {Boolean} preventSelectCallback: true to not call this.onSelectCallback as * during the initial autoSelect. */ @@ -511,7 +511,7 @@ class AutocompletePopup extends EventEmitter { /** * Setter for the selected item. * - * @param {Object} item + * @param {object} item * The object you want selected in the list. */ set selectedItem(item) { @@ -525,7 +525,7 @@ class AutocompletePopup extends EventEmitter { * Update the aria-activedescendant attribute on the current active element for * accessibility. * - * @param {String} id + * @param {string} id * The id (as in DOM id) of the currently selected autocomplete suggestion */ #setActiveDescendant(id) { @@ -612,7 +612,7 @@ class AutocompletePopup extends EventEmitter { /** * Getter for the number of items in the popup. * - * @type {Number} + * @type {number} */ get itemCount() { return this.items.length; @@ -621,7 +621,7 @@ class AutocompletePopup extends EventEmitter { /** * Getter for the height of each item in the list. * - * @type {Number} + * @type {number} */ get #itemsPerPane() { if (this.items.length) { @@ -636,7 +636,7 @@ class AutocompletePopup extends EventEmitter { /** * Select the next item in the list. * - * @return {Object} + * @return {object} * The newly selected item object. */ selectNextItem() { @@ -651,7 +651,7 @@ class AutocompletePopup extends EventEmitter { /** * Select the previous item in the list. * - * @return {Object} + * @return {object} * The newly-selected item object. */ selectPreviousItem() { @@ -668,7 +668,7 @@ class AutocompletePopup extends EventEmitter { * Select the top-most item in the next page of items or * the last item in the list. * - * @return {Object} + * @return {object} * The newly-selected item object. */ selectNextPageItem() { @@ -681,7 +681,7 @@ class AutocompletePopup extends EventEmitter { * Select the bottom-most item in the previous page of items, * or the first item in the list. * - * @return {Object} + * @return {object} * The newly-selected item object. */ selectPreviousPageItem() { @@ -694,7 +694,7 @@ class AutocompletePopup extends EventEmitter { * Determines if the specified colour object is a valid colour, and if * it is not a "special value" * - * @return {Boolean} + * @return {boolean} * If the object represents a proper colour or not. */ #isValidColor(color) { diff --git a/devtools/client/shared/components/Accordion.js b/devtools/client/shared/components/Accordion.js @@ -119,7 +119,7 @@ class Accordion extends Component { /** * @param {Event} event Click event. - * @param {Object} item The item to be collapsed/expanded. + * @param {object} item The item to be collapsed/expanded. */ onHeaderClick(event, item) { event.preventDefault(); @@ -133,7 +133,7 @@ class Accordion extends Component { /** * Expand or collapse an accordion list item. * - * @param {Object} item The item to be collapsed or expanded. + * @param {object} item The item to be collapsed or expanded. */ toggleItem(item) { const opened = !this.state.opened[item.id]; diff --git a/devtools/client/shared/components/List.js b/devtools/client/shared/components/List.js @@ -195,7 +195,7 @@ class List extends Component { /** * Sets the passed in item to be the current item. * - * @param {null|Number} index + * @param {null | number} index * The index of the item in to be set as current, or undefined to unset the * current item. */ diff --git a/devtools/client/shared/components/Tree.js b/devtools/client/shared/components/Tree.js @@ -151,8 +151,8 @@ class TreeNode extends Component { * element). * * @param {DOMNode} current currently focused element - * @param {Boolean} back direction - * @return {Boolean} true there is a newly focused element. + * @param {boolean} back direction + * @return {boolean} true there is a newly focused element. */ _wrapMoveFocus(current, back) { const elms = this.getFocusableElements(); @@ -257,7 +257,7 @@ const TreeNodeFactory = createFactory(TreeNode); * frame. * * @param {Function} fn - * @param {Object} options: object that contains the following properties: + * @param {object} options: object that contains the following properties: * - {Function} getDocument: A function that return the document * the component is rendered in. * @returns {Function} @@ -698,8 +698,8 @@ class Tree extends Component { /** * Expands current row. * - * @param {Object} item - * @param {Boolean} expandAllChildren + * @param {object} item + * @param {boolean} expandAllChildren */ _onExpand(item, expandAllChildren) { if (this.props.onExpand) { @@ -718,7 +718,7 @@ class Tree extends Component { /** * Collapses current row. * - * @param {Object} item + * @param {object} item */ _onCollapse(item) { if (this.props.onCollapse) { @@ -729,10 +729,10 @@ class Tree extends Component { /** * Sets the passed in item to be the focused item. * - * @param {Object|undefined} item + * @param {object | undefined} item * The item to be focused, or undefined to focus no item. * - * @param {Object|undefined} options + * @param {object | undefined} options * An options object which can contain: * - alignTo: "up" or "down" to indicate if we should scroll the element * to the top or the bottom of the scrollable container when @@ -761,7 +761,7 @@ class Tree extends Component { /** * Sets the passed in item to be the active item. * - * @param {Object|undefined} item + * @param {object | undefined} item * The item to be activated, or undefined to activate no item. */ _activate(item) { @@ -773,10 +773,10 @@ class Tree extends Component { /** * Sets the passed in item to be the focused item. * - * @param {Object|undefined} item + * @param {object | undefined} item * The item to be scrolled to. * - * @param {Object|undefined} options + * @param {object | undefined} options * An options object which can contain: * - alignTo: "up" or "down" to indicate if we should scroll the element * to the top or the bottom of the scrollable container when diff --git a/devtools/client/shared/components/VirtualizedTree.js b/devtools/client/shared/components/VirtualizedTree.js @@ -430,8 +430,8 @@ class Tree extends Component { /** * Expands current row. * - * @param {Object} item - * @param {Boolean} expandAllChildren + * @param {object} item + * @param {boolean} expandAllChildren */ _onExpand(item, expandAllChildren) { if (this.props.onExpand) { @@ -450,7 +450,7 @@ class Tree extends Component { /** * Collapses current row. * - * @param {Object} item + * @param {object} item */ _onCollapse(item) { if (this.props.onCollapse) { @@ -463,12 +463,12 @@ class Tree extends Component { * we might have to calculate the position of the item based on its index and * the item height. * - * @param {Object} item + * @param {object} item * The item to be scrolled into view. - * @param {Number|undefined} index + * @param {number | undefined} index * The index of the item in a full DFS traversal (ignoring collapsed * nodes) or undefined. - * @param {Object} options + * @param {object} options * Optional information regarding item's requested alignement when * scrolling. */ @@ -515,11 +515,11 @@ class Tree extends Component { /** * Sets the passed in item to be the focused item. * - * @param {Number} index + * @param {number} index * The index of the item in a full DFS traversal (ignoring collapsed * nodes). Ignored if `item` is undefined. * - * @param {Object|undefined} item + * @param {object | undefined} item * The item to be focused, or undefined to focus no item. */ _focus(index, item, options = {}) { diff --git a/devtools/client/shared/components/menu/utils.js b/devtools/client/shared/components/menu/utils.js @@ -12,12 +12,12 @@ const MenuItem = require("resource://devtools/client/framework/menu-item.js"); * * @param {Array} items * List of menu items. - * @param {Object} options: + * @param {object} options: * @property {Element} button * Button element used to open the menu. - * @property {Number} screenX + * @property {number} screenX * Screen x coordinate of the menu on the screen. - * @property {Number} screenY + * @property {number} screenY * Screen y coordinate of the menu on the screen. */ function showMenu(items, options) { diff --git a/devtools/client/shared/components/object-inspector/actions.js b/devtools/client/shared/components/object-inspector/actions.js @@ -172,7 +172,7 @@ function rootsChanged(roots, oldRoots, autoReleaseObjectActors) { /** * Release any actors we don't need anymore * - * @param {Object} client: Object with a `releaseActor` method + * @param {object} client: Object with a `releaseActor` method * @param {Array} oldRoots: The roots in which we want to cleanup now-unused actors * @param {Array} newRoots: The current roots (might have item that are also in oldRoots) */ diff --git a/devtools/client/shared/components/reps/reps/error.mjs b/devtools/client/shared/components/reps/reps/error.mjs @@ -224,7 +224,7 @@ function getCauseElement(props, preview) { * the frames. The shape of the frames are extremely important as they can then * be processed here or in the toolbox by other components. * - * @param {String} stack + * @param {string} stack * @returns {Array} Array of frames, which are object with the following shape: * - {String} filename * - {String} functionName diff --git a/devtools/client/shared/components/reps/reps/function.mjs b/devtools/client/shared/components/reps/reps/function.mjs @@ -145,8 +145,8 @@ function getFunctionTitle(grip, props) { /** * Returns a ReactElement representing the function name. * - * @param {Object} grip : Function grip - * @param {Object} props: Function rep props + * @param {object} grip : Function grip + * @param {object} props: Function rep props */ function getFunctionName(grip, props = {}) { let { functionName } = props; @@ -189,7 +189,7 @@ const annonymousProperty = /([\w\d]+)\(\^\)$/; * spider monkey implements based on "Naming Anonymous JavaScript Functions" * http://johnjbarton.github.io/nonymous/index.html * - * @param {String} name : Function name to clean up + * @param {string} name : Function name to clean up * @returns String */ function cleanFunctionName(name) { diff --git a/devtools/client/shared/components/reps/reps/grip-map.mjs b/devtools/client/shared/components/reps/reps/grip-map.mjs @@ -135,7 +135,7 @@ function entriesIterator(props, object, max) { /** * Get entries ordered by index. * - * @param {Object} props Component props. + * @param {object} props Component props. * @param {Array} entries Entries array. * @param {Array} indexes Indexes of entries. * @return {Array} Array of PropRep. @@ -170,7 +170,7 @@ function getEntries(props, entries, indexes) { * Get the indexes of entries in the map. * * @param {Array} entries Entries array. - * @param {Number} max The maximum length of indexes array. + * @param {number} max The maximum length of indexes array. * @param {Function} filter Filter the entry you want. * @return {Array} Indexes of filtered entries in the map. */ diff --git a/devtools/client/shared/components/reps/reps/grip.mjs b/devtools/client/shared/components/reps/reps/grip.mjs @@ -273,10 +273,10 @@ function propIterator(props, object, max) { /** * Get props ordered by index. * - * @param {Object} componentProps Grip Component props. - * @param {Object} properties Properties of the object the Grip describes. + * @param {object} componentProps Grip Component props. + * @param {object} properties Properties of the object the Grip describes. * @param {Array} indexes Indexes of properties. - * @param {Boolean} suppressQuotes true if we should suppress quotes + * @param {boolean} suppressQuotes true if we should suppress quotes * on property names. * @return {Array} Props. */ @@ -307,8 +307,8 @@ function getProps(componentProps, properties, indexes, suppressQuotes) { /** * Get the indexes of props in the object. * - * @param {Object} properties Props object. - * @param {Number} max The maximum length of indexes array. + * @param {object} properties Props object. + * @param {number} max The maximum length of indexes array. * @param {Function} filter Filter the props you want. * @return {Array} Indexes of interesting props in the object. */ @@ -342,8 +342,8 @@ function getPropIndexes(properties, max, filter) { /** * Get the actual value of a property. * - * @param {Object} property - * @return {Object} Value of the property. + * @param {object} property + * @return {object} Value of the property. */ function getPropValue(property) { let value = property; diff --git a/devtools/client/shared/components/reps/reps/prop-rep.mjs b/devtools/client/shared/components/reps/reps/prop-rep.mjs @@ -41,7 +41,7 @@ PropRep.propTypes = { * Function that given a name, a delimiter and an object returns an array * of React elements representing an object property (e.g. `name: value`) * - * @param {Object} props + * @param {object} props * @return {Array} Array of React elements. */ diff --git a/devtools/client/shared/components/reps/reps/rep-utils.mjs b/devtools/client/shared/components/reps/reps/rep-utils.mjs @@ -128,11 +128,11 @@ const escapeRegexpIncludingDoubleQuote = new RegExp(`[${commonEscapes}"]`, "g"); * require escaping, falling back to double quotes if that's not possible * (and then escaping them in the string). * - * @param {String} str + * @param {string} str * the input - * @param {Boolean} escapeWhitespace + * @param {boolean} escapeWhitespace * if true, TAB, CR, and NL characters will be escaped - * @return {String} the escaped string + * @return {string} the escaped string */ function escapeString(str, escapeWhitespace) { let quote = '"'; @@ -185,9 +185,9 @@ function escapeString(str, escapeWhitespace) { * Escape a property name, if needed. "Escaping" in this context * means surrounding the property name with quotes. * - * @param {String} + * @param {string} * name the property name - * @return {String} either the input, or the input surrounded by + * @return {string} either the input, or the input surrounded by * quotes, properly quoted in JS syntax. */ function maybeEscapePropertyName(name) { @@ -344,7 +344,7 @@ function wrapRender(renderMethod) { /** * Get preview items from a Grip. * - * @param {Object} Grip from which we want the preview items + * @param {object} Grip from which we want the preview items * @return {Array} Array of the preview items of the grip, or an empty array * if the grip does not have preview items */ @@ -407,7 +407,7 @@ function getGripPreviewItems(grip) { /** * Get the type of an object. * - * @param {Object} Grip from which we want the type. + * @param {object} Grip from which we want the type. * @param {boolean} noGrip true if the object is not a grip. * @return {boolean} */ @@ -457,7 +457,7 @@ function isURL(token) { * Returns new array in which `char` are interleaved between the original items. * * @param {Array} items - * @param {String} char + * @param {string} char * @returns Array */ function interleave(items, char) { @@ -481,9 +481,9 @@ const ellipsisElement = span( /** * Removes any unallowed CSS properties from a string of CSS declarations * - * @param {String} userProvidedStyle CSS declarations + * @param {string} userProvidedStyle CSS declarations * @param {Function} createElement Method to create a dummy element the styles get applied to - * @returns {Object} Filtered CSS properties as JavaScript object in camelCase notation + * @returns {object} Filtered CSS properties as JavaScript object in camelCase notation */ function cleanupStyle(userProvidedStyle, createElement) { // Regular expression that matches the allowed CSS property names. @@ -546,9 +546,9 @@ function cleanupStyle(userProvidedStyle, createElement) { * It's important to only apply it when needed as this CSS property can have an * important impact on performance (See Bug 1879806) * - * @param {String} className: The className want to set on an element - * @param {String} strToCheck: The string for which we want to check if it has RTL chars - * @returns {String} + * @param {string} className: The className want to set on an element + * @param {string} strToCheck: The string for which we want to check if it has RTL chars + * @returns {string} */ function appendRTLClassNameIfNeeded(className = "", strToCheck) { if ( @@ -568,7 +568,7 @@ function appendRTLClassNameIfNeeded(className = "", strToCheck) { * - source: The original number in the JSON string (e.g. `1e2`) * - parsedValue: The parsed number (e.g. for `1e2` it will be `100`) * - * @param {String} str: The JSON string + * @param {string} str: The JSON string * @returns {*} The parsed JSON */ function parseJsonLossless(str) { diff --git a/devtools/client/shared/components/reps/reps/string.mjs b/devtools/client/shared/components/reps/reps/string.mjs @@ -198,7 +198,7 @@ function maybeCropString(opts, text) { * Get an array of the elements representing the string, cropped if needed, * with actual links. * - * @param {Object} An options object of the following shape: + * @param {object} An options object of the following shape: * - text {String}: The actual string to linkify. * - cropLimit {Integer}: The limit to apply on the whole text. * - urlCropLimit {Integer}: The limit to apply on each URL. @@ -207,7 +207,7 @@ function maybeCropString(opts, text) { * - isInContentPage {Boolean}: pass true if the reps is * rendered in the content page * (e.g. in JSONViewer). - * @returns {Array<String|ReactElement>} + * @returns {Array<string | ReactElement>} */ function getLinkifiedElements({ text, @@ -325,14 +325,14 @@ function getLinkifiedElements({ * Returns a cropped substring given an offset, start and end crop indices in a * parent string. * - * @param {String} text: The substring to crop. + * @param {string} text: The substring to crop. * @param {Integer} offset: The offset corresponding to the index at which * the substring is in the parent string. * @param {Integer|null} startCropIndex: the index where the start of the crop * should happen in the parent string. * @param {Integer|null} endCropIndex: the index where the end of the crop * should happen in the parent string - * @returns {String|null} The cropped substring, or null if the text is + * @returns {string | null} The cropped substring, or null if the text is * completly cropped. */ function getCroppedString(text, offset = 0, startCropIndex, endCropIndex) { diff --git a/devtools/client/shared/components/splitter/SplitBox.js b/devtools/client/shared/components/splitter/SplitBox.js @@ -228,12 +228,12 @@ class SplitBox extends Component { * Calculates the constrained size taking into account the minimum width or * height passed via this.props.minSize. * - * @param {Number} requestedSize + * @param {number} requestedSize * The requested size - * @param {Number} splitBoxWidthOrHeight + * @param {number} splitBoxWidthOrHeight * The width or height of the splitBox * - * @return {Number} + * @return {number} * The constrained size */ getConstrainedSizeInPx(requestedSize, splitBoxWidthOrHeight) { diff --git a/devtools/client/shared/components/tabs/Tabs.mjs b/devtools/client/shared/components/tabs/Tabs.mjs @@ -248,8 +248,8 @@ class Tabs extends Component { * * @param {Integer} index * Index of the tab that we want to set as the active one - * @param {Object} options - * @param {Boolean} options.fromMouseEvent + * @param {object} options + * @param {boolean} options.fromMouseEvent * Set to true if this is called from a click on the tab */ setActive(index, options = {}) { diff --git a/devtools/client/shared/components/test/chrome/head.js b/devtools/client/shared/components/test/chrome/head.js @@ -343,9 +343,9 @@ async function waitFor(condition = () => true, delay = 50) { * Matches a component tree rendererd using TestRenderer to a given expected JSON * snapshot. * - * @param {String} name + * @param {string} name * Name of the function derived from a test [step] name. - * @param {Object} el + * @param {object} el * React element to be rendered using TestRenderer. */ function matchSnapshot(name, el) { diff --git a/devtools/client/shared/components/test/chrome/test_searchbox-with-autocomplete.html b/devtools/client/shared/components/test/chrome/test_searchbox-with-autocomplete.html @@ -24,7 +24,7 @@ window.onload = async function () { * compared with the reference item's value as a test * * @params {Node} - Node to be compared - * @reference {array} - Reference array for comparison. The selected index is + * @reference {Array} - Reference array for comparison. The selected index is * highlighted as a single element array ie. ["[abc]", "ab", "abcPQR"], * Here the element "abc" is highlighted */ diff --git a/devtools/client/shared/components/tree/TreeView.mjs b/devtools/client/shared/components/tree/TreeView.mjs @@ -171,8 +171,8 @@ class TreeView extends Component { * Creates a set with the paths of the nodes that should be expanded by default * according to the passed options. * - * @param {Object} The root node of the tree. - * @param {Object} [optional] An object with the following optional parameters: + * @param {object} The root node of the tree. + * @param {object} [optional] An object with the following optional parameters: * - maxLevel: nodes nested deeper than this level won't be expanded. * - maxNodes: maximum number of nodes that can be expanded. The traversal is breadth-first, so expanding nodes nearer to the root will be preferred. @@ -571,7 +571,7 @@ class TreeView extends Component { /** * Filter out nodes that don't correspond to the current filter. * - * @return {Boolean} true if the node should be visible otherwise false. + * @return {boolean} true if the node should be visible otherwise false. */ onFilter(object) { const onFilter = this.props.onFilter; diff --git a/devtools/client/shared/css-angle.js b/devtools/client/shared/css-angle.js @@ -229,7 +229,7 @@ CssAngle.prototype = { * Check whether the angle value is in the special list e.g. * inherit or invalid. * - * @return {String|Boolean} + * @return {string | boolean} * - If the current angle is a special value e.g. "inherit" then * return the angle. * - If the angle is invalid return an empty string. @@ -249,7 +249,7 @@ CssAngle.prototype = { /** * Change angle * - * @param {String} angle + * @param {string} angle * Any valid angle value + unit string */ newAngle(angle) { @@ -326,9 +326,9 @@ CssAngle.prototype = { * Given a color, classify its type as one of the possible angle * units, as known by |CssAngle.angleUnit|. * - * @param {String} value + * @param {string} value * The angle, in any form accepted by CSS. - * @return {String} + * @return {string} * The angle classification, one of "deg", "rad", "grad", or "turn". */ function classifyAngle(value) { diff --git a/devtools/client/shared/events.js b/devtools/client/shared/events.js @@ -6,7 +6,7 @@ /** * Prevent event default behaviour and stop its propagation. * - * @param {Object} event + * @param {object} event * Event or react synthetic event. */ exports.preventDefaultAndStopPropagation = function (event) { diff --git a/devtools/client/shared/fluent-l10n/fluent-l10n.js b/devtools/client/shared/fluent-l10n/fluent-l10n.js @@ -16,7 +16,7 @@ class FluentL10n { * It can optionally add the right attributes to the document element. * * @param {Array} resourceIds - * @param {Object} [options] + * @param {object} [options] * @param {boolean} [options.setAttributesOnDocument] */ async init(resourceIds, { setAttributesOnDocument } = {}) { diff --git a/devtools/client/shared/focus.mjs b/devtools/client/shared/focus.mjs @@ -24,7 +24,7 @@ const focusableSelector = [ * focusable elements inside a container * @param {DOMNode} current * currently focused element inside containter - * @param {Boolean} back + * @param {boolean} back * direction * @return {DOMNode} * newly focused element diff --git a/devtools/client/shared/inplace-editor.js b/devtools/client/shared/inplace-editor.js @@ -82,11 +82,11 @@ const GRID_COL_PROPERTY_NAMES = [ * Helper to check if the provided key matches one of the expected keys. * Keys will be prefixed with DOM_VK_ and should match a key in KeyCodes. * - * @param {String} key + * @param {string} key * the key to check (can be a keyCode). - * @param {...String} keys + * @param {...string} keys * list of possible keys allowed. - * @return {Boolean} true if the key matches one of the keys. + * @return {boolean} true if the key matches one of the keys. */ function isKeyIn(key, ...keys) { return keys.some(expectedKey => { @@ -100,10 +100,10 @@ function isKeyIn(key, ...keys) { * Changes will be committed when the InlineEditor's input is blurred * or dropped when the user presses escape. * - * @param {Object} options: Options for the editable field + * @param {object} options: Options for the editable field * @param {Element} options.element: * (required) The span to be edited on focus. - * @param {String} options.inputClass: + * @param {string} options.inputClass: * An optional class to be added to the input. * @param {Function} options.canEdit: * Will be called before creating the inplace editor. Editor @@ -125,7 +125,7 @@ function isKeyIn(key, ...keys) { * This may be called with the return value of the options.done callback (if it is passed). * @param {Function} options.contextMenu: * Called when the user triggers a contextmenu event on the input. - * @param {Object} options.advanceChars: + * @param {object} options.advanceChars: * This can be either a string or a function. * If it is a string, then if any characters in it are typed, * focus will advance to the next element. @@ -134,53 +134,53 @@ function isKeyIn(key, ...keys) { * and the insertion point. If the function returns true, * then the focus advance takes place. If it returns false, * then the character is inserted instead. - * @param {Boolean} options.stopOnReturn: + * @param {boolean} options.stopOnReturn: * If true, the return key will not advance the editor to the next * focusable element. Note that Ctrl/Cmd+Enter will still advance the editor - * @param {Boolean} options.stopOnTab: + * @param {boolean} options.stopOnTab: * If true, the tab key will not advance the editor to the next * focusable element. - * @param {Boolean} options.stopOnShiftTab: + * @param {boolean} options.stopOnShiftTab: * If true, shift tab will not advance the editor to the previous * focusable element. - * @param {String} options.trigger: The DOM event that should trigger editing, + * @param {string} options.trigger: The DOM event that should trigger editing, * defaults to "click" - * @param {Boolean} options.multiline: Should the editor be a multiline textarea? + * @param {boolean} options.multiline: Should the editor be a multiline textarea? * defaults to false * @param {Function or options.Number} maxWidth: * Should the editor wrap to remain below the provided max width. Only * available if multiline is true. If a function is provided, it will be * called when replacing the element by the inplace input. - * @param {Boolean} options.trimOutput: Should the returned string be trimmed? + * @param {boolean} options.trimOutput: Should the returned string be trimmed? * defaults to true - * @param {Boolean} options.preserveTextStyles: If true, do not copy text-related styles + * @param {boolean} options.preserveTextStyles: If true, do not copy text-related styles * from `element` to the new input. * defaults to false - * @param {Object} options.cssProperties: An instance of CSSProperties. - * @param {Object} options.getCssVariables: A function that returns a Map containing + * @param {object} options.cssProperties: An instance of CSSProperties. + * @param {object} options.getCssVariables: A function that returns a Map containing * all CSS variables. The Map key is the variable name, the value is the variable value - * @param {Number} options.defaultIncrement: The value by which the input is incremented + * @param {number} options.defaultIncrement: The value by which the input is incremented * or decremented by default (0.1 for properties like opacity and 1 by default) * @param {Function} options.getGridLineNames: * Will be called before offering autocomplete sugestions, if the property is * a member of GRID_PROPERTY_NAMES. - * @param {Boolean} options.showSuggestCompletionOnEmpty: + * @param {boolean} options.showSuggestCompletionOnEmpty: * If true, show the suggestions in case that the current text becomes empty. * Defaults to false. - * @param {Boolean} options.focusEditableFieldAfterApply + * @param {boolean} options.focusEditableFieldAfterApply * If true, try to focus the next editable field after the input value is commited. * When set to true, focusEditableFieldContainerSelector is mandatory. * If no editable field can be found within the element retrieved with * focusEditableFieldContainerSelector, the focus will be moved to the next focusable * element (which won't be an editable field) - * @param {String} options.focusEditableFieldContainerSelector + * @param {string} options.focusEditableFieldContainerSelector * A CSS selector that will be used to retrieve the container element into which * the next focused element should be in, when focusEditableFieldAfterApply * is set to true. This allows to bail out if we can't find a suitable * focusable field. - * @param {String} options.inputAriaLabel + * @param {string} options.inputAriaLabel * Optional aria-label attribute value that will be added to the input. - * @param {String} options.inputAriaLabelledBy + * @param {string} options.inputAriaLabelledBy * Optional aria-labelled-by attribute value that will be added to the input. */ function editableField(options) { @@ -198,7 +198,7 @@ exports.editableField = editableField; * clicks and sit in the editing tab order, and call * a callback when it is activated. * - * @param {Object} options + * @param {object} options * The options for this editor, including: * {Element} element: The DOM element. * {String} trigger: The DOM event that should trigger editing, @@ -263,7 +263,7 @@ exports.editableItem = editableItem; * to the editable item. * * @param {Element} eventTarget - * @returns {Boolean} + * @returns {boolean} */ function isValidTargetForEditableItemCallback(eventTarget) { const { nodeName } = eventTarget; @@ -434,12 +434,12 @@ class InplaceEditor extends EventEmitter { /** * Create the input element. * - * @param {Object} options - * @param {String} options.inputAriaLabel + * @param {object} options + * @param {string} options.inputAriaLabel * Optional aria-label attribute value that will be added to the input. - * @param {String} options.inputAriaLabelledBy + * @param {string} options.inputAriaLabelledBy * Optional aria-labelledby attribute value that will be added to the input. - * @param {String} options.inputClass: + * @param {string} options.inputClass: * Optional class to be added to the input. */ #createInput(options = {}) { @@ -611,9 +611,9 @@ class InplaceEditor extends EventEmitter { /** * Increment property values in rule view. * - * @param {Number} increment + * @param {number} increment * The amount to increase/decrease the property value. - * @return {Boolean} true if value has been incremented. + * @return {boolean} true if value has been incremented. */ #incrementValue(increment) { const value = this.input.value; @@ -646,15 +646,15 @@ class InplaceEditor extends EventEmitter { /** * Increment the property value based on the property type. * - * @param {String} value + * @param {string} value * Property value. - * @param {Number} increment + * @param {number} increment * Amount to increase/decrease the property value. - * @param {Number} selStart + * @param {number} selStart * Starting index of the value. - * @param {Number} selEnd + * @param {number} selEnd * Ending index of the value. - * @return {Object} object with properties 'value', 'start', and 'end'. + * @return {object} object with properties 'value', 'start', and 'end'. */ #incrementCSSValue(value, increment, selStart, selEnd) { const range = this.#parseCSSValue(value, selStart); @@ -750,12 +750,12 @@ class InplaceEditor extends EventEmitter { * from a selection of default units corresponding to supported CSS value * dimensions (distance, angle, duration). * - * @param {String} beforeValue + * @param {string} beforeValue * The string preceeding the number value in the current property * value. - * @param {String} afterValue + * @param {string} afterValue * The string following the number value in the current property value. - * @return {String} a valid unit that can be used for this number value or + * @return {string} a valid unit that can be used for this number value or * empty string if no match could be found. */ #findCompatibleUnit(beforeValue, afterValue) { @@ -786,11 +786,11 @@ class InplaceEditor extends EventEmitter { /** * Parses the property value and type. * - * @param {String} value + * @param {string} value * Property value. - * @param {Number} offset + * @param {number} offset * Starting index of value. - * @return {Object} object with properties 'value', 'start', 'end', and + * @return {object} object with properties 'value', 'start', 'end', and * 'type'. */ #parseCSSValue(value, offset) { @@ -839,17 +839,17 @@ class InplaceEditor extends EventEmitter { * Increment the property value for types other than * number or hex, such as rgb, hsl, hwb, and file names. * - * @param {String} value + * @param {string} value * Property value. - * @param {Number} increment + * @param {number} increment * Amount to increment/decrement. - * @param {Number} offset + * @param {number} offset * Starting index of the property value. - * @param {Number} offsetEnd + * @param {number} offsetEnd * Ending index of the property value. - * @param {Object} info + * @param {object} info * Object with details about the property value. - * @return {Object} object with properties 'value', 'start', and 'end'. + * @return {object} object with properties 'value', 'start', and 'end'. */ #incrementGenericValue(value, increment, offset, offsetEnd, info) { // Try to find a number around the cursor to increment. @@ -914,13 +914,13 @@ class InplaceEditor extends EventEmitter { /** * Increment the property value for numbers. * - * @param {String} rawValue + * @param {string} rawValue * Raw value to increment. - * @param {Number} increment + * @param {number} increment * Amount to increase/decrease the raw value. - * @param {Object} info + * @param {object} info * Object with info about the property value. - * @return {String} the incremented value. + * @return {string} the incremented value. */ #incrementRawValue(rawValue, increment, info) { const num = parseFloat(rawValue); @@ -954,15 +954,15 @@ class InplaceEditor extends EventEmitter { /** * Increment the property value for hex. * - * @param {String} value + * @param {string} value * Property value. - * @param {Number} increment + * @param {number} increment * Amount to increase/decrease the property value. - * @param {Number} offset + * @param {number} offset * Starting index of the property value. - * @param {Number} offsetEnd + * @param {number} offsetEnd * Ending index of the property value. - * @return {Object} object with properties 'value' and 'selection'. + * @return {object} object with properties 'value' and 'selection'. */ #incHexColor(rawValue, increment, offset, offsetEnd) { // Return early if no part of the rawValue is selected. @@ -1067,9 +1067,9 @@ class InplaceEditor extends EventEmitter { /** * Cycle through the autocompletion suggestions in the popup. * - * @param {Boolean} reverse + * @param {boolean} reverse * true to select previous item from the popup. - * @param {Boolean} noSelect + * @param {boolean} noSelect * true to not select the text after selecting the newly selectedItem * from the popup. */ @@ -1432,9 +1432,9 @@ class InplaceEditor extends EventEmitter { /** * Open the autocomplete popup, adding a custom click handler and classname. * - * @param {Number} offset + * @param {number} offset * X-offset relative to the input starting edge. - * @param {Number} selectedIndex + * @param {number} selectedIndex * The index of the item that should be selected. Use -1 to have no * item selected. */ @@ -1574,7 +1574,7 @@ class InplaceEditor extends EventEmitter { /** * Handles displaying suggestions based on the current input. * - * @param {Boolean} autoInsert + * @param {boolean} autoInsert * Pass true to automatically insert the most relevant suggestion. */ #maybeSuggestCompletion(autoInsert) { @@ -1870,10 +1870,10 @@ class InplaceEditor extends EventEmitter { /** * Returns the autocomplete data for the passed function. * - * @param {Object} functionStackEntry + * @param {object} functionStackEntry * @param {InspectorCSSToken} functionStackEntry.fnToken: The token for the * function call - * @returns {Object|null} Return null if there's nothing specific to display for the function. + * @returns {object | null} Return null if there's nothing specific to display for the function. * Otherwise, return an object of the following shape: * - {Array<String>} list: The list of autocomplete items * - {Array<String>} postLabelValue: The list of autocomplete items @@ -1967,7 +1967,7 @@ class InplaceEditor extends EventEmitter { /** * Check if the current input is displaying more than one line of text. * - * @return {Boolean} true if the input has a single line of text + * @return {boolean} true if the input has a single line of text */ #isSingleLine() { if (!this.multiline) { @@ -1996,7 +1996,7 @@ class InplaceEditor extends EventEmitter { * the autocompletion. This method is overridden by tests in order to use * mocked suggestion lists. * - * @param {String} propertyName + * @param {string} propertyName * @return {Array} array of CSS property values (Strings) */ #getCSSValuesForPropertyName(propertyName) { @@ -2046,9 +2046,9 @@ class InplaceEditor extends EventEmitter { /** * Returns the variable's value for the given CSS variable name. * - * @param {String} varName + * @param {string} varName * The variable name to retrieve the value of - * @return {String} the variable value to the given CSS variable name + * @return {string} the variable value to the given CSS variable name */ #getCSSVariableValue(varName) { return this.#getCSSVariablesMap()?.get(varName); @@ -2128,12 +2128,12 @@ function copyBoxModelStyles(from, to) { * Trigger a focus change similar to pressing tab/shift-tab. * * @param {Window} win: The window into which the focus should be moved - * @param {Number} direction: See Services.focus.MOVEFOCUS_* - * @param {Boolean} focusEditableField: Set to true to move the focus to the previous/next + * @param {number} direction: See Services.focus.MOVEFOCUS_* + * @param {boolean} focusEditableField: Set to true to move the focus to the previous/next * editable field. If not set, the focus will be set on the next focusable element. * The function might still put the focus on a non-editable field, if none is found * within the element matching focusEditableFieldContainerSelector - * @param {String} focusEditableFieldContainerSelector: A CSS selector the editabled element + * @param {string} focusEditableFieldContainerSelector: A CSS selector the editabled element * we want to focus should be in. This is only used when focusEditableField is set * to true. * It's important to pass a boundary otherwise we might hit an infinite loop diff --git a/devtools/client/shared/link.js b/devtools/client/shared/link.js @@ -29,9 +29,9 @@ function _getTopWindow() { * Opens a |url| that does not require trusted access, such as a documentation page, in a * new tab. * - * @param {String} url + * @param {string} url * The url to open. - * @param {Object} options + * @param {object} options * Optional parameters, see documentation for openUILinkIn in utilityOverlay.js */ exports.openDocLink = async function (url, options) { @@ -49,9 +49,9 @@ exports.openDocLink = async function (url, options) { * `triggeringPrincipal` of the link using the tab's `contentPrincipal`. This is only an * approximation, so bug 1467945 hopes to improve this. * - * @param {String} url + * @param {string} url * The url to open. - * @param {Object} options + * @param {object} options * Optional parameters, see documentation for openUILinkIn in utilityOverlay.js */ exports.openContentLink = async function (url, options = {}) { @@ -72,9 +72,9 @@ exports.openContentLink = async function (url, options = {}) { /** * Open a trusted |url| in a new tab using the SystemPrincipal. * - * @param {String} url + * @param {string} url * The url to open. - * @param {Object} options + * @param {object} options * Optional parameters, see documentation for openUILinkIn in utilityOverlay.js */ exports.openTrustedLink = async function (url, options) { diff --git a/devtools/client/shared/node-attribute-parser.js b/devtools/client/shared/node-attribute-parser.js @@ -300,13 +300,13 @@ var parsers = { /** * Parse an attribute value. * - * @param {String} namespaceURI The namespaceURI of the node that has the + * @param {string} namespaceURI The namespaceURI of the node that has the * attribute. - * @param {String} tagName The tagName of the node that has the attribute. + * @param {string} tagName The tagName of the node that has the attribute. * @param {Array} attributes The list of all attributes of the node. This should * be an array of {name, value} objects. - * @param {String} attributeName The name of the attribute to parse. - * @param {String} attributeValue The value of the attribute to parse. + * @param {string} attributeName The name of the attribute to parse. + * @param {string} attributeValue The value of the attribute to parse. * @return {Array} An array of tokens that represents the value. Each token is * an object {type: [string|uri|jsresource|cssresource|idref], value}. * For instance parsing the ping attribute in <a ping="uri1 uri2"> returns: @@ -339,12 +339,12 @@ function parseAttribute( /** * Get the type for links in this attribute if any. * - * @param {String} namespaceURI The node's namespaceURI. - * @param {String} tagName The node's tagName. + * @param {string} namespaceURI The node's namespaceURI. + * @param {string} tagName The node's tagName. * @param {Array} attributes The node's attributes, as a list of {name, value} * objects. - * @param {String} attributeName The name of the attribute to get the type for. - * @return {Object} null if no type exist for this attribute on this node, the + * @param {string} attributeName The name of the attribute to get the type for. + * @return {object} null if no type exist for this attribute on this node, the * type object otherwise. */ function getType(namespaceURI, tagName, attributes, attributeName) { @@ -392,8 +392,8 @@ function getAttribute(attributes, attributeName) { * The array will contain objects for the split character too, marked with * TYPE_STRING type. * - * @param {String} value The string to parse. - * @param {String} splitChar A 1 length split character. + * @param {string} value The string to parse. + * @param {string} splitChar A 1 length split character. * @return {Array} */ function splitBy(value, splitChar) { diff --git a/devtools/client/shared/output-parser.js b/devtools/client/shared/output-parser.js @@ -137,11 +137,11 @@ class OutputParser { /** * Parse a CSS property value given a property name. * - * @param {String} name + * @param {string} name * CSS Property Name - * @param {String} value + * @param {string} value * CSS Property value - * @param {Object} [options] + * @param {object} [options] * Options object. For valid options and default values see * #mergeOptions(). * @return {DocumentFragment} @@ -194,15 +194,15 @@ class OutputParser { * If |stopAtComma| is true, then also stop when a top-level * (unparenthesized) comma is seen. * - * @param {String} text + * @param {string} text * The original source text. * @param {CSSLexer} tokenStream * The token stream from which to read. - * @param {Object} options + * @param {object} options * The options object in use; @see #mergeOptions. - * @param {Boolean} stopAtComma + * @param {boolean} stopAtComma * If true, stop at a comma. - * @return {Object} + * @return {object} * An object of the form {tokens, functionData, sawComma, sawVariable, depth}. * |tokens| is a list of the non-comment, non-whitespace tokens * that were seen. The stopping token (paren or comma) will not @@ -275,13 +275,13 @@ class OutputParser { * * @param {CSSToken} initialToken * The "var(" token that was already seen. - * @param {String} text + * @param {string} text * The original input text. * @param {CSSLexer} tokenStream * The token stream from which to read. - * @param {Object} options + * @param {object} options * The options object in use; @see #mergeOptions. - * @return {Object} + * @return {object} * - node: A node for the variable, with the appropriate text and * title. Eg. a span with "var(--var1)" as the textContent * and a title for --var1 like "--var1 = 10" or @@ -429,13 +429,13 @@ class OutputParser { * stopping at EOF; or optionally when an umatched close paren is * seen. * - * @param {String} text + * @param {string} text * The original input text. - * @param {Object} options + * @param {object} options * The options object in use; @see #mergeOptions. * @param {CSSLexer} tokenStream * The token stream from which to read - * @param {Boolean} stopAtCloseParen + * @param {boolean} stopAtCloseParen * If true, stop at an umatched close paren. * @return {DocumentFragment} * A document fragment. @@ -957,9 +957,9 @@ class OutputParser { /** * Parse a string. * - * @param {String} text + * @param {string} text * Text to parse. - * @param {Object} [options] + * @param {object} [options] * Options object. For valid options and default values see * #mergeOptions(). * @return {DocumentFragment} @@ -977,11 +977,11 @@ class OutputParser { /** * Returns true if it's a "display: [inline-]flex" token. * - * @param {String} text + * @param {string} text * The parsed text. - * @param {Object} token + * @param {object} token * The parsed token. - * @param {Object} options + * @param {object} options * The options given to #parse. */ #isDisplayFlex(text, token, options) { @@ -994,11 +994,11 @@ class OutputParser { /** * Returns true if it's a "display: [inline-]grid" token. * - * @param {String} text + * @param {string} text * The parsed text. - * @param {Object} token + * @param {object} token * The parsed token. - * @param {Object} options + * @param {object} options * The options given to #parse. */ #isDisplayGrid(text, token, options) { @@ -1011,9 +1011,9 @@ class OutputParser { /** * Append a cubic-bezier timing function value to the output * - * @param {String} bezier + * @param {string} bezier * The cubic-bezier timing function - * @param {Object} options + * @param {object} options * Options object. For valid options and default values see * #mergeOptions() */ @@ -1074,9 +1074,9 @@ class OutputParser { * Append a Flexbox|Grid highlighter toggle icon next to the value in a * "display: [inline-]flex" or "display: [inline-]grid" declaration. * - * @param {String} text + * @param {string} text * The text value to append - * @param {String} toggleButtonClassName + * @param {string} toggleButtonClassName * The class name for the toggle button. * If not passed/empty, the toggle button won't be created. */ @@ -1099,9 +1099,9 @@ class OutputParser { * Append a CSS shapes highlighter toggle next to the value, and parse the value * into spans, each containing a point that can be hovered over. * - * @param {String} shape + * @param {string} shape * The shape text value to append - * @param {Object} options + * @param {object} options * Options object. For valid options and default values see * #mergeOptions() */ @@ -1159,7 +1159,7 @@ class OutputParser { * Parse the given polygon coordinates and create a span for each coordinate pair, * adding it to the given container node. * - * @param {String} coords + * @param {string} coords * The string of coordinate pairs. * @param {Node} container * The node to which spans containing points are added. @@ -1309,7 +1309,7 @@ class OutputParser { * Parse the given circle coordinates and populate the given container appropriately * with a separate span for the center point. * - * @param {String} coords + * @param {string} coords * The circle definition. * @param {Node} container * The node to which the definition is added. @@ -1470,7 +1470,7 @@ class OutputParser { * Parse the given ellipse coordinates and populate the given container appropriately * with a separate span for each point * - * @param {String} coords + * @param {string} coords * The ellipse definition. * @param {Node} container * The node to which the definition is added. @@ -1640,7 +1640,7 @@ class OutputParser { /** * Parse the given inset coordinates and populate the given container appropriately. * - * @param {String} coords + * @param {string} coords * The inset definition. * @param {Node} container * The node to which the definition is added. @@ -1785,9 +1785,9 @@ class OutputParser { /** * Append a angle value to the output * - * @param {String} angle + * @param {string} angle * angle to append - * @param {Object} options + * @param {object} options * Options object. For valid options and default values see * #mergeOptions() */ @@ -1833,11 +1833,11 @@ class OutputParser { /** * Check if a CSS property supports a specific value. * - * @param {String} name + * @param {string} name * CSS Property name to check - * @param {String} value + * @param {string} value * CSS Property value to check - * @param {Object} options + * @param {object} options * Options object. For valid options and default values see #mergeOptions(). */ #cssPropertySupportsValue(name, value, options) { @@ -1870,14 +1870,14 @@ class OutputParser { /** * Append a color to the output. * - * @param {String} color + * @param {string} color * Color to append - * @param {Object} [options] + * @param {object} [options] * @param {CSSColor} options.colorObj: A css color for the passed color. Will be computed * if not passed. * @param {DOMNode} options.variableContainer: A DOM Node that is the result of parsing * a CSS variable - * @param {String} options.colorFunction: The color function that is used to produce this color + * @param {string} options.colorFunction: The color function that is used to produce this color * @param {*} For all the other valid options and default values see #mergeOptions(). */ #appendColor(color, options = {}) { @@ -1955,7 +1955,7 @@ class OutputParser { /** * Wrap some existing nodes in a filter editor. * - * @param {String} filters + * @param {string} filters * The full text of the "filter" property. * @param {object} options * The options object passed to parseCssProperty(). @@ -2046,11 +2046,11 @@ class OutputParser { /** * Append a URL to the output. * - * @param {String} match + * @param {string} match * Complete match that may include "url(xxx)" - * @param {String} url + * @param {string} url * Actual URL - * @param {Object} [options] + * @param {object} [options] * Options object. For valid options and default values see * #mergeOptions(). */ @@ -2093,9 +2093,9 @@ class OutputParser { /** * Append a font family to the output. * - * @param {String} fontFamily + * @param {string} fontFamily * Font family to append - * @param {Object} options + * @param {object} options * Options object. For valid options and default values see * #mergeOptions(). */ @@ -2149,11 +2149,11 @@ class OutputParser { /** * Create a node. * - * @param {String} tagName + * @param {string} tagName * Tag type e.g. "div" - * @param {Object} attributes + * @param {object} attributes * e.g. {class: "someClass", style: "cursor:pointer"}; - * @param {String} [value] + * @param {string} [value] * If a value is included it will be appended as a text node inside * the tag. This is useful e.g. for span tags. * @return {Node} Newly created Node. @@ -2180,11 +2180,11 @@ class OutputParser { /** * Create and append a node to the output. * - * @param {String} tagName + * @param {string} tagName * Tag type e.g. "div" - * @param {Object} attributes + * @param {object} attributes * e.g. {class: "someClass", style: "cursor:pointer"}; - * @param {String} [value] + * @param {string} [value] * If a value is included it will be appended as a text node inside * the tag. This is useful e.g. for span tags. */ @@ -2200,7 +2200,7 @@ class OutputParser { /** * Append an element or a text node to the output. * - * @param {DOMNode|String} item + * @param {DOMNode | string} item */ #append(item) { this.#getCurrentStackParts().push(item); @@ -2210,7 +2210,7 @@ class OutputParser { * Append a text node to the output. If the previously output item was a text * node then we append the text to that node. * - * @param {String} text + * @param {string} text * Text to append */ #appendTextNode(text) { @@ -2252,35 +2252,35 @@ class OutputParser { /** * Merges options objects. Default values are set here. * - * @param {Object} overrides + * @param {object} overrides * The option values to override e.g. #mergeOptions({colors: false}) - * @param {Boolean} overrides.useDefaultColorUnit: Convert colors to the default type + * @param {boolean} overrides.useDefaultColorUnit: Convert colors to the default type * selected in the options panel. - * @param {String} overrides.angleClass: The class to use for the angle value that follows + * @param {string} overrides.angleClass: The class to use for the angle value that follows * the swatch. - * @param {String} overrides.angleSwatchClass: The class to use for angle swatches. - * @param {String} overrides.bezierClass: The class to use for the bezier value that + * @param {string} overrides.angleSwatchClass: The class to use for angle swatches. + * @param {string} overrides.bezierClass: The class to use for the bezier value that * follows the swatch. - * @param {String} overrides.bezierSwatchClass: The class to use for bezier swatches. - * @param {String} overrides.colorClass: The class to use for the color value that + * @param {string} overrides.bezierSwatchClass: The class to use for bezier swatches. + * @param {string} overrides.colorClass: The class to use for the color value that * follows the swatch. - * @param {String} overrides.colorSwatchClass: The class to use for color swatches. - * @param {Boolean} overrides.colorSwatchReadOnly: Whether the resulting color swatch + * @param {string} overrides.colorSwatchClass: The class to use for color swatches. + * @param {boolean} overrides.colorSwatchReadOnly: Whether the resulting color swatch * should be read-only or not. Defaults to false. - * @param {Boolean} overrides.filterSwatch: A special case for parsing a "filter" property, + * @param {boolean} overrides.filterSwatch: A special case for parsing a "filter" property, * causing the parser to skip the call to #wrapFilter. Used only for previewing * with the filter swatch. - * @param {String} overrides.flexClass: The class to use for the flex icon. - * @param {String} overrides.gridClass: The class to use for the grid icon. - * @param {String} overrides.shapeClass: The class to use for the shape value that + * @param {string} overrides.flexClass: The class to use for the flex icon. + * @param {string} overrides.gridClass: The class to use for the grid icon. + * @param {string} overrides.shapeClass: The class to use for the shape value that * follows the swatch. - * @param {String} overrides.shapeSwatchClass: The class to use for the shape swatch. - * @param {String} overrides.urlClass: The class to be used for url() links. - * @param {String} overrides.fontFamilyClass: The class to be used for font families. - * @param {String} overrides.unmatchedClass: The class to use for a component of + * @param {string} overrides.shapeSwatchClass: The class to use for the shape swatch. + * @param {string} overrides.urlClass: The class to be used for url() links. + * @param {string} overrides.fontFamilyClass: The class to be used for font families. + * @param {string} overrides.unmatchedClass: The class to use for a component of * a `var(…)` that is not in use. - * @param {Boolean} overrides.supportsColor: Does the CSS property support colors? - * @param {String} overrides.baseURI: A string used to resolve relative links. + * @param {boolean} overrides.supportsColor: Does the CSS property support colors? + * @param {string} overrides.baseURI: A string used to resolve relative links. * @param {Function} overrides.getVariableData: A function taking a single argument, * the name of a variable. This should return an object with the following properties: * - {String|undefined} value: The variable's value. Undefined if variable is @@ -2288,11 +2288,11 @@ class OutputParser { * - {RegisteredPropertyResource|undefined} registeredProperty: The registered * property data (syntax, initial value, inherits). Undefined if the variable * is not a registered property. - * @param {Boolean} overrides.showJumpToVariableButton: Should we show a jump to + * @param {boolean} overrides.showJumpToVariableButton: Should we show a jump to * definition for CSS variables. Defaults to true. - * @param {Boolean} overrides.isDarkColorScheme: Is the currently applied color scheme dark. - * @param {Boolean} overrides.isValid: Is the name+value valid. - * @return {Object} Overridden options object + * @param {boolean} overrides.isDarkColorScheme: Is the currently applied color scheme dark. + * @param {boolean} overrides.isValid: Is the name+value valid. + * @return {object} Overridden options object */ #mergeOptions(overrides) { const defaults = { diff --git a/devtools/client/shared/redux/middleware/performance-marker.js b/devtools/client/shared/redux/middleware/performance-marker.js @@ -25,11 +25,11 @@ * }, * }); * - * @param {Object} cases: An object, keyed by action type, that will determine if a + * @param {object} cases: An object, keyed by action type, that will determine if a * given action will add a marker. - * @param {String} cases.{actionType} - The type of the action that will trigger the + * @param {string} cases.{actionType} - The type of the action that will trigger the * marker creation. - * @param {String} cases.{actionType}.label - The marker label + * @param {string} cases.{actionType}.label - The marker label * @param {Integer} cases.{actionType}.sessionId - The telemetry sessionId. This is used * to be able to distinguish markers coming from different toolboxes. * @param {Function} [cases.{actionType}.getMarkerDescription] - An optional function that diff --git a/devtools/client/shared/redux/visibilityHandlerStore.js b/devtools/client/shared/redux/visibilityHandlerStore.js @@ -17,8 +17,8 @@ function visibilityHandlerStore(store) { * The function will be called once when the panel is shown. * * @param {Function} listener - * @param {Object} options - * @param {Boolean} options.ignoreVisibility + * @param {object} options + * @param {boolean} options.ignoreVisibility * If true, bypass this helper to listen to all store updates, * regarless of panel visibility. This is useful for tests. */ diff --git a/devtools/client/shared/remote-debugging/adb/adb-addon.js b/devtools/client/shared/remote-debugging/adb/adb-addon.js @@ -110,7 +110,7 @@ class ADBAddon extends EventEmitter { * Install and enable the adb extension. Returns a promise that resolves when ADB is * enabled. * - * @param {String} source + * @param {string} source * String passed to the AddonManager for telemetry. */ async install(source) { diff --git a/devtools/client/shared/remote-debugging/remote-client-manager.js b/devtools/client/shared/remote-debugging/remote-client-manager.js @@ -22,12 +22,12 @@ class RemoteClientManager { /** * Store a remote client that is already connected. * - * @param {String} id + * @param {string} id * Remote runtime id (see devtools/client/aboutdebugging/src/types). - * @param {String} type + * @param {string} type * Remote runtime type (see devtools/client/aboutdebugging/src/types). * @param {DevToolsClient} client - * @param {Object} runtimeInfo + * @param {object} runtimeInfo * See runtimeInfo type from client/aboutdebugging/src/types/runtime.js */ setClient(id, type, client, runtimeInfo) { diff --git a/devtools/client/shared/remote-debugging/version-checker.js b/devtools/client/shared/remote-debugging/version-checker.js @@ -37,9 +37,9 @@ function getMajorVersion(platformVersion) { * version of Firefox. Backward compatibility policy for devtools supports at most 2 * versions older than the current version. * - * @param {String} localVersion + * @param {string} localVersion * The version of the local Firefox instance, eg "67.0" - * @return {Object} + * @return {object} * - minVersion {String} the minimum supported version, eg "65.0a1" * - maxVersion {String} the first unsupported version, eg "68.0a1" */ diff --git a/devtools/client/shared/screenshot.js b/devtools/client/shared/screenshot.js @@ -23,20 +23,20 @@ const L10N = new LocalizationHelper(STRINGS_URI); * * @param {TargetFront} targetFront: The targetFront of the frame we want to take a screenshot of. * @param {Window} window: The DevTools Client window. - * @param {Object} args - * @param {Boolean} args.fullpage: Should the screenshot be the height of the whole page - * @param {String} args.filename: Expected filename for the screenshot - * @param {Boolean} args.clipboard: Whether or not the screenshot should be saved to the clipboard. - * @param {Number} args.dpr: Scale of the screenshot. Defaults to the window `devicePixelRatio`. + * @param {object} args + * @param {boolean} args.fullpage: Should the screenshot be the height of the whole page + * @param {string} args.filename: Expected filename for the screenshot + * @param {boolean} args.clipboard: Whether or not the screenshot should be saved to the clipboard. + * @param {number} args.dpr: Scale of the screenshot. Defaults to the window `devicePixelRatio`. * ⚠️ Note that the scale might be decreased if the resulting * image would be too big to draw safely. Warning will be emitted * to the console if that's the case. - * @param {Number} args.delay: Number of seconds to wait before taking the screenshot - * @param {Boolean} args.help: Set to true to receive a message with the screenshot command + * @param {number} args.delay: Number of seconds to wait before taking the screenshot + * @param {boolean} args.help: Set to true to receive a message with the screenshot command * documentation. - * @param {Boolean} args.disableFlash: Set to true to disable the flash animation when the + * @param {boolean} args.disableFlash: Set to true to disable the flash animation when the * screenshot is taken. - * @param {Boolean} args.ignoreDprForFileScale: Set to true to if the resulting screenshot + * @param {boolean} args.ignoreDprForFileScale: Set to true to if the resulting screenshot * file size shouldn't be impacted by the dpr. Note that the dpr will still * be taken into account when taking the screenshot, only the size of the * file will be different. @@ -63,7 +63,7 @@ async function captureAndSaveScreenshot(targetFront, window, args = {}) { * Take a screenshot of a browser element matching the passed target * * @param {TargetFront} targetFront: The targetFront of the frame we want to take a screenshot of. - * @param {Object} args: See args param in captureAndSaveScreenshot + * @param {object} args: See args param in captureAndSaveScreenshot */ async function captureScreenshot(targetFront, args) { // @backward-compat { version 87 } The screenshot-content actor was introduced in 87, @@ -331,7 +331,7 @@ let _outputDirectory = null; * For consistency with the Firefox Screenshots feature, this will default to * the preferred downloads directory. * - * @return {Promise<String>} Resolves the path as a string + * @return {Promise<string>} Resolves the path as a string */ async function getOutputDirectory() { if (_outputDirectory) { diff --git a/devtools/client/shared/scroll.mjs b/devtools/client/shared/scroll.mjs @@ -9,11 +9,11 @@ * * @param {DOMNode} elem * The element that needs to appear in the viewport. - * @param {Boolean} centered + * @param {boolean} centered * true if you want it centered, false if you want it to appear on the * top of the viewport. It is true by default, and that is usually what * you want. - * @param {Boolean} smooth + * @param {boolean} smooth * true if you want the scroll to happen smoothly, instead of instantly. * It is false by default. */ @@ -97,7 +97,7 @@ function closestScrolledParent(node) { * @param {DOMNode|undefined} element * The item to be scrolled to. * - * @param {Object|undefined} options + * @param {object | undefined} options * An options object which can contain: * - container: possible scrollable container. If it is not scrollable, we will * look it up. diff --git a/devtools/client/shared/source-map-loader/source-map.js b/devtools/client/shared/source-map-loader/source-map.js @@ -65,9 +65,9 @@ function mapToOriginalSourceInfos(generatedId, urls) { * Load the source map and retrieved infos about all the original sources * referenced in that source map. * - * @param {Object} generatedSource + * @param {object} generatedSource * Source object for a bundle referencing a source map - * @return {Array<Object>|null} + * @return {Array<object> | null} * List of object with id and url attributes describing the original sources. */ async function getOriginalURLs(generatedSource) { @@ -85,9 +85,9 @@ async function getOriginalURLs(generatedSource) { * Load the source map for a given bundle and return information * about the related original sources and the source map itself. * - * @param {Object} generatedSource + * @param {object} generatedSource * Source object for the bundle. - * @return {Object} + * @return {object} * - {Array<Object>} sources * Object with id and url attributes, refering to the related original sources * referenced in the source map. @@ -294,7 +294,7 @@ async function getGeneratedLocation(location) { /** * Map the breakable positions (line and columns) from generated to original locations. * - * @param {Object} breakpointPositions + * @param {object} breakpointPositions * List of columns per line refering to the breakable columns per line * for a given source: * { @@ -335,10 +335,10 @@ async function getOriginalLocations(breakpointPositions, sourceId) { * * @param {SourceMapConsumer} map * The source map for the bundle source. - * @param {Object} location + * @param {object} location * A location within a bundle to map to an original location. - * @param {Object} options - * @param {Boolean} options.looseSearch + * @param {object} options + * @param {boolean} options.looseSearch * Optional, if true, will do a loose search on first column and next lines * until a mapping is found. * @return {location} @@ -391,11 +391,11 @@ function getOriginalLocationSync(map, location, { looseSearch = false } = {}) { /** * Map a bundle location to an original one. * - * @param {Object} location + * @param {object} location * Bundle location - * @param {Object} options + * @param {object} options * See getORiginalLocationSync. - * @return {Object} + * @return {object} * Original location */ async function getOriginalLocation(location, options) { @@ -616,7 +616,7 @@ async function getFileGeneratedRange(originalSourceId) { * Set the sourceMap for multiple passed source ids. * * @param {Array<string>} generatedSourceIds - * @param {Object} map: An actual sourcemap (as generated with SourceMapGenerator#toJSON) + * @param {object} map: An actual sourcemap (as generated with SourceMapGenerator#toJSON) */ function setSourceMapForGeneratedSources(generatedSourceIds, map) { const sourceMapConsumer = new SourceMapConsumer(map); diff --git a/devtools/client/shared/source-map-loader/utils/sourceMapRequests.js b/devtools/client/shared/source-map-loader/utils/sourceMapRequests.js @@ -31,10 +31,10 @@ function clearSourceMaps() { /** * For a given generated source, retrieve an object with many attributes: * - * @param {String} generatedSourceId + * @param {string} generatedSourceId * The id of the generated source * - * @return {Object} Meta data object with many attributes + * @return {object} Meta data object with many attributes * - map: The SourceMapConsumer or WasmRemap instance * - urlsById Map of Original Source ID (string) to Source URL (string) * - sources: Array of object with the two following attributes: @@ -48,7 +48,7 @@ function getSourceMapWithMetadata(generatedSourceId) { /** * Retrieve the SourceMapConsumer or WasmRemap instance for a given generated source. * - * @param {String} generatedSourceId + * @param {string} generatedSourceId * The id of the generated source * * @return null | Promise<SourceMapConsumer | WasmRemap> @@ -65,7 +65,7 @@ function getSourceMap(generatedSourceId) { /** * Record the SourceMapConsumer or WasmRemap instance for a given generated source. * - * @param {String} generatedId + * @param {string} generatedId * The generated source ID. * @param {Promise<SourceMapConsumer or WasmRemap>} request * A promise which should resolve to either a SourceMapConsume or WasmRemap instance. @@ -92,7 +92,7 @@ function setSourceMap(generatedId, request) { /** * Clear any existing SourceMapConsumer or WasmRemap instance for a given list of generated source. * - * @param {Array<String>} generatedIds + * @param {Array<string>} generatedIds * The generated source ID's. */ function clearSourceMapForSources(generatedIds) { diff --git a/devtools/client/shared/source-utils.js b/devtools/client/shared/source-utils.js @@ -45,8 +45,8 @@ const gSourceNamesStore = new Map(); * available on an URL instance, with additional properties (fileName), * Leverages caching. * - * @param {String} location - * @return {Object?} An object containing most properties available + * @param {string} location + * @return {object?} An object containing most properties available * in https://developer.mozilla.org/en-US/docs/Web/API/URL */ @@ -102,10 +102,10 @@ function parseURL(location) { /** * Parse a source into a short and long name as well as a host name. * - * @param {String} source + * @param {string} source * The source to parse. Can be a URI or names like "(eval)" or * "self-hosted". - * @return {Object} + * @return {object} * An object with the following properties: * - {String} short: A short name for the source. * - "http://page.com/test.js#go?q=query" -> "test.js" diff --git a/devtools/client/shared/sourceeditor/editor.js b/devtools/client/shared/sourceeditor/editor.js @@ -887,7 +887,7 @@ class Editor extends EventEmitter { /** * This creates the extension which handles marking of lines within the editor. * - * @returns {Object} The object contains an extension and effects which used to trigger updates to the extension + * @returns {object} The object contains an extension and effects which used to trigger updates to the extension * {Object} - lineContentMarkerExtension - The line content marker extension * {Object} - lineContentMarkerEffect - The effects to add and remove markers */ @@ -924,7 +924,7 @@ class Editor extends EventEmitter { /** * Uses the marker and current decoration list to create a new decoration list * - * @param {Object} marker - The marker to be used to create the new decoration + * @param {object} marker - The marker to be used to create the new decoration * @param {Transaction} transaction - The transaction object * @param {Array} newMarkerDecorations - List of the new marker decorations being built */ @@ -1017,7 +1017,7 @@ class Editor extends EventEmitter { * * @param {Array} markerDecorations - The current decorations displayed in the document * @param {Array} allMarkers - All the cached markers - * @param {Object} transaction + * @param {object} transaction * @returns */ function updateDecorationsForAllMarkers( @@ -1127,7 +1127,7 @@ class Editor extends EventEmitter { /** * Adds the DOM event handlers for the editor. * - * @param {Object} domEventHandlers - A dictionary of handlers for the DOM events + * @param {object} domEventHandlers - A dictionary of handlers for the DOM events * the handlers are getting called with the following arguments * - {Object} `event`: The DOM event * - {Object} `view`: The codemirror view @@ -1171,7 +1171,7 @@ class Editor extends EventEmitter { /** * Remove specified DOM event handlers for the editor. * - * @param {Object} domEventHandlers - A dictionary of handlers for the DOM events + * @param {object} domEventHandlers - A dictionary of handlers for the DOM events */ removeEditorDOMEventListeners(domEventHandlers) { const cm = editors.get(this); @@ -1225,11 +1225,11 @@ class Editor extends EventEmitter { * The unique identifier for this marker * @property {string} marker.lineClassName * The css class to apply to the line - * @property {Array<Object>} marker.lines + * @property {Array<object>} marker.lines * The lines to add markers to. Each line object has a `line` and `value` property. - * @property {Boolean} marker.renderAsBlock + * @property {boolean} marker.renderAsBlock * The specifies that the widget should be rendered as a block element. defaults to `false`. This is optional. - * @property {Boolean} marker.shouldMarkAllLines + * @property {boolean} marker.shouldMarkAllLines * Set to true to apply the marker to all the lines. In such case, `positions` is ignored. This is optional. * @property {Function} marker.createLineElementNode * This should return the DOM element which is used for the marker. The line number is passed as a parameter. @@ -1263,7 +1263,7 @@ class Editor extends EventEmitter { * This creates the extension used to manage the rendering of markers * at specific positions with the editor. e.g used for column breakpoints * - * @returns {Object} The object contains an extension and effects which used to trigger updates to the extension + * @returns {object} The object contains an extension and effects which used to trigger updates to the extension * {Object} - positionContentMarkerExtension - The position content marker extension * {Object} - positionContentMarkerEffect - The effects to add and remove markers */ @@ -1446,7 +1446,7 @@ class Editor extends EventEmitter { * * @param {Array} markerDecorations - The current decorations displayed in the document * @param {Array} markers - All the cached markers - * @param {Object} transaction + * @param {object} transaction * @returns */ function updateDecorationsForAllMarkers( @@ -1541,9 +1541,9 @@ class Editor extends EventEmitter { /** * This adds a marker used to decorate token / content at a specific position . * - * @param {Object} marker - * @param {String} marker.id - * @param {Array<Object>} marker.positions - This includes the line / column and any optional positionData which defines each position. + * @param {object} marker + * @param {string} marker.id + * @param {Array<object>} marker.positions - This includes the line / column and any optional positionData which defines each position. * @param {Function} marker.createPositionElementNode - This describes how to render the marker. * The position data (i.e line, column and positionData) are passed as arguments. * @param {Function} marker.customEq - A custom function to determine the equality of the marker. This allows the user define special conditions @@ -1579,7 +1579,7 @@ class Editor extends EventEmitter { /** * Set event listeners for the line gutter * - * @param {Object} domEventHandlers + * @param {object} domEventHandlers * * example usage: * const domEventHandlers = { click(event) { console.log(event);} } @@ -1635,7 +1635,7 @@ class Editor extends EventEmitter { * @property {function} marker.condition - The condition that decides if the marker/class gets added or removed. * This should return `false` for lines where the marker should not be added and the * result of the condition for any other line. - * @property {function=} marker.createLineElementNode - This gets the line and the result of the condition as arguments and should return the DOM element which + * @property {Function=} marker.createLineElementNode - This gets the line and the result of the condition as arguments and should return the DOM element which * is used for the marker. This is optional. */ setLineGutterMarkers(markers) { @@ -1736,7 +1736,7 @@ class Editor extends EventEmitter { * results for any search pattern * * @param {RegExp} pattern - The search pattern - * @param {String} className - The class used to decorate each result + * @param {string} className - The class used to decorate each result * @returns {Array<ViewPlugin>} An extension which is an array containing the view * which manages the rendering of the line content markers. */ @@ -1796,7 +1796,7 @@ class Editor extends EventEmitter { * This should add the class to the results of a search pattern specified * * @param {RegExp} pattern - The search pattern - * @param {String} className - The class used to decorate each result + * @param {string} className - The class used to decorate each result */ highlightSearchMatches(pattern, className) { const cm = editors.get(this); @@ -1817,7 +1817,7 @@ class Editor extends EventEmitter { /** * Retrieves the cursor for the next selection to be highlighted * - * @param {Boolean} reverse - Determines the direction of the cursor movement + * @param {boolean} reverse - Determines the direction of the cursor movement * @returns {RegExpSearchCursor} */ getNextSearchCursor(reverse) { @@ -1842,9 +1842,9 @@ class Editor extends EventEmitter { /** * Get the start and end locations of the current viewport * - * @param {Number} offsetHorizontalCharacters - Offset of characters offscreen - * @param {Number} offsetVerticalLines - Offset of lines offscreen - * @returns {Object} - The location information for the current viewport + * @param {number} offsetHorizontalCharacters - Offset of characters offscreen + * @param {number} offsetVerticalLines - Offset of lines offscreen + * @returns {object} - The location information for the current viewport */ getLocationsInViewport( offsetHorizontalCharacters = 0, @@ -1899,7 +1899,7 @@ class Editor extends EventEmitter { /** * Gets the position information for the current selection * - * @returns {Object} cursor - The location information for the current selection + * @returns {object} cursor - The location information for the current selection * cursor.from - An object with the starting line / column of the selection * cursor.to - An object with the end line / column of the selection */ @@ -1929,7 +1929,7 @@ class Editor extends EventEmitter { /** * Gets the text content for the current selection * - * @returns {String} + * @returns {string} */ getSelectedText() { const cm = editors.get(this); @@ -1945,9 +1945,9 @@ class Editor extends EventEmitter { * related. This used currently to determine the line and columns * for the tokens that are hovered over. * - * @param {Number} left - Horizontal position from the left - * @param {Number} top - Vertical position from the top - * @returns {Object} position - The line and column related to the screen coordinates. + * @param {number} left - Horizontal position from the left + * @param {number} top - Vertical position from the top + * @returns {object} position - The line and column related to the screen coordinates. */ getPositionAtScreenCoords(left, top) { const cm = editors.get(this); @@ -1979,7 +1979,7 @@ class Editor extends EventEmitter { /** * Check that text is selected * - * @returns {Boolean} + * @returns {boolean} */ isTextSelected() { const cm = editors.get(this); @@ -2020,8 +2020,8 @@ class Editor extends EventEmitter { /** * Creates a CodeMirror Document * - * @param {String} text: Initial text of the document - * @param {Object|String} mode: Mode of the document. See https://codemirror.net/5/doc/manual.html#option_mode + * @param {string} text: Initial text of the document + * @param {object | string} mode: Mode of the document. See https://codemirror.net/5/doc/manual.html#option_mode * @returns CodeMirror.Doc */ createDocument(text = "", mode) { @@ -2039,7 +2039,7 @@ class Editor extends EventEmitter { /** * Changes the currently used syntax highlighting mode. * - * @param {Object} mode - Any of the modes from Editor.modes + * @param {object} mode - Any of the modes from Editor.modes * @returns */ setMode(mode) { @@ -2138,8 +2138,8 @@ class Editor extends EventEmitter { /** * Gets details about the line * - * @param {Number} line - * @returns {Object} line info object + * @param {number} line + * @returns {object} line info object */ lineInfo(line) { const cm = editors.get(this); @@ -2164,7 +2164,7 @@ class Editor extends EventEmitter { * Get the functions symbols for the current source loaded in the * the editor. * - * @param {Number} maxResults - The maximum no of results to display + * @param {number} maxResults - The maximum no of results to display */ async getFunctionSymbols(maxResults) { const cm = editors.get(this); @@ -2243,7 +2243,7 @@ class Editor extends EventEmitter { * This is used to map original function names to their corresponding * generated functions. * - * @param {Object} location + * @param {object} location * @returns */ async getClosestFunctionName(location) { @@ -2296,7 +2296,7 @@ class Editor extends EventEmitter { * which best match the specified token location is on our * list of accepted symbol types. * - * @param {Object} tokenLocation + * @param {object} tokenLocation * @returns {Array} Member expression matches */ async findBestMatchExpressions(tokenLocation) { @@ -2362,7 +2362,7 @@ class Editor extends EventEmitter { /** * Get all the lines which are inscope when paused a the specified location. * - * @param {Object} location + * @param {object} location * @param {Array} in scope lines */ async getInScopeLines(location) { @@ -2430,10 +2430,10 @@ class Editor extends EventEmitter { * Gets all the bindings and generates the related references for * the specified platform scope and its ancestry * - * @param {Object} location - The currently paused location - * @param {Object} scope - The innermost scope node for the tree. This is provided by the + * @param {object} location - The currently paused location + * @param {object} scope - The innermost scope node for the tree. This is provided by the * platform. - * @returns {Object} Binding references + * @returns {object} Binding references * Structure * ========== * { @@ -2542,12 +2542,12 @@ class Editor extends EventEmitter { * Replaces whatever is in the text area with the contents of * the 'value' argument. * - * @param {String} value: The text to replace the editor content - * @param {Object} options - * @param {String} options.documentId + * @param {string} value: The text to replace the editor content + * @param {object} options + * @param {string} options.documentId * Optional unique id represeting the specific document which is source of the text. * Will be null for loading and error messages. - * @param {Boolean} options.saveTransactionToHistory + * @param {boolean} options.saveTransactionToHistory * This determines if the transaction for this specific text change should be added to the undo/redo history. */ async setText(value, { documentId, saveTransactionToHistory = true } = {}) { @@ -3441,7 +3441,7 @@ class Editor extends EventEmitter { /** * Gets the element at the specified codemirror offset * - * @param {Number} offset + * @param {number} offset * @return {Element|null} */ #getElementAtOffset(offset) { @@ -3462,9 +3462,9 @@ class Editor extends EventEmitter { * This checks if the specified position (line/column) is within the current viewport * bounds. it helps determine if scrolling should happen. * - * @param {Number} line - The line in the source - * @param {Number} column - The column in the source - * @returns {Boolean} + * @param {number} line - The line in the source + * @param {number} column - The column in the source + * @returns {boolean} */ isPositionVisible(line, column) { const cm = editors.get(this); @@ -3521,9 +3521,9 @@ class Editor extends EventEmitter { /** * Converts line/col to CM6 offset position * - * @param {Number} line - The line in the source - * @param {Number} col - The column in the source - * @returns {Number} + * @param {number} line - The line in the source + * @param {number} col - The column in the source + * @returns {number} */ #positionToOffset(line, col = 0) { const cm = editors.get(this); @@ -3541,7 +3541,7 @@ class Editor extends EventEmitter { * This returns the line and column for the specified search cursor's position * * @param {RegExpSearchCursor} searchCursor - * @returns {Object} + * @returns {object} */ getPositionFromSearchCursor(searchCursor) { const cm = editors.get(this); @@ -3555,7 +3555,7 @@ class Editor extends EventEmitter { /** * Scrolls the editor to the specified codemirror position * - * @param {Number} position + * @param {number} position */ scrollToPosition(position) { const cm = editors.get(this); @@ -3576,9 +3576,9 @@ class Editor extends EventEmitter { /** * Scrolls the editor to the specified line and column * - * @param {Number} line - The line in the source - * @param {Number} column - The column in the source - * @param {String|null} yAlign - Optional value for position of the line after the line is scrolled. + * @param {number} line - The line in the source + * @param {number} column - The column in the source + * @param {string | null} yAlign - Optional value for position of the line after the line is scrolled. * (Used by `scrollEditorIntoView` test helper) */ async scrollTo(line, column, yAlign) { @@ -3647,8 +3647,8 @@ class Editor extends EventEmitter { * This will also scroll the editor to the specified position. * Used only for CM6 * - * @param {Number} line - * @param {Number} column + * @param {number} line + * @param {number} column */ async setCursorAt(line, column) { await this.scrollTo(line, column); @@ -3960,8 +3960,8 @@ class Editor extends EventEmitter { * adds to handle syntax highlighting. * * @param {Document} doc: A document that will be used to create elements - * @param {String} code: The code to highlight - * @returns {String} The HTML string for the parsed code + * @param {string} code: The code to highlight + * @returns {string} The HTML string for the parsed code */ highlightText(doc, code) { if (!doc) { diff --git a/devtools/client/shared/sourceeditor/lezer-utils.js b/devtools/client/shared/sourceeditor/lezer-utils.js @@ -86,7 +86,7 @@ const ast = new Map(); /** * Checks if a node has children with any of the node types specified * - * @param {Object} node + * @param {object} node * @param {Set} types * @returns */ @@ -104,7 +104,7 @@ function hasChildNodeOfType(node, types) { /** * Checks if a node has children with any of the node types specified * - * @param {Object} node + * @param {object} node * @param {Set} types * @returns */ @@ -122,9 +122,9 @@ function findChildNodeOfType(node, types) { /** * Gets a cached tree or parses the the source content * - * @param {Object} parserLanguage - The language parser used to parse the source - * @param {String} id - A unique identifier for the source - * @param {String} content - The source text + * @param {object} parserLanguage - The language parser used to parse the source + * @param {string} id - A unique identifier for the source + * @param {string} content - The source text * @returns {Tree} - https://lezer.codemirror.net/docs/ref/#common.Tree */ function getTree(parserLanguage, id, content) { @@ -143,9 +143,9 @@ function clear() { /** * Gets the node and the function name which immediately encloses the node (representing a location) * - * @param {Object} doc - The codemirror document used to retrive the part of content - * @param {Object} node - The parser syntax node https://lezer.codemirror.net/docs/ref/#common.SyntaxNode - * @params {Object} options + * @param {object} doc - The codemirror document used to retrive the part of content + * @param {object} node - The parser syntax node https://lezer.codemirror.net/docs/ref/#common.SyntaxNode + * @params {object} options * options.includeAnonymousFunctions - if true, allow matching anonymous functions * @returns */ @@ -182,10 +182,10 @@ function getEnclosingFunction( * Gets the parent scope node for the specified node. * If neither is found then we fallback to the script node for the source. * - * @param {Object} node - * @param {String} scopeType - The scope type specifies what kind of scope node to look for. + * @param {object} node + * @param {string} scopeType - The scope type specifies what kind of scope node to look for. * The types are defined by the platform. See https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.Environment.html#type - * @returns {Object | null} scope node or null if none is found + * @returns {object | null} scope node or null if none is found */ function getParentScopeOfType(node, scopeType) { let parentNode = node.parent; @@ -218,10 +218,10 @@ function getParentScopeOfType(node, scopeType) { /** * Gets the node at the specified location * - * @param {Object} doc - https://codemirror.net/docs/ref/#state.EditorState.doc - * @param {Object} tree - https://lezer.codemirror.net/docs/ref/#common.Tree - * @param {Object} location - * @returns {Object} node - https://lezer.codemirror.net/docs/ref/#common.SyntaxNodeRef + * @param {object} doc - https://codemirror.net/docs/ref/#state.EditorState.doc + * @param {object} tree - https://lezer.codemirror.net/docs/ref/#common.Tree + * @param {object} location + * @returns {object} node - https://lezer.codemirror.net/docs/ref/#common.SyntaxNodeRef */ function getTreeNodeAtLocation(doc, tree, location) { try { @@ -238,8 +238,8 @@ function getTreeNodeAtLocation(doc, tree, location) { /** * Converts Codemirror position to valid source location. Used only for CM6 * - * @param {Object} doc - The Codemirror document used to retrive the part of content - * @param {Number} pos - Codemirror offset + * @param {object} doc - The Codemirror document used to retrive the part of content + * @param {number} pos - Codemirror offset * @returns */ function positionToLocation(doc, pos) { @@ -260,9 +260,9 @@ function positionToLocation(doc, pos) { * Gets the name of the function if any exists, returns null * for anonymous functions. * - * @param {Object} doc - The codemirror document used to retrive the part of content - * @param {Object} node - The parser syntax node https://lezer.codemirror.net/docs/ref/#common.SyntaxNode - * @returns {String|null} + * @param {object} doc - The codemirror document used to retrive the part of content + * @param {object} node - The parser syntax node https://lezer.codemirror.net/docs/ref/#common.SyntaxNode + * @returns {string | null} */ function getFunctionName(doc, node) { /** @@ -375,8 +375,8 @@ function getFunctionName(doc, node) { /** * Gets the parameter names of the function as an array * - * @param {Object} doc - The codemirror document used to retrieve the part of content - * @param {Object} node - The parser syntax node https://lezer.codemirror.net/docs/ref/#common.SyntaxNode + * @param {object} doc - The codemirror document used to retrieve the part of content + * @param {object} node - The parser syntax node https://lezer.codemirror.net/docs/ref/#common.SyntaxNode * @returns {Array} */ function getFunctionParameterNames(doc, node) { @@ -441,8 +441,8 @@ function getFunctionClass(doc, node) { /** * Gets the meta data for member expression nodes * - * @param {Object} doc - The codemirror document used to retrieve the part of content - * @param {Object} node - The parser syntax node https://lezer.codemirror.net/docs/ref/#common.SyntaxNode + * @param {object} doc - The codemirror document used to retrieve the part of content + * @param {object} node - The parser syntax node https://lezer.codemirror.net/docs/ref/#common.SyntaxNode * @returns */ function getMetaBindings(doc, node) { @@ -463,9 +463,9 @@ function getMetaBindings(doc, node) { /** * Walk the syntax tree of the langauge provided * - * @param {Object} view - Codemirror view (https://codemirror.net/docs/ref/#view) - * @param {Object} language - Codemirror Language (https://codemirror.net/docs/ref/#language) - * @param {Object} options + * @param {object} view - Codemirror view (https://codemirror.net/docs/ref/#view) + * @param {object} language - Codemirror Language (https://codemirror.net/docs/ref/#language) + * @param {object} options * {Boolean} options.forceParseTo - Force parsing the document up to a certain point * {Function} options.enterVisitor - A function that is called when a node is entered * {Set} options.filterSet - A set of node types which should be visited, all others should be ignored @@ -495,8 +495,8 @@ async function walkTree(view, language, options) { * This enables walking a specific part of the syntax tree using the cursor * provided by the node (which is the parent) * - * @param {Object} cursor - https://lezer.codemirror.net/docs/ref/#common.TreeCursor - * @param {Object} options + * @param {object} cursor - https://lezer.codemirror.net/docs/ref/#common.TreeCursor + * @param {object} options * {Function} options.enterVisitor - A function that is called when a node is entered * {Set} options.filterSet - A set of node types which should be visited, all others should be ignored */ @@ -512,8 +512,8 @@ async function walkCursor(cursor, options) { * Merge variables, arguments and child properties of member expressions * into a unique "bindings" objects where arguments overrides variables. * - * @param {Object} scopeBindings - * @returns {Object} bindings + * @param {object} scopeBindings + * @returns {object} bindings */ function getScopeBindings(scopeBindings) { const bindings = { ...scopeBindings.variables }; diff --git a/devtools/client/shared/sourceeditor/scope-utils.js b/devtools/client/shared/sourceeditor/scope-utils.js @@ -7,9 +7,9 @@ /** * Check if the position is within this function location * - * @param {Object} functionLocation - * @param {Object} position - * @returns {Boolean} + * @param {object} functionLocation + * @param {object} position + * @returns {boolean} */ function containsPosition(functionLocation, position) { // Start diff --git a/devtools/client/shared/sourceeditor/test/head.js b/devtools/client/shared/sourceeditor/test/head.js @@ -81,7 +81,7 @@ function teardown(ed, win) { * separate directory. * The script will be loaded synchronously and in the test's scope. * - * @param {String} filePath The file path, relative to the current directory. + * @param {string} filePath The file path, relative to the current directory. * Examples: * - "helper_attributes_test_runner.js" */ diff --git a/devtools/client/shared/sourceeditor/wasm.js b/devtools/client/shared/sourceeditor/wasm.js @@ -39,7 +39,7 @@ function getWasmText(subject, data) { * Creates wasm formatter function used to generate the hexadecimal number * displayed in the line gutter * - * @param {Object} subject - An object which decribes the source, it is comprised of the sourceId + * @param {object} subject - An object which decribes the source, it is comprised of the sourceId * @returns {Function} */ function getWasmLineNumberFormatter(subject) { @@ -78,8 +78,8 @@ function getWasmLineNumberFormatter(subject) { * Checks if the specified source exists in the cache. * This is used to determine if the source is a WASM source * - * @param {Object} subject - * @returns {Boolean} + * @param {object} subject + * @returns {boolean} */ function isWasm(subject) { return wasmStates.has(subject); @@ -88,13 +88,13 @@ function isWasm(subject) { /** * Converts the source (decimal) line to its WASM offset * - * @param {Object} subject - * @param {Number} line - * @param {Boolean} findNextOffset + * @param {object} subject + * @param {number} line + * @param {boolean} findNextOffset * There are scenarios (e.g are empty lines) where we might want to find the next best offset match. * Every line will usually have offsets assigned except empty lines (which could be between functions * or some declarations). - * @returns {Number} + * @returns {number} */ function lineToWasmOffset(subject, line, findNextOffset = false) { const wasmState = wasmStates.get(subject); @@ -114,9 +114,9 @@ function lineToWasmOffset(subject, line, findNextOffset = false) { /** * Converts the WASM offset to the source line * - * @param {Object} subject - * @param {Number} offset - * @returns {Number} + * @param {object} subject + * @param {number} offset + * @returns {number} */ function wasmOffsetToLine(subject, offset) { const wasmState = wasmStates.get(subject); diff --git a/devtools/client/shared/string-utils.js b/devtools/client/shared/string-utils.js @@ -13,7 +13,7 @@ const { * @param {DevToolsClient} client * @param {object|string} stringGrip: A long string grip. If the param is a simple string, * it will be returned as is. - * @return {Promise<String>} The full string content. + * @return {Promise<string>} The full string content. */ async function getLongStringFullText(client, stringGrip) { if (typeof stringGrip !== "object" || stringGrip.type !== "longString") { diff --git a/devtools/client/shared/stylesheet-utils.js b/devtools/client/shared/stylesheet-utils.js @@ -16,9 +16,9 @@ function stylesheetLoadPromise(styleSheet) { * * @param {Document} doc * The chrome document where the stylesheet should be appended. - * @param {String} url + * @param {string} url * The url of the stylesheet to load. - * @return {Object} + * @return {object} * - styleSheet {XMLStylesheetProcessingInstruction} the instruction node created. * - loadPromise {Promise} that will resolve/reject when the stylesheet finishes * or fails to load. diff --git a/devtools/client/shared/suggestion-picker.js b/devtools/client/shared/suggestion-picker.js @@ -20,7 +20,7 @@ * @param {Array} sortedItems * Array of sorted items that suggestions are evaluated against. Array * should be sorted by relevance, most relevant item first. - * @return {Number} + * @return {number} */ function findMostRelevantIndex(items, sortedItems) { if (!Array.isArray(items) || !Array.isArray(sortedItems)) { diff --git a/devtools/client/shared/telemetry.js b/devtools/client/shared/telemetry.js @@ -25,8 +25,8 @@ const PENDING_EVENTS = new WeakMapMap(); /** * Instantiate a new Telemetry helper class. * - * @param {Object} options [optional] - * @param {Boolean} options.useSessionId [optional] + * @param {object} options [optional] + * @param {boolean} options.useSessionId [optional] * If true, this instance will automatically generate a unique "sessionId" * and use it to aggregate all records against this unique session. * This helps aggregate all data coming from a single toolbox instance for ex. @@ -90,17 +90,17 @@ class Telemetry { * properties have been received. Once they have all been received we send the * telemetry event. * - * @param {Object} obj + * @param {object} obj * The telemetry event or ping is associated with this object, meaning * that multiple events or pings for the same histogram may be run * concurrently, as long as they are associated with different objects. - * @param {String} method + * @param {string} method * The telemetry event method (describes the type of event that * occurred e.g. "open") - * @param {String} object + * @param {string} object * The telemetry event object name (the name of the object the event * occurred on) e.g. "tools" or "setting" - * @param {String|null} value + * @param {string | null} value * The telemetry event value (a user defined value, providing context * for the event) e.g. "console" * @param {Array} expected @@ -143,22 +143,22 @@ class Telemetry { * This means that if preparePendingEvent() is called before or after sending * the event properties they will automatically added to the event. * - * @param {Object} obj + * @param {object} obj * The telemetry event or ping is associated with this object, meaning * that multiple events or pings for the same histogram may be run * concurrently, as long as they are associated with different objects. - * @param {String} method + * @param {string} method * The telemetry event method (describes the type of event that * occurred e.g. "open") - * @param {String} object + * @param {string} object * The telemetry event object name (the name of the object the event * occurred on) e.g. "tools" or "setting" - * @param {String|null} value + * @param {string | null} value * The telemetry event value (a user defined value, providing context * for the event) e.g. "console" - * @param {String} pendingPropName + * @param {string} pendingPropName * The pending property name - * @param {String} pendingPropValue + * @param {string} pendingPropValue * The pending property value */ addEventProperty( @@ -211,20 +211,20 @@ class Telemetry { * This means that if preparePendingEvent() is called before or after sending * the event properties they will automatically added to the event. * - * @param {Object} obj + * @param {object} obj * The telemetry event or ping is associated with this object, meaning * that multiple events or pings for the same histogram may be run * concurrently, as long as they are associated with different objects. - * @param {String} method + * @param {string} method * The telemetry event method (describes the type of event that * occurred e.g. "open") - * @param {String} object + * @param {string} object * The telemetry event object name (the name of the object the event * occurred on) e.g. "tools" or "setting" - * @param {String|null} value + * @param {string | null} value * The telemetry event value (a user defined value, providing context * for the event) e.g. "console" - * @param {String} pendingObject + * @param {string} pendingObject * An object containing key, value pairs that should be added to the * event as properties. */ @@ -239,17 +239,17 @@ class Telemetry { * prepare a pending telemetry event for sending and then send it via * recordEvent(). * - * @param {Object} obj + * @param {object} obj * The telemetry event or ping is associated with this object, meaning * that multiple events or pings for the same histogram may be run * concurrently, as long as they are associated with different objects. - * @param {String} method + * @param {string} method * The telemetry event method (describes the type of event that * occurred e.g. "open") - * @param {String} object + * @param {string} object * The telemetry event object name (the name of the object the event * occurred on) e.g. "tools" or "setting" - * @param {String|null} value + * @param {string | null} value * The telemetry event value (a user defined value, providing context * for the event) e.g. "console" */ @@ -265,16 +265,16 @@ class Telemetry { /** * Send a telemetry event. * - * @param {String} method + * @param {string} method * The telemetry event method (describes the type of event that * occurred e.g. "open") - * @param {String} object + * @param {string} object * The telemetry event object name (the name of the object the event * occurred on) e.g. "tools" or "setting" - * @param {String|null} [value] + * @param {string | null} [value] * Optional telemetry event value (a user defined value, providing * context for the event) e.g. "console" - * @param {Object} [extra] + * @param {object} [extra] * Optional telemetry event extra object containing the properties that * will be sent with the event e.g. * { @@ -328,9 +328,9 @@ class Telemetry { /** * Sends telemetry pings to indicate that a tool has been opened. * - * @param {String} id + * @param {string} id * The ID of the tool opened. - * @param {Object} obj + * @param {object} obj * The telemetry event or ping is associated with this object, meaning * that multiple events or pings for the same histogram may be run * concurrently, as long as they are associated with different objects. @@ -376,9 +376,9 @@ class Telemetry { /** * Sends telemetry pings to indicate that a tool has been closed. * - * @param {String} id + * @param {string} id * The ID of the tool opened. - * @param {Object} obj + * @param {object} obj * The telemetry event or ping is associated with this object, meaning * that multiple events or pings for the same histogram may be run * concurrently, as long as they are associated with different objects. @@ -418,7 +418,7 @@ class Telemetry { /** * Returns the telemetry charts for a specific tool. * - * @param {String} id + * @param {string} id * The ID of the tool that has been opened. */ // eslint-disable-next-line complexity diff --git a/devtools/client/shared/test-helpers/jest-fixtures/Services.js b/devtools/client/shared/test-helpers/jest-fixtures/Services.js @@ -32,8 +32,8 @@ const PREFIX = "Services.prefs:"; * * @param {PrefBranch} parent the parent branch, or null for the root * branch. - * @param {String} name the base name of this branch - * @param {String} fullName the fully-qualified name of this branch + * @param {string} name the base name of this branch + * @param {string} fullName the fully-qualified name of this branch */ function PrefBranch(parent, name, fullName) { this._parent = parent; @@ -292,13 +292,13 @@ PrefBranch.prototype = { * storage. This is used to handle changes to local storage that * were made externally. * - * @param {Number} type one of the PREF_* values + * @param {number} type one of the PREF_* values * @param {Any} userValue the user value to use if the pref does not exist * @param {Any} defaultValue the default value to use if the pref * does not exist - * @param {Boolean} hasUserValue if a new pref is created, whether + * @param {boolean} hasUserValue if a new pref is created, whether * the default value is also a user value - * @param {Object} store the new value of the preference. It should + * @param {object} store the new value of the preference. It should * be of the form {type, defaultValue, hasUserValue, userValue}; * where |type| is one of the PREF_* type constants; |defaultValue| * and |userValue| are the default and user values, respectively; @@ -319,8 +319,8 @@ PrefBranch.prototype = { * Helper function to find either a Preference or PrefBranch object * given its name. If the name is not found, throws an exception. * - * @param {String} prefName the fully-qualified preference name - * @return {Object} Either a Preference or PrefBranch object + * @param {string} prefName the fully-qualified preference name + * @return {object} Either a Preference or PrefBranch object */ _findPref(prefName) { const branchNames = prefName.split("."); @@ -342,7 +342,7 @@ PrefBranch.prototype = { * changed. This will also notify the parent branch for further * reporting. * - * @param {String} relativeName the name of the updated pref, + * @param {string} relativeName the name of the updated pref, * relative to this branch */ _notify(relativeName) { @@ -404,14 +404,14 @@ PrefBranch.prototype = { * Create a new preference. The new preference is assumed to be in * local storage already, and the new value is taken from there. * - * @param {String} keyName the full-qualified name of the preference. + * @param {string} keyName the full-qualified name of the preference. * This is also the name of the key in local storage. * @param {Any} userValue the user value to use if the pref does not exist - * @param {Boolean} hasUserValue if a new pref is created, whether + * @param {boolean} hasUserValue if a new pref is created, whether * the default value is also a user value * @param {Any} defaultValue the default value to use if the pref * does not exist - * @param {Boolean} init if true, then this call is initialization + * @param {boolean} init if true, then this call is initialization * from local storage and should override the default prefs */ _findOrCreatePref( diff --git a/devtools/client/shared/test/browser_autocomplete_popup_input.js b/devtools/client/shared/test/browser_autocomplete_popup_input.js @@ -225,8 +225,8 @@ function hasFocus(node) { * * @param {AutocompletePopup} popup * @param {HTMLInput} input - * @param {Object} expectedSelectedItem - * @param {String} info + * @param {object} expectedSelectedItem + * @param {string} info */ function checkPopupSelectedItem(popup, input, expectedSelectedItem, info) { is(popup.selectedItem.label, expectedSelectedItem.label, info); diff --git a/devtools/client/shared/test/browser_inplace-editor_autocomplete_02.js b/devtools/client/shared/test/browser_inplace-editor_autocomplete_02.js @@ -206,7 +206,7 @@ add_task(async function () { * * @param {Document} doc * @param {Window} win - * @param {String} property - The property name + * @param {string} property - The property name * @param {Array} testData - The data passed to helper_inplace_editor.js `testComplation`. * format : * [ diff --git a/devtools/client/shared/test/browser_inplace-editor_maxwidth.js b/devtools/client/shared/test/browser_inplace-editor_maxwidth.js @@ -111,7 +111,7 @@ const testMaxWidth = async function (editor) { * Retrieve the current number of lines displayed in the provided textarea. * * @param {DOMNode} textarea - * @return {Number} the number of lines + * @return {number} the number of lines */ function getLines(textarea) { const win = textarea.ownerDocument.defaultView; diff --git a/devtools/client/shared/test/browser_spectrum.js b/devtools/client/shared/test/browser_spectrum.js @@ -54,9 +54,9 @@ add_task(async function () { * Helper method for extracting the rgba overlay value of the color preview's background * image style. * - * @param {String} linearGradientStr + * @param {string} linearGradientStr * The linear gradient CSS string. - * @return {String} Returns the rgba string for the color overlay. + * @return {string} Returns the rgba string for the color overlay. */ function extractRgbaOverlayString(linearGradientStr) { const start = linearGradientStr.indexOf("("); diff --git a/devtools/client/shared/test/head.js b/devtools/client/shared/test/head.js @@ -133,9 +133,9 @@ const createHost = async function ( * Open and close the toolbox in the current browser tab, several times, waiting * some amount of time in between. * - * @param {Number} nbOfTimes - * @param {Number} usageTime in milliseconds - * @param {String} toolId + * @param {number} nbOfTimes + * @param {number} usageTime in milliseconds + * @param {string} toolId */ async function openAndCloseToolbox(nbOfTimes, usageTime, toolId) { for (let i = 0; i < nbOfTimes; i++) { diff --git a/devtools/client/shared/test/helper_html_tooltip.js b/devtools/client/shared/test/helper_html_tooltip.js @@ -17,7 +17,7 @@ * The tooltip instance to display * @param {Node} anchor * The anchor that should be used to display the tooltip - * @param {Object} see HTMLTooltip:show documentation + * @param {object} see HTMLTooltip:show documentation * @return {Promise} promise that resolves when reflow and repaint are done. */ async function showTooltip(tooltip, anchor, { position, x, y } = {}) { @@ -72,7 +72,7 @@ function waitForReflow(tooltip) { * The HTMLTooltip instance to check * @param {Node} anchor * The tooltip's anchor - * @param {Object} expected + * @param {object} expected * - {String} position : "top" or "bottom" * - {Boolean} leftAligned * - {Number} width: expected tooltip width diff --git a/devtools/client/shared/test/helper_inplace_editor.js b/devtools/client/shared/test/helper_inplace_editor.js @@ -19,11 +19,11 @@ const { colorUtils } = require("resource://devtools/shared/css/color.js"); * Create an inplace editor linked to a span element and click on the span to * to turn to edit mode. * - * @param {Object} options + * @param {object} options * Options passed to the InplaceEditor/editableField constructor. * @param {Document} doc * Document where the span element will be created. - * @param {String} textContent + * @param {string} textContent * (optional) String that will be used as the text content of the span. */ const createInplaceEditorAndClick = async function (options, doc, textContent) { diff --git a/devtools/client/shared/test/highlighter-test-actor.js b/devtools/client/shared/test/highlighter-test-actor.js @@ -49,7 +49,7 @@ const dumpn = msg => { * the highlighter, inserted into the nsCanvasFrame. * * @see /devtools/server/actors/highlighters.js - * @param {String} actorID + * @param {string} actorID */ function getHighlighterCanvasFrameHelper(conn, actorID) { // Retrieve the CustomHighlighterActor by its actorID: @@ -223,7 +223,7 @@ class HighlighterTestActor extends protocol.Actor { /** * Helper to retrieve a DOM element. * - * @param {string | array} selector Either a regular selector string + * @param {string | Array} selector Either a regular selector string * or a selector array. If an array, each item, except the last one * are considered matching an iframe, so that we can query element * within deep iframes. @@ -272,10 +272,10 @@ class HighlighterTestActor extends protocol.Actor { * Get a value for a given attribute name, on one of the elements of the box * model highlighter, given its ID. * - * @param {String} nodeID The full ID of the element to get the attribute for - * @param {String} name The name of the attribute to get - * @param {String} actorID The highlighter actor ID - * @return {String} The value, if found, null otherwise + * @param {string} nodeID The full ID of the element to get the attribute for + * @param {string} name The name of the attribute to get + * @param {string} actorID The highlighter actor ID + * @return {string} The value, if found, null otherwise */ getHighlighterAttribute(nodeID, name, actorID) { const helper = getHighlighterCanvasFrameHelper(this.conn, actorID); @@ -290,8 +290,8 @@ class HighlighterTestActor extends protocol.Actor { /** * Get the bounding client rect for an highlighter element, given its ID. * - * @param {String} nodeID The full ID of the element to get the DOMRect for - * @param {String} actorID The highlighter actor ID + * @param {string} nodeID The full ID of the element to get the DOMRect for + * @param {string} actorID The highlighter actor ID * @return {DOMRect} The value, if found, null otherwise */ getHighlighterBoundingClientRect(nodeID, actorID) { @@ -308,10 +308,10 @@ class HighlighterTestActor extends protocol.Actor { * Get the computed style for a given property, on one of the elements of the * box model highlighter, given its ID. * - * @param {String} nodeID The full ID of the element to get the attribute for - * @param {String} property The name of the property - * @param {String} actorID The highlighter actor ID - * @return {String} The computed style of the property + * @param {string} nodeID The full ID of the element to get the attribute for + * @param {string} property The name of the property + * @param {string} actorID The highlighter actor ID + * @return {string} The computed style of the property */ getHighlighterComputedStyle(nodeID, property, actorID) { const helper = getHighlighterCanvasFrameHelper(this.conn, actorID); @@ -327,9 +327,9 @@ class HighlighterTestActor extends protocol.Actor { * Get the textcontent of one of the elements of the box model highlighter, * given its ID. * - * @param {String} nodeID The full ID of the element to get the attribute for - * @param {String} actorID The highlighter actor ID - * @return {String} The textcontent value + * @param {string} nodeID The full ID of the element to get the attribute for + * @param {string} actorID The highlighter actor ID + * @return {string} The textcontent value */ getHighlighterNodeTextContent(nodeID, actorID) { let value; @@ -343,8 +343,8 @@ class HighlighterTestActor extends protocol.Actor { /** * Get the number of box-model highlighters created by the SelectorHighlighter * - * @param {String} actorID The highlighter actor ID - * @return {Number} The number of box-model highlighters created, or null if the + * @param {string} actorID The highlighter actor ID + * @return {number} The number of box-model highlighters created, or null if the * SelectorHighlighter was not found. */ getSelectorHighlighterBoxNb(actorID) { @@ -361,9 +361,9 @@ class HighlighterTestActor extends protocol.Actor { * the currently highlighted node and send a message when the highlighter has * updated. * - * @param {String} the name of the attribute to be changed - * @param {String} the new value for the attribute - * @param {String} actorID The highlighter actor ID + * @param {string} the name of the attribute to be changed + * @param {string} the new value for the attribute + * @param {string} actorID The highlighter actor ID */ changeHighlightedNodeWaitForUpdate(name, value, actorID) { return new Promise(resolve => { @@ -382,7 +382,7 @@ class HighlighterTestActor extends protocol.Actor { * back and the client would know the event listener is properly set. * A separate event, "highlighter-updated", will be emitted when the highlighter updates. * - * @param {String} actorID The highlighter actor ID + * @param {string} actorID The highlighter actor ID */ registerOneTimeHighlighterUpdate(actorID) { const { _highlighter } = this.conn.getActor(actorID); @@ -431,7 +431,7 @@ class HighlighterTestActor extends protocol.Actor { /** * Simulates a click on a button of the debugger pause overlay. * - * @param {String} id: The id of the element (e.g. "paused-dbg-resume-button"). + * @param {string} id: The id of the element (e.g. "paused-dbg-resume-button"). */ async clickPausedDebuggerOverlayButton(id) { const pauseOverlay = this._getPausedDebuggerOverlay(); @@ -519,7 +519,7 @@ class HighlighterTestActor extends protocol.Actor { * Get a representation of the NodeTabbingOrderHighlighters created by the * TabbingOrderHighlighter of a given targetActor. * - * @returns {Array<String>} An array which will contain as many entry as they are + * @returns {Array<string>} An array which will contain as many entry as they are * NodeTabbingOrderHighlighters displayed. * Each item will be of the form `nodename[#id]: index`. * For example: @@ -598,10 +598,10 @@ class HighlighterTestFront extends protocol.FrontClassWithSpec( /** * Get the value of an attribute on one of the highlighter's node. * - * @param {String} nodeID The Id of the node in the highlighter. - * @param {String} name The name of the attribute. - * @param {Object} highlighter Optional custom highlighter to target - * @return {String} value + * @param {string} nodeID The Id of the node in the highlighter. + * @param {string} name The name of the attribute. + * @param {object} highlighter Optional custom highlighter to target + * @return {string} value */ getHighlighterNodeAttribute(nodeID, name, highlighter) { return this.getHighlighterAttribute( @@ -621,10 +621,10 @@ class HighlighterTestFront extends protocol.FrontClassWithSpec( /** * Get the computed style of a property on one of the highlighter's node. * - * @param {String} nodeID The Id of the node in the highlighter. - * @param {String} property The name of the property. - * @param {Object} highlighter Optional custom highlighter to target - * @return {String} value + * @param {string} nodeID The Id of the node in the highlighter. + * @param {string} property The name of the property. + * @param {object} highlighter Optional custom highlighter to target + * @return {string} value */ getHighlighterComputedStyle(nodeID, property, highlighter) { return super.getHighlighterComputedStyle( @@ -702,8 +702,8 @@ class HighlighterTestFront extends protocol.FrontClassWithSpec( * Check that the box-model highlighter is currently highlighting the node matching the * given selector. * - * @param {String} selector - * @return {Boolean} + * @param {string} selector + * @return {boolean} */ async assertHighlightedNode(selector) { const rect = await this.getNodeRect(selector); @@ -715,9 +715,9 @@ class HighlighterTestFront extends protocol.FrontClassWithSpec( * be found at a given index within the list of childNodes of a parent element matching * the given selector. * - * @param {String} parentSelector - * @param {Number} childNodeIndex - * @return {Boolean} + * @param {string} parentSelector + * @param {number} childNodeIndex + * @return {boolean} */ async assertHighlightedTextNode(parentSelector, childNodeIndex) { const rect = await this.getTextNodeRect(parentSelector, childNodeIndex); @@ -727,8 +727,8 @@ class HighlighterTestFront extends protocol.FrontClassWithSpec( /** * Check that the box-model highlighter is currently highlighting the given rect. * - * @param {Object} rect - * @return {Boolean} + * @param {object} rect + * @return {boolean} */ async isNodeRectHighlighted({ left, top, width, height }) { const { visible, border } = await this.getBoxModelStatus(); @@ -838,7 +838,7 @@ class HighlighterTestFront extends protocol.FrontClassWithSpec( * Get the coordinates of the rectangle that is defined by the 4 guides displayed * in the toolbox box-model highlighter. * - * @return {Object} Null if at least one guide is hidden. Otherwise an object + * @return {object} Null if at least one guide is hidden. Otherwise an object * with p1, p2, p3, p4 properties being {x, y} objects. */ async getGuidesRectangle() { @@ -868,9 +868,9 @@ class HighlighterTestFront extends protocol.FrontClassWithSpec( * Get the "d" attribute value for one of the box-model highlighter's region * <path> elements, and parse it to a list of points. * - * @param {String} region The box model region name. + * @param {string} region The box model region name. * @param {Front} highlighter The front of the highlighter. - * @return {Object} The object returned has the following form: + * @return {object} The object returned has the following form: * - d {String} the d attribute value * - points {Array} an array of all the polygons defined by the path. Each box * is itself an Array of points, themselves being [x,y] coordinates arrays. @@ -913,7 +913,7 @@ protocol.registerFront(HighlighterTestFront); * * @param {Array} point [x,y] coordinates * @param {Array} polygon An array of [x,y] points - * @return {Boolean} + * @return {boolean} */ function isInside(point, polygon) { if (polygon.length === 0) { diff --git a/devtools/client/shared/test/shared-head.js b/devtools/client/shared/test/shared-head.js @@ -486,7 +486,7 @@ if (isMochitest) { * Spawn an instance of the highlighter test actor for the given toolbox * * @param {Toolbox} toolbox - * @param {Object} options + * @param {object} options * @param {Function} options.target: Optional target to get the highlighterTestFront for. * If not provided, the top level target will be used. * @returns {HighlighterTestFront} @@ -544,8 +544,8 @@ function waitForAllTargetsToBeAttached(targetCommand) { /** * Add a new test tab in the browser and load the given url. * - * @param {String} url The url to be loaded in the new tab - * @param {Object} options Object with various optional fields: + * @param {string} url The url to be loaded in the new tab + * @param {object} options Object with various optional fields: * - {Boolean} background If true, open the tab in background * - {ChromeWindow} window Firefox top level window we should use to open the tab * - {Number} userContextId The userContextId of the tab. @@ -591,7 +591,7 @@ async function addTab(url, options = {}) { /** * Remove the given tab. * - * @param {Object} tab The tab to be removed. + * @param {object} tab The tab to be removed. * @return Promise<undefined> resolved when the tab is successfully removed. */ async function removeTab(tab) { @@ -626,7 +626,7 @@ async function reloadBrowser({ * Also wait for the toolbox to attach to the new target, if we navigated * to a new process. * - * @param {String} url The url to be loaded in the current tab. + * @param {string} url The url to be loaded in the current tab. * @param {JSON} options Optional dictionary object with the following keys: * - {XULBrowser} browser * The browser element which should navigate. Defaults to the selected @@ -1033,7 +1033,7 @@ async function createAndAttachTargetForTab(tab) { * Open the inspector in a tab with given URL. * * @param {string} url The URL to open. - * @param {String} hostType Optional hostType, as defined in Toolbox.HostType + * @param {string} hostType Optional hostType, as defined in Toolbox.HostType * @return A promise that is resolved once the tab and inspector have loaded * with an object: { tab, toolbox, inspector, highlighterTestFront }. */ @@ -1053,7 +1053,7 @@ function getActiveInspector() { * Simulate a key event from an electron key shortcut string: * https://github.com/electron/electron/blob/master/docs/api/accelerator.md * - * @param {String} key + * @param {string} key * @param {DOMWindow} target * Optional window where to fire the key event */ @@ -1088,7 +1088,7 @@ function waitForTick() { * This shouldn't be used in the tests, but is useful when writing new tests or * debugging existing tests in order to introduce delays in the test steps * - * @param {Number} ms + * @param {number} ms * The time to wait * @return A promise that resolves when the time is passed */ @@ -1187,13 +1187,13 @@ async function waitForTimeout( /** * Wait for eventName on target to be delivered a number of times. * - * @param {Object} target + * @param {object} target * An observable object that either supports on/off or * addEventListener/removeEventListener - * @param {String} eventName - * @param {Number} numTimes + * @param {string} eventName + * @param {number} numTimes * Number of deliveries to wait for. - * @param {Boolean} useCapture + * @param {boolean} useCapture * Optional, for addEventListener/removeEventListener * @return A promise that resolves when the event has been handled */ @@ -1233,12 +1233,12 @@ function waitForNEvents(target, eventName, numTimes, useCapture = false) { /** * Wait for DOM change on target. * - * @param {Object} target + * @param {object} target * The Node on which to observe DOM mutations. - * @param {String} selector + * @param {string} selector * Given a selector to watch whether the expected element is changed * on target. - * @param {Number} expectedLength + * @param {number} expectedLength * Optional, default set to 1 * There may be more than one element match an array match the selector, * give an expected length to wait for more elements. @@ -1268,11 +1268,11 @@ function waitForDOM(target, selector, expectedLength = 1) { /** * Wait for eventName on target. * - * @param {Object} target + * @param {object} target * An observable object that either supports on/off or * addEventListener/removeEventListener - * @param {String} eventName - * @param {Boolean} useCapture + * @param {string} eventName + * @param {boolean} useCapture * Optional, for addEventListener/removeEventListener * @return A promise that resolves when the event has been handled */ @@ -1287,7 +1287,7 @@ function once(target, eventName, useCapture = false) { * separate directory. * The script will be loaded synchronously and in the test's scope. * - * @param {String} filePath The file path, relative to the current directory. + * @param {string} filePath The file path, relative to the current directory. * Examples: * - "helper_attributes_test_runner.js" */ @@ -1300,8 +1300,8 @@ function loadHelperScript(filePath) { * Open the toolbox in a given tab. * * @param {XULNode} tab The tab the toolbox should be opened in. - * @param {String} toolId Optional. The ID of the tool to be selected. - * @param {String} hostType Optional. The type of toolbox host to be used. + * @param {string} toolId Optional. The ID of the tool to be selected. + * @param {string} hostType Optional. The type of toolbox host to be used. * @return {Promise} Resolves with the toolbox, when it has been opened. */ async function openToolboxForTab(tab, toolId, hostType) { @@ -1330,9 +1330,9 @@ async function openToolboxForTab(tab, toolId, hostType) { /** * Add a new tab and open the toolbox in it. * - * @param {String} url The URL for the tab to be opened. - * @param {String} toolId Optional. The ID of the tool to be selected. - * @param {String} hostType Optional. The type of toolbox host to be used. + * @param {string} url The URL for the tab to be opened. + * @param {string} toolId Optional. The ID of the tool to be selected. + * @param {string} hostType Optional. The type of toolbox host to be used. * @return {Promise} Resolves when the tab has been added, loaded and the * toolbox has been opened. Resolves to the toolbox. */ @@ -1472,7 +1472,7 @@ function waitForClipboardPromise(setup, expected) { * pushPrefEnv that returns a promise resolving when the preferences have been * updated. * - * @param {String} preferenceName + * @param {string} preferenceName * The name of the preference to updated * @param {} value * The preference value, type can vary @@ -1665,8 +1665,8 @@ let allDownloads = []; * Returns a Promise that resolves when a new file (e.g. screenshot, JSON, …) is available * in the download folder. * - * @param {Object} [options] - * @param {Boolean} options.isWindowPrivate: Set to true if the window from which the file + * @param {object} [options] + * @param {boolean} options.isWindowPrivate: Set to true if the window from which the file * is downloaded is a private window. This will ensure that we check that the * file appears in the private window, not the non-private one (See Bug 1783373) */ @@ -1836,11 +1836,11 @@ function waitUntilState(store, predicate) { * If the action is async and defines a `status` property, this helper will wait * for the status to reach either "error" or "done". * - * @param {Object} store + * @param {object} store * Redux store where the action should be dispatched. - * @param {String} actionType + * @param {string} actionType * The actionType to wait for. - * @param {Number} repeat + * @param {number} repeat * Optional, number of time the action is expected to be dispatched. * Defaults to 1 * @return {Promise} @@ -1875,7 +1875,7 @@ function waitForDispatch(store, actionType, repeat = 1) { * @param {BrowsingContext|XULBrowser} browsingContext * The topmost browsing context under which we should search for the * browsing context. - * @param {Array<String>} selectors + * @param {Array<string>} selectors * Array of CSS selectors that form a path to a specific nested frame. * @return {BrowsingContext} The nested browsing context. */ @@ -1909,7 +1909,7 @@ async function getBrowsingContextInFrames(browsingContext, selectors) { * Synthesize a mouse event on an element, after ensuring that it is visible * in the viewport. * - * @param {String|Array} selector: The node selector to get the node target for the event. + * @param {string | Array} selector: The node selector to get the node target for the event. * To target an element in a specific iframe, pass an array of CSS selectors * (e.g. ["iframe", ".el-in-iframe"]) * @param {number} x @@ -1948,7 +1948,7 @@ async function safeSynthesizeMouseEventInContentPage( * Synthesize a mouse event at the center of an element, after ensuring that it is visible * in the viewport. * - * @param {String|Array} selector: The node selector to get the node target for the event. + * @param {string | Array} selector: The node selector to get the node target for the event. * To target an element in a specific iframe, pass an array of CSS selectors * (e.g. ["iframe", ".el-in-iframe"]) * @param {object} options: Options that will be passed to BrowserTestUtils.synthesizeMouse @@ -1983,7 +1983,7 @@ async function safeSynthesizeMouseEventAtCenterInContentPage( * Scroll into view an element in the content page matching the passed selector * * @param {BrowsingContext} browsingContext: The browsing context the element lives in. - * @param {String} selector: The node selector to get the node to scroll into view + * @param {string} selector: The node selector to get the node to scroll into view * @returns {Promise} */ function scrollContentPageNodeIntoView(browsingContext, selector) { @@ -2001,7 +2001,7 @@ function scrollContentPageNodeIntoView(browsingContext, selector) { /** * Change the zoom level of the selected page. * - * @param {Number} zoomLevel + * @param {number} zoomLevel */ function setContentPageZoomLevel(zoomLevel) { gBrowser.selectedBrowser.fullZoom = zoomLevel; @@ -2010,8 +2010,8 @@ function setContentPageZoomLevel(zoomLevel) { /** * Wait for the next DOCUMENT_EVENT dom-complete resource on a top-level target * - * @param {Object} commands - * @return {Promise<Object>} + * @param {object} commands + * @return {Promise<object>} * Return a promise which resolves once we fully settle the resource listener. * You should await for its resolution before doing the action which may fire * your resource. @@ -2375,7 +2375,7 @@ function getClientCssProperties() { /** * Helper method to stop a Service Worker promptly. * - * @param {String} workerUrl + * @param {string} workerUrl * Absolute Worker URL to stop. */ async function stopServiceWorker(workerUrl) { @@ -2441,7 +2441,7 @@ async function stopServiceWorker(workerUrl) { /** * Helper method to stop and unregister a Service Worker promptly. * - * @param {String} workerUrl + * @param {string} workerUrl * Absolute Worker URL to unregister. */ async function unregisterServiceWorker(workerUrl) { @@ -2541,9 +2541,9 @@ async function toggleJsTracer(toolbox) { * Retrieve the context menu element corresponding to the provided id, for the * provided netmonitor instance. * - * @param {Object} monitor + * @param {object} monitor * The network monitor object - * @param {String} id + * @param {string} id * The id of the context menu item */ function getNetmonitorContextMenuItem(monitor, id) { @@ -2555,9 +2555,9 @@ function getNetmonitorContextMenuItem(monitor, id) { * Selects and clicks the context menu item of the netmonitor, it should * also wait for the popup to close. * - * @param {Object} monitor + * @param {object} monitor * The network monitor object - * @param {String} id + * @param {string} id * The id of the context menu item */ async function selectNetmonitorContextMenuItem(monitor, id) { @@ -2591,7 +2591,7 @@ async function _maybeOpenAncestorMenu(menuItem) { * which contains a given string. * * @param {Toolbox} toolbox - * @param {String} query + * @param {string} query * @return {Array<DOMElement>} */ async function findConsoleMessages(toolbox, query) { @@ -2609,8 +2609,8 @@ async function findConsoleMessages(toolbox, query) { * Returns the DOM Element in the Web Console for the link to the JS Source. * * @param {Toolbox} toolbox - * @param {String} messageText - * @param {String} linkText + * @param {string} messageText + * @param {string} linkText * @return {DOMElement} */ async function waitForConsoleMessageLink(toolbox, messageText, linkText) { @@ -2637,10 +2637,10 @@ async function waitForConsoleMessageLink(toolbox, messageText, linkText) { * @param {Toolbox} toolbox * @param {DOMElement} frameLinkNode * @param {Object] options - * @param {String|null} options.url - * @param {Number|null} options.line - * @param {Number|null} options.column - * @param {String|undefined} logPointExpr + * @param {string | null} options.url + * @param {number | null} options.line + * @param {number | null} options.column + * @param {string | undefined} logPointExpr */ async function clickAndAssertFrameLinkNode( toolbox, diff --git a/devtools/client/shared/test/telemetry-test-helpers.js b/devtools/client/shared/test/telemetry-test-helpers.js @@ -52,13 +52,13 @@ class TelemetryHelpers { /** * Check the value of a given telemetry histogram. * - * @param {String} histId + * @param {string} histId * Histogram id - * @param {String} key + * @param {string} key * Keyed histogram key - * @param {Array|Number} expected + * @param {Array | number} expected * Expected value - * @param {String} checkType + * @param {string} checkType * "array" (default) - Check that an array matches the histogram data. * "hasentries" - For non-enumerated linear and exponential * histograms. This checks for at least one entry. @@ -129,7 +129,7 @@ class TelemetryHelpers { * from your result checking code in telemetry tests. It logs checkTelemetry * calls for all changed telemetry values. * - * @param {String} prefix + * @param {string} prefix * Optionally limits results to histogram ids starting with prefix. */ generateTelemetryTests(prefix = "") { @@ -211,12 +211,12 @@ class TelemetryHelpers { * @param {HistogramSnapshot} snapshot * A snapshot of a telemetry chart obtained via getSnapshotForHistograms or * similar. - * @param {String} key + * @param {string} key * Only used for keyed histograms. This is the key we are interested in * checking. - * @param {String} histId + * @param {string} histId * The histogram ID. - * @param {Array|String|Boolean} actual + * @param {Array | string | boolean} actual * The value of the histogram data. */ displayDataFromHistogramSnapshot(snapshot, key, histId, actual) { diff --git a/devtools/client/shared/theme.js b/devtools/client/shared/theme.js @@ -40,9 +40,9 @@ const getThemePrefValue = (exports.getThemePrefValue = () => { * for the current toolbox theme, or null if the variable does not exist, or it's not a * registered property, or doesn't have a <color> syntax. * - * @param {String} variableName + * @param {string} variableName * @param {Window} win: The window into which the variable should be defined. - * @returns {String|null} + * @returns {string | null} */ const getCssVariableColor = (exports.getCssVariableColor = ( variableName, diff --git a/devtools/client/shared/view-source.js b/devtools/client/shared/view-source.js @@ -12,7 +12,7 @@ * Firefox View Source is the fallback. * * @param {Toolbox} toolbox - * @param {string|Object} stylesheetResourceOrGeneratedURL + * @param {string | object} stylesheetResourceOrGeneratedURL * @param {number} generatedLine * @param {number} generatedColumn * diff --git a/devtools/client/shared/widgets/CubicBezierWidget.js b/devtools/client/shared/widgets/CubicBezierWidget.js @@ -534,7 +534,7 @@ CubicBezierWidget.prototype = { /** * Set new coordinates for the control point and redraw the curve * - * @param {String} value A string value. E.g. "linear", + * @param {string} value A string value. E.g. "linear", * "cubic-bezier(0,0,1,1)" */ set cssCubicBezierValue(value) { @@ -868,7 +868,7 @@ TimingFunctionPreviewWidget.prototype = { * the supplied function value is different from the previous one. If the * supplied function is invalid, the preview will stop. * - * @param {String} value + * @param {string} value */ preview(value) { // Don't restart the preview animation if the value is the same @@ -886,7 +886,7 @@ TimingFunctionPreviewWidget.prototype = { /** * Re-start the preview animation from the beginning. * - * @param {String} timingFunction The value for the timing-function. + * @param {string} timingFunction The value for the timing-function. */ restartAnimation(timingFunction) { // Cancel the previous animation if there was any. @@ -966,7 +966,7 @@ function distance(x1, y1, x2, y2) { * If it is, return the coordinates as an array. * Otherwise, return undefined. * - * @param {String} value + * @param {string} value * @return {Array} of coordinates, or undefined */ function parseTimingFunction(value) { @@ -1014,7 +1014,7 @@ exports.parseTimingFunction = parseTimingFunction; /** * Removes a class from a node and adds it to another. * - * @param {String} className the class to swap + * @param {string} className the class to swap * @param {DOMNode} from the node to remove the class from * @param {DOMNode} to the node to add the class to */ @@ -1033,7 +1033,7 @@ function swapClassName(className, from, to) { * * @param {Array} c1 first coordinate array to compare * @param {Array} c2 second coordinate array to compare - * @return {Boolean} + * @return {boolean} */ function coordsAreEqual(c1, c2) { return c1.reduce((prev, curr, index) => prev && curr === c2[index], true); diff --git a/devtools/client/shared/widgets/FilterWidget.js b/devtools/client/shared/widgets/FilterWidget.js @@ -110,7 +110,7 @@ const SPECIAL_VALUES = new Set(["none", "unset", "initial", "inherit"]); * * @param {Node} el * The widget container. - * @param {String} value + * @param {string} value * CSS filter value */ function CSSFilterEditorWidget(el, value = "") { @@ -784,9 +784,9 @@ CSSFilterEditorWidget.prototype = { /** * returns definition of a filter as defined in filterList * - * @param {String} name + * @param {string} name * filter name (e.g. blur) - * @return {Object} + * @return {object} * filter's definition */ _definition(name) { @@ -797,7 +797,7 @@ CSSFilterEditorWidget.prototype = { /** * Parses the CSS value specified, updating widget's filters * - * @param {String} cssValue + * @param {string} cssValue * css value to be parsed */ setCssValue(cssValue) { @@ -833,14 +833,14 @@ CSSFilterEditorWidget.prototype = { /** * Creates a new [name] filter record with value * - * @param {String} name + * @param {string} name * filter name (e.g. blur) - * @param {String} value + * @param {string} value * value of the filter (e.g. 30px, 20%) * If this is |null|, then a default value may be supplied. - * @return {Number} + * @return {number} * The index of the new filter in the current list of filters - * @param {Boolean} + * @param {boolean} * By default, adding a new filter emits an "updated" event, but if * you're calling add in a loop and wait to emit a single event after * the loop yourself, set this parameter to true. @@ -897,9 +897,9 @@ CSSFilterEditorWidget.prototype = { /** * returns value + unit of the specified filter * - * @param {Number} index + * @param {number} index * filter index - * @return {String} + * @return {string} * css value of filter */ getValueAt(index) { @@ -929,7 +929,7 @@ CSSFilterEditorWidget.prototype = { /** * Generates CSS filter value for filters of the widget * - * @return {String} + * @return {string} * css value of filters */ getCssValue() { @@ -947,7 +947,7 @@ CSSFilterEditorWidget.prototype = { /** * Updates specified filter's value * - * @param {Number} index + * @param {number} index * The index of the filter in the current list of filters * @param {number/string} value * value to set, string for string-typed filters @@ -1004,9 +1004,9 @@ function fixFloat(a, number) { * * @param {Array} array * the array to swap elements of - * @param {Number} a + * @param {number} a * index of first element - * @param {Number} b + * @param {number} b * index of second element */ function swapArrayIndices(array, a, b) { @@ -1016,7 +1016,7 @@ function swapArrayIndices(array, a, b) { /** * Tokenizes a CSS Filter value and returns an array of {name, value} pairs. * - * @param {String} css CSS Filter value to be parsed + * @param {string} css CSS Filter value to be parsed * @return {Array} An array of {name, value} pairs */ function tokenizeFilterValue(css) { @@ -1087,11 +1087,11 @@ function tokenizeFilterValue(css) { * the numbers may be floats (containing dots) * It's assumed that the value given to this function is a valid number * - * @param {String} string + * @param {string} string * The string containing numbers - * @param {Number} index + * @param {number} index * The index to look for neighbours for - * @return {Object} + * @return {object} * returns null if no number is found * value: The number found * start: The number's starting index diff --git a/devtools/client/shared/widgets/LinearEasingFunctionWidget.js b/devtools/client/shared/widgets/LinearEasingFunctionWidget.js @@ -407,8 +407,8 @@ class LinearEasingFunctionWidget extends EventEmitter { /** * Create a control points for the svg line. * - * @param {Number} cx - * @param {Number} cy + * @param {number} cx + * @param {number} cy * @returns {SVGCircleElement} */ #createSvgControlPointEl(cx, cy) { @@ -429,7 +429,7 @@ class LinearEasingFunctionWidget extends EventEmitter { * Return the position in the SVG viewbox from mouse event. * * @param {MouseEvent} event - * @returns {Object} An object with x and y properties + * @returns {object} An object with x and y properties */ #getPositionInSvgFromEvent(event) { const position = this.#svgEl.createSVGPoint(); @@ -447,7 +447,7 @@ class LinearEasingFunctionWidget extends EventEmitter { * Provide the value of the linear() function we want to visualize here. * Called from the tooltip with the value of the function in the rule view. * - * @param {String} linearFunctionValue: e.g. `linear(0, 0.5, 1)`. + * @param {string} linearFunctionValue: e.g. `linear(0, 0.5, 1)`. */ setCssLinearValue(linearFunctionValue) { if (!linearFunctionValue) { @@ -466,7 +466,7 @@ class LinearEasingFunctionWidget extends EventEmitter { * Return the value of the linear() function based on the state of the graph. * The resulting value is what we emit in the "updated" event. * - * @return {String|null} e.g. `linear(0 0%, 0.5 50%, 1 100%)`. + * @return {string | null} e.g. `linear(0 0%, 0.5 50%, 1 100%)`. */ getCssLinearValue() { if (!this.#functionPoints) { @@ -596,8 +596,8 @@ class TimingFunctionPreviewWidget { * Parse a linear() string to collect the different values. * https://drafts.csswg.org/css-easing-2/#the-linear-easing-function * - * @param {String} value - * @return {Array<Object>|undefined} returns undefined if value isn't a valid linear() value. + * @param {string} value + * @return {Array<object> | undefined} returns undefined if value isn't a valid linear() value. * the items of the array are objects with {Number} `input` * and {Number} `output` properties. */ @@ -730,11 +730,11 @@ function parseTimingFunction(value) { /** * Linearly interpolate between 2 numbers. * - * @param {Number} x - * @param {Number} y - * @param {Number} a + * @param {number} x + * @param {number} y + * @param {number} a * A value of 0 returns x, and 1 returns y - * @return {Number} + * @return {number} */ function lerp(x, y, a) { return x * (1 - a) + y * a; @@ -744,10 +744,10 @@ function lerp(x, y, a) { * Clamp value in a range, meaning the result won't be smaller than min * and no bigger than max. * - * @param {Number} min - * @param {Number} max - * @param {Number} value - * @returns {Number} + * @param {number} min + * @param {number} max + * @param {number} value + * @returns {number} */ function clamp(min, max, value) { return Math.max(min, Math.min(value, max)); diff --git a/devtools/client/shared/widgets/ShapesInContextEditor.js b/devtools/client/shared/widgets/ShapesInContextEditor.js @@ -92,7 +92,7 @@ class ShapesInContextEditor { * * @param {NodeFront} node * The NodeFront of the element with a shape to highlight. - * @param {Object} options + * @param {object} options * Object used for passing options to the shapes highlighter. */ async toggle(node, options, prop) { @@ -127,7 +127,7 @@ class ShapesInContextEditor { * * @param {NodeFront} node * The NodeFront of the element with a shape to highlight. - * @param {Object} options + * @param {object} options * Object used for passing options to the shapes highlighter. */ async show(node, options) { @@ -196,7 +196,7 @@ class ShapesInContextEditor { * Handle events emitted by the highlighter. * Find any callback assigned to the event type and call it with the given data object. * - * @param {Object} data + * @param {object} data * The data object sent in the event. */ onHighlighterEvent(data) { @@ -223,7 +223,7 @@ class ShapesInContextEditor { /** * Handler for "shape-change" event from the shapes highlighter. * - * @param {Object} data + * @param {object} data * Data associated with the "shape-change" event. * Contains: * - {String} value: the new shape value. @@ -240,7 +240,7 @@ class ShapesInContextEditor { * highlighter. Marks/unmarks the corresponding coordinate node in the shape value * from the Rule view. * - * @param {Object} data + * @param {object} data * Data associated with the "shape-hover" event. * Contains: * - {String|null} point: coordinate to highlight or null if nothing to highlight @@ -305,7 +305,7 @@ class ShapesInContextEditor { /** * Preview a shape value on the element without committing the changes to the Rule view. * - * @param {String} value + * @param {string} value * The shape value to set the current property to */ preview(value) { @@ -324,7 +324,7 @@ class ShapesInContextEditor { * part of the DOM of the TextPropertyEditor. Called in a debounced manner; see * constructor. * - * @param {String} value + * @param {string} value * The shape value for the current property */ commit(value) { diff --git a/devtools/client/shared/widgets/Spectrum.js b/devtools/client/shared/widgets/Spectrum.js @@ -213,7 +213,7 @@ class Spectrum { * Map current rgb to the closest color available in the database by * calculating the delta-E between each available color and the current rgb * - * @return {String} + * @return {string} * Color name or closest color name */ get colorName() { @@ -280,7 +280,7 @@ class Spectrum { * Creates and initializes a slider element, attaches it to its parent container * based on the slider type and returns it * - * @param {String} sliderType + * @param {string} sliderType * The type of the slider (i.e. alpha or hue) * @param {Function} onSliderMove * The function to tie the slider to on input @@ -309,7 +309,7 @@ class Spectrum { * Updates the contrast label with appropriate content (i.e. large text indicator * if the contrast is calculated for large text, or a base label otherwise) * - * @param {Boolean} isLargeText + * @param {boolean} isLargeText * True if contrast is calculated for large text. */ updateContrastLabel(isLargeText) { @@ -347,9 +347,9 @@ class Spectrum { * * @param {DOMNode} el * Contrast value element to update. - * @param {String} score + * @param {string} score * Contrast ratio score. - * @param {Number} value + * @param {number} value * Contrast ratio value. * @param {Array} backgroundColor * RGBA color array for the background color to show in the swatch. @@ -671,11 +671,11 @@ function draggable(element, dragHelper, onmove) { * Calculates the contrast ratio for a DOM node's computed style against * a given background. * - * @param {Object} computedStyle + * @param {object} computedStyle * The computed style for which we want to calculate the contrast ratio. - * @param {Object} backgroundColor + * @param {object} backgroundColor * Object with one or more of the following properties: value, min, max - * @return {Object} + * @return {object} * An object that may contain one or more of the following fields: error, * isLargeText, value, score for contrast. */ diff --git a/devtools/client/shared/widgets/TableWidget.js b/devtools/client/shared/widgets/TableWidget.js @@ -181,7 +181,7 @@ TableWidget.prototype = { /** * Is a row currently selected? * - * @return {Boolean} + * @return {boolean} * true or false. */ get hasSelectedRow() { @@ -524,9 +524,9 @@ TableWidget.prototype = { /** * Reset the editable fields engine if the currently edited row is removed. * - * @param {String} event + * @param {string} event * The event name "event-removed." - * @param {Object} row + * @param {object} row * The values from the removed row. */ onRowRemoved(row) { @@ -648,7 +648,7 @@ TableWidget.prototype = { /** * Make table fields editable. * - * @param {String|Array} editableColumns + * @param {string | Array} editableColumns * An array or comma separated list of editable column names. */ makeFieldsEditable(editableColumns) { @@ -714,9 +714,9 @@ TableWidget.prototype = { /** * Sets the localization ID of the description to be shown when the table is empty. * - * @param {String} l10nID + * @param {string} l10nID * The ID of the localization string. - * @param {String} learnMoreURL + * @param {string} learnMoreURL * A URL referring to a website with further information related to * the data shown in the table widget. */ @@ -815,11 +815,11 @@ TableWidget.prototype = { * Creates the columns in the table. Without calling this method, data cannot * be inserted into the table unless `initialColumns` was supplied. * - * @param {Object} columns + * @param {object} columns * A key value pair representing the columns of the table. Where the * key represents the id of the column and the value is the displayed * label in the header of the column. - * @param {String} sortOn + * @param {string} sortOn * The id of the column on which the table will be initially sorted on. * @param {Array} hiddenColumns * Ids of all the columns that are hidden by default. @@ -1069,7 +1069,7 @@ TableWidget.prototype = { /** * Filters the table based on a specific value * - * @param {String} value: The filter value + * @param {string} value: The filter value * @param {Array} ignoreProps: Props to ignore while filtering */ filterItems(value, ignoreProps = []) { @@ -1138,7 +1138,7 @@ module.exports.TableWidget = TableWidget; * The table object to which the column belongs. * @param {string} id * Id of the column. - * @param {String} header + * @param {string} header * The displayed string on the column's header. */ function Column(table, id, header) { @@ -1235,7 +1235,7 @@ Column.prototype = { /** * Set the private state of the column (visibility in the UI). * - * @param {Boolean} state + * @param {boolean} state * Private (true or false) */ set private(state) { @@ -1829,7 +1829,7 @@ Cell.prototype = { /** * Simple widget to make nodes matching a CSS selector editable. * - * @param {Object} options + * @param {object} options * An object with the following format: * { * // The node that will act as a container for the editor e.g. a diff --git a/devtools/client/shared/widgets/TreeWidget.js b/devtools/client/shared/widgets/TreeWidget.js @@ -13,7 +13,7 @@ const { KeyCodes } = require("resource://devtools/client/shared/keycodes.js"); * * @param {Node} node * The container element for the tree widget. - * @param {Object} options + * @param {object} options * - emptyText {string}: text to display when no entries in the table. * - defaultType {string}: The default type of the tree items. For ex. * 'js' @@ -54,7 +54,7 @@ TreeWidget.prototype = { /** * Select any node in the tree. * - * @param {array} ids + * @param {Array} ids * An array of ids leading upto the selected item */ set selectedItem(ids) { @@ -88,7 +88,7 @@ TreeWidget.prototype = { /** * Gets the selected item in the tree. * - * @return {array} + * @return {Array} * An array of ids leading upto the selected item */ get selectedItem() { @@ -98,7 +98,7 @@ TreeWidget.prototype = { /** * Returns if the passed array corresponds to the selected item in the tree. * - * @return {array} + * @return {Array} * An array of ids leading upto the requested item */ isSelected(item) { @@ -158,7 +158,7 @@ TreeWidget.prototype = { /** * Select any node in the tree. * - * @param {array} id + * @param {Array} id * An array of ids leading upto the selected item */ selectItem(id) { @@ -286,7 +286,7 @@ TreeWidget.prototype = { /** * Check if an item exists. * - * @param {array} item + * @param {Array} item * The array of ids leading up to the item. */ exists(item) { @@ -305,7 +305,7 @@ TreeWidget.prototype = { /** * Removes the specified item and all of its child items from the tree. * - * @param {array} item + * @param {Array} item * The array of ids leading up to the item. */ remove(item) { @@ -492,7 +492,7 @@ TreeItem.prototype = { * Adds the item to the sub tree contained by this node. The item to be * inserted can be a direct child of this node, or further down the tree. * - * @param {array} items + * @param {Array} items * Same as TreeWidget.add method's argument * @param {string} defaultType * The default type of the item to be used when items[i].type is null @@ -567,7 +567,7 @@ TreeItem.prototype = { * recursive method goes on till we have reached the end of the branch or the * current item is to be removed. * - * @param {array} items + * @param {Array} items * Ids of items leading up to the item to be removed. */ remove(items = []) { @@ -590,7 +590,7 @@ TreeItem.prototype = { * If this item is to be selected, then selected and expands the item. * Otherwise, if a child item is to be selected, just expands this item. * - * @param {array} items + * @param {Array} items * Ids of items leading up to the item to be selected. */ setSelectedItem(items) { diff --git a/devtools/client/shared/widgets/tooltip/HTMLTooltip.js b/devtools/client/shared/widgets/tooltip/HTMLTooltip.js @@ -83,13 +83,13 @@ const EXTRA_HEIGHT = { * @param {DOMRect} viewportRect * Bounding rectangle for the viewport. top/left can be different from 0 if some * space should not be used by tooltips (for instance OS toolbars, taskbars etc.). - * @param {Number} height + * @param {number} height * Preferred height for the tooltip. - * @param {String} pos + * @param {string} pos * Preferred position for the tooltip. Possible values: "top" or "bottom". - * @param {Number} offset + * @param {number} offset * Offset between the top of the anchor and the tooltip. - * @return {Object} + * @return {object} * - {Number} top: the top offset for the tooltip. * - {Number} height: the height to use for the tooltip container. * - {String} computedPosition: Can differ from the preferred position depending @@ -158,20 +158,20 @@ const calculateVerticalPosition = ( * @param {DOMRect} windowRect * Bounding rectangle for the window. Used to determine which direction * doorhangers should hang. - * @param {Number} width + * @param {number} width * Preferred width for the tooltip. - * @param {String} type + * @param {string} type * The tooltip type (e.g. "arrow"). - * @param {Number} offset + * @param {number} offset * Horizontal offset in pixels. - * @param {Number} borderRadius + * @param {number} borderRadius * The border radius of the panel. This is added to ARROW_OFFSET to * calculate the distance from the edge of the tooltip to the start * of arrow. It is separate from ARROW_OFFSET since it will vary by * platform. - * @param {Boolean} isRtl + * @param {boolean} isRtl * If the anchor is in RTL, the tooltip should be aligned to the right. - * @return {Object} + * @return {object} * - {Number} left: the left offset for the tooltip. * - {Number} width: the width to use for the tooltip container. * - {Number} arrowLeft: the left offset to use for the arrow element. @@ -314,7 +314,7 @@ const getRelativeRect = function (node, relativeTo) { * * @param {Document} toolboxDoc * The toolbox document to attach the HTMLTooltip popup. - * @param {Object} + * @param {object} * - {String} className * A string separated list of classes to add to the tooltip container * element. @@ -427,7 +427,7 @@ HTMLTooltip.prototype = { * Set the preferred width/height of the panel content. * The panel content is set by appending content to `this.panel`. * - * @param {Object} + * @param {object} * - {Number} width: preferred width for the tooltip container. If not specified * the tooltip container will be measured before being displayed, and the * measured width will be used as the preferred width. @@ -480,16 +480,16 @@ HTMLTooltip.prototype = { * * @param {Element} anchor * The reference element with which the tooltip should be aligned - * @param {Object} options + * @param {object} options * Optional settings for positioning the tooltip. - * @param {String} options.position + * @param {string} options.position * Optional, possible values: top|bottom * If layout permits, the tooltip will be displayed on top/bottom * of the anchor. If omitted, the tooltip will be displayed where * more space is available. - * @param {Number} options.x + * @param {number} options.x * Optional, horizontal offset between the anchor and the tooltip. - * @param {Number} options.y + * @param {number} options.y * Optional, vertical offset between the anchor and the tooltip. */ async show(anchor, options) { @@ -691,13 +691,13 @@ HTMLTooltip.prototype = { * window in screen coordinates. Otherwise it will be the same as the * viewport rect. * - * @param {Object} anchorRect + * @param {object} anchorRect * DOMRect-like object of the target anchor element. * We need to pass this to detect the case when the anchor is not in * the current window (because, the center of the window is in * a different window to the anchor). * - * @return {Object} An object with the following properties + * @return {object} An object with the following properties * viewportRect {Object} DOMRect-like object with the Number * properties: top, right, bottom, left, width, height * representing the viewport rect. @@ -840,7 +840,7 @@ HTMLTooltip.prototype = { /** * Check if the tooltip is currently displayed. * - * @return {Boolean} true if the tooltip is visible + * @return {boolean} true if the tooltip is visible */ isVisible() { return this.container.classList.contains("tooltip-visible"); diff --git a/devtools/client/shared/widgets/tooltip/ImageTooltipHelper.js b/devtools/client/shared/widgets/tooltip/ImageTooltipHelper.js @@ -26,7 +26,7 @@ const LABEL_HEIGHT = 20; * the load. * * @param {Document} doc the document element to use to create the image object - * @param {String} imageUrl the url of the image to measure + * @param {string} imageUrl the url of the image to measure * @return {Promise} returns a promise that will resolve after the iamge load: * - {Number} naturalWidth natural width of the loaded image * - {Number} naturalHeight natural height of the loaded image @@ -51,9 +51,9 @@ function getImageDimensions(doc, imageUrl) { * The tooltip instance on which the image preview content should be set * @param {Document} doc * A document element to create the HTML elements needed for the tooltip - * @param {String} imageUrl + * @param {string} imageUrl * Absolute URL of the image to display in the tooltip - * @param {Object} options + * @param {object} options * - {Number} naturalWidth mandatory, width of the image to display * - {Number} naturalHeight mandatory, height of the image to display * - {Number} maxDim optional, max width/height of the preview diff --git a/devtools/client/shared/widgets/tooltip/SwatchBasedEditorTooltip.js b/devtools/client/shared/widgets/tooltip/SwatchBasedEditorTooltip.js @@ -78,7 +78,7 @@ class SwatchBasedEditorTooltip { /** * Reports if the tooltip is currently shown * - * @return {Boolean} True if the tooltip is displayed. + * @return {boolean} True if the tooltip is displayed. */ isVisible() { return this.tooltip.isVisible(); @@ -87,7 +87,7 @@ class SwatchBasedEditorTooltip { /** * Reports if the tooltip is currently editing the targeted value * - * @return {Boolean} True if the tooltip is editing. + * @return {boolean} True if the tooltip is editing. */ isEditing() { return this.isVisible(); diff --git a/devtools/client/shared/widgets/tooltip/TooltipToggle.js b/devtools/client/shared/widgets/tooltip/TooltipToggle.js @@ -55,7 +55,7 @@ TooltipToggle.prototype = { * The function can also return a promise that will resolve to one of * the values listed above. * If omitted, the tooltip will be shown everytime. - * @param {Object} options + * @param {object} options Set of optional arguments: * - {Number} toggleDelay * An optional delay (in ms) that will be observed before showing diff --git a/devtools/client/shared/widgets/tooltip/VariableTooltipHelper.js b/devtools/client/shared/widgets/tooltip/VariableTooltipHelper.js @@ -28,26 +28,26 @@ loader.lazyGetter(this, "L10N_COMPUTED_VALUE", function () { * The tooltip instance on which the text preview content should be set. * @param {Document} doc * A document element to create the HTML elements needed for the tooltip. - * @param {Object} params - * @param {String} params.computed + * @param {object} params + * @param {string} params.computed * The computed value for the variable. - * @param {Object} params.outputParserOptions + * @param {object} params.outputParserOptions * Options to pass to the OutputParser. At the moment, this is the same object that * we use in the Rules view, so we have the same output in the variable tooltip * than in the Rules view. - * @param {Object} params.registeredProperty + * @param {object} params.registeredProperty * Contains the registered property data, if the variable was registered (@property or CSS.registerProperty) - * @param {String} params.registeredProperty.syntax + * @param {string} params.registeredProperty.syntax * The registered property `syntax` value - * @param {Boolean} params.registeredProperty.inherits + * @param {boolean} params.registeredProperty.inherits * The registered property `inherits` value - * @param {String} params.registeredProperty.initialValue + * @param {string} params.registeredProperty.initialValue * The registered property `initial-value` - * @param {String} params.startingStyle + * @param {string} params.startingStyle * The text for @starting-style value (e.g. `red`) - * @param {String} params.topSectionText + * @param {string} params.topSectionText * Text to display in the top section of tooltip (e.g. "blue" or "--x is not defined"). - * @param {String} params.variableName + * @param {string} params.variableName * The name of the variable we're showing the tooltip for */ function setVariableTooltip( @@ -174,7 +174,7 @@ function setVariableTooltip( * * @param {Document} doc: A document that will be used to create elements * @param {Element} el: The element into which the rendered value will be appended - * @param {String} value: The value we want to append + * @param {string} value: The value we want to append * @param {Function} parse: An optional function that will be called with `value`, and whose * result will be appended to `el`. If not passed, `value` will be appended * as is in `el`, as a text node (if it's not empty). diff --git a/devtools/client/shared/widgets/tooltip/css-compatibility-tooltip-helper.js b/devtools/client/shared/widgets/tooltip/css-compatibility-tooltip-helper.js @@ -144,7 +144,7 @@ class CssCompatibilityTooltipHelper { /** * Fill the tooltip with inactive CSS information. * - * @param {Object} data + * @param {object} data * An object in the following format: { * // Type of compatibility issue * type: <string>, @@ -192,7 +192,7 @@ class CssCompatibilityTooltipHelper { * </p> * </div> * - * @param {Object} data + * @param {object} data * An object in the following format: { * // Type of compatibility issue * type: <string>, diff --git a/devtools/client/shared/widgets/tooltip/css-query-container-tooltip-helper.js b/devtools/client/shared/widgets/tooltip/css-query-container-tooltip-helper.js @@ -28,7 +28,7 @@ class CssQueryContainerTooltipHelper { /** * Get the template of the tooltip. * - * @param {Object} data + * @param {object} data * @param {NodeFront} data.node * @param {string} data.containerType * @param {string} data.inlineSize diff --git a/devtools/client/shared/widgets/tooltip/css-selector-warnings-tooltip-helper.js b/devtools/client/shared/widgets/tooltip/css-selector-warnings-tooltip-helper.js @@ -26,7 +26,7 @@ class CssSelectorWarningsTooltipHelper { /** * Get the template of the tooltip. * - * @param {Array<String>} data: Array of selector warning kind returned by + * @param {Array<string>} data: Array of selector warning kind returned by * CSSRule#getSelectorWarnings * @param {HTMLTooltip} tooltip * The tooltip we are targetting. diff --git a/devtools/client/shared/widgets/tooltip/inactive-css-tooltip-helper.js b/devtools/client/shared/widgets/tooltip/inactive-css-tooltip-helper.js @@ -44,7 +44,7 @@ class InactiveCssTooltipHelper { * </p> * </div> * - * @param {Object} data + * @param {object} data * An object in the following format: { * fixId: "inactive-css-not-grid-item-fix-2", // Fluent id containing the * // Inactive CSS fix. diff --git a/devtools/client/storage/test/head.js b/devtools/client/storage/test/head.js @@ -152,7 +152,7 @@ async function openTabAndSetupStorage(url, options = {}) { * Open a toolbox with the storage panel opened by default * for a given Web Extension. * - * @param {String} addonId + * @param {string} addonId * The ID of the Web Extension to debug. */ var openStoragePanelForAddon = async function (addonId) { @@ -481,7 +481,7 @@ function matchVariablesViewProperty(prop, rule) { /** * Click selects a row in the table. * - * @param {[String]} ids + * @param {[string]} ids * The array id of the item in the tree */ async function selectTreeItem(ids) { @@ -511,7 +511,7 @@ async function selectTreeItem(ids) { /** * Click selects a row in the table. * - * @param {String} id + * @param {string} id * The id of the row in the table widget */ async function selectTableItem(id) { @@ -540,10 +540,10 @@ async function selectTableItem(id) { /** * Wait for eventName on target. * - * @param {Object} target An observable object that either supports on/off or + * @param {object} target An observable object that either supports on/off or * addEventListener/removeEventListener - * @param {String} eventName - * @param {Boolean} useCapture Optional, for addEventListener/removeEventListener + * @param {string} eventName + * @param {boolean} useCapture Optional, for addEventListener/removeEventListener * @return A promise that resolves when the event has been handled */ function once(target, eventName, useCapture = false) { @@ -574,12 +574,12 @@ function once(target, eventName, useCapture = false) { /** * Get values for a row. * - * @param {String} id + * @param {string} id * The uniqueId of the given row. - * @param {Boolean} includeHidden + * @param {boolean} includeHidden * Include hidden columns. * - * @return {Object} + * @return {object} * An object of column names to values for the given row. */ function getRowValues(id, includeHidden = false) { @@ -598,7 +598,7 @@ function getRowValues(id, includeHidden = false) { /** * Get the row element for a given id * - * @param {String} id + * @param {string} id * The uniqueId of the given row. * @returns {Element|null} */ @@ -613,12 +613,12 @@ function getRowItem(id) { /** * Get cells for a row. * - * @param {String} id + * @param {string} id * The uniqueId of the given row. - * @param {Boolean} includeHidden + * @param {boolean} includeHidden * Include hidden columns. * - * @return {Object} + * @return {object} * An object of column names to cells for the given row. */ function getRowCells(id, includeHidden = false) { @@ -686,12 +686,12 @@ function showAvailableIds() { /** * Get a cell value. * - * @param {String} id + * @param {string} id * The uniqueId of the row. - * @param {String} column + * @param {string} column * The id of the column * - * @yield {String} + * @yield {string} * The cell value. */ function getCellValue(id, column) { @@ -719,16 +719,16 @@ function getCellValue(id, column) { /** * Edit a cell value. The cell is assumed to be in edit mode, see startCellEdit. * - * @param {String} id + * @param {string} id * The uniqueId of the row. - * @param {String} column + * @param {string} column * The id of the column - * @param {String} newValue + * @param {string} newValue * Replacement value. - * @param {Boolean} validate + * @param {boolean} validate * Validate result? Default true. * - * @yield {String} + * @yield {string} * The uniqueId of the changed row. */ async function editCell(id, column, newValue, validate = true) { @@ -743,11 +743,11 @@ async function editCell(id, column, newValue, validate = true) { /** * Begin edit mode for a cell. * - * @param {String} id + * @param {string} id * The uniqueId of the row. - * @param {String} column + * @param {string} column * The id of the column - * @param {Boolean} selectText + * @param {boolean} selectText * Select text? Default true. */ function startCellEdit(id, column, selectText = true) { @@ -770,11 +770,11 @@ function startCellEdit(id, column, selectText = true) { /** * Check a cell value. * - * @param {String} id + * @param {string} id * The uniqueId of the row. - * @param {String} column + * @param {string} column * The id of the column - * @param {String} expected + * @param {string} expected * Expected value. */ function checkCell(id, column, expected) { @@ -788,9 +788,9 @@ function checkCell(id, column, expected) { /** * Check that a cell is not in edit mode. * - * @param {String} id + * @param {string} id * The uniqueId of the row. - * @param {String} column + * @param {string} column * The id of the column */ function checkCellUneditable(id, column) { @@ -810,9 +810,9 @@ function checkCellUneditable(id, column) { /** * Show or hide a column. * - * @param {String} id + * @param {string} id * The uniqueId of the given column. - * @param {Boolean} state + * @param {boolean} state * true = show, false = hide */ function showColumn(id, state) { @@ -824,7 +824,7 @@ function showColumn(id, state) { /** * Toggle sort direction on a column by clicking on the column header. * - * @param {String} id + * @param {string} id * The uniqueId of the given column. */ function clickColumnHeader(id) { @@ -838,7 +838,7 @@ function clickColumnHeader(id) { /** * Show or hide all columns. * - * @param {Boolean} state + * @param {boolean} state * true = show, false = hide */ function showAllColumns(state) { @@ -853,11 +853,11 @@ function showAllColumns(state) { * Type a string in the currently selected editor and then wait for the row to * be updated. * - * @param {String} str + * @param {string} str * The string to type. - * @param {String} terminator + * @param {string} terminator * The terminating key e.g. KEY_Enter or KEY_Tab - * @param {Boolean} validate + * @param {boolean} validate * Validate result? Default true. */ async function typeWithTerminator(str, terminator, validate = true) { @@ -898,11 +898,11 @@ function getCurrentEditorValue() { /** * Press a key x times. * - * @param {String} key + * @param {string} key * The key to press e.g. VK_RETURN or VK_TAB - * @param {Number} x + * @param {number} x * The number of times to press the key. - * @param {Object} modifiers + * @param {object} modifiers * The event modifier e.g. {shiftKey: true} */ function PressKeyXTimes(key, x, modifiers = {}) { @@ -952,7 +952,7 @@ async function checkState(state) { * * @param {HTMLDocument} doc document with active element in question * @param {DOMNode} container element tested on focus containment - * @return {Boolean} + * @return {boolean} */ function containsFocus(doc, container) { let elm = doc.activeElement; @@ -1012,7 +1012,7 @@ function sidebarToggleVisible() { /** * Check whether the variables view in the sidebar contains a tree. * - * @param {Boolean} state + * @param {boolean} state * Should a tree be visible? */ function sidebarParseTreeVisible(state) { @@ -1102,7 +1102,7 @@ async function scroll() { * * @param {Document} doc * @param {Array} path - * @param {Boolean} isExpected + * @param {boolean} isExpected */ function checkTree(doc, path, isExpected = true) { const doesExist = isInTree(doc, path); @@ -1128,7 +1128,7 @@ function isInTree(doc, path) { * * @param {Document} doc * @param {Array} path - * @returns {String} + * @returns {string} */ function getTreeNodeLabel(doc, path) { const treeId = JSON.stringify(path); @@ -1139,7 +1139,7 @@ function getTreeNodeLabel(doc, path) { /** * Checks that the pair <name, value> is displayed at the data table * - * @param {String} name + * @param {string} name * @param {any} value */ function checkStorageData(name, value) { @@ -1158,7 +1158,7 @@ async function waitForStorageData(name, value) { /** * Returns whether the pair <name, value> is displayed at the data table * - * @param {String} name + * @param {string} name * @param {any} value */ function hasStorageData(name, value) { @@ -1168,9 +1168,9 @@ function hasStorageData(name, value) { /** * Returns an URL of a page that uses the document-builder to generate its content * - * @param {String} domain - * @param {String} html - * @param {String} protocol + * @param {string} domain + * @param {string} html + * @param {string} protocol */ function buildURLWithContent(domain, html, protocol = "https") { return `${protocol}://${domain}/document-builder.sjs?html=${encodeURI(html)}`; @@ -1179,8 +1179,8 @@ function buildURLWithContent(domain, html, protocol = "https") { /** * Asserts that the given cookie holds the provided value in the data table * - * @param {String} name - * @param {String} value + * @param {string} name + * @param {string} value */ function checkCookieData(name, value) { ok( @@ -1192,8 +1192,8 @@ function checkCookieData(name, value) { /** * Returns whether the given cookie holds the provided value in the data table * - * @param {String} name - * @param {String} value + * @param {string} name + * @param {string} value */ function hasCookieData(name, value) { const rows = Array.from(gUI.table.items); diff --git a/devtools/client/storage/ui.js b/devtools/client/storage/ui.js @@ -130,7 +130,7 @@ const HEADERS_NON_L10N_STRINGS = { * * @param {Window} panelWin * Window of the toolbox panel to populate UI in. - * @param {Object} commands + * @param {object} commands * The commands object with all interfaces defined from devtools/shared/commands/ */ class StorageUI { @@ -736,9 +736,9 @@ class StorageUI { * Get a string for a column name automatically choosing whether or not the * string should be localized. * - * @param {String} type + * @param {string} type * The storage type. - * @param {String} name + * @param {string} name * The field name that may need to be localized. */ _getColumnName(type, name) { @@ -912,7 +912,7 @@ class StorageUI { * The type of storage. Ex. "cookies" * @param {string} host * Hostname - * @param {array} names + * @param {Array} names * Names of particular store objects. Empty if all are requested * @param {Constant} reason * See REASON constant at top of file. @@ -1241,7 +1241,7 @@ class StorageUI { * Select handler for the storage tree. Fetches details of the selected item * from the storage details and populates the storage tree. * - * @param {array} item + * @param {Array} item * An array of ids which represent the location of the selected item in * the storage tree */ @@ -1369,7 +1369,7 @@ class StorageUI { /** * Populates or updates the rows in the storage table. * - * @param {array[object]} data + * @param {Array[object]} data * Array of objects to be populated in the storage table * @param {Constant} reason * See REASON constant at top of file. diff --git a/devtools/client/styleeditor/StyleEditorUI.sys.mjs b/devtools/client/styleeditor/StyleEditorUI.sys.mjs @@ -122,7 +122,7 @@ export class StyleEditorUI extends EventEmitter { /** * @param {Toolbox} toolbox - * @param {Object} commands Object defined from devtools/shared/commands to interact with the devtools backend + * @param {object} commands Object defined from devtools/shared/commands to interact with the devtools backend * @param {Document} panelDoc * Document of the toolbox panel to populate UI in. * @param {CssProperties} A css properties database. @@ -175,8 +175,8 @@ export class StyleEditorUI extends EventEmitter { /** * Initiates the style editor ui creation, and start to track TargetCommand updates. * - * @params {Object} options - * @params {Object} options.stylesheetToSelect + * @params {object} options + * @params {object} options.stylesheetToSelect * @params {StyleSheetResource} options.stylesheetToSelect.stylesheet * @params {Integer} options.stylesheetToSelect.line * @params {Integer} options.stylesheetToSelect.column @@ -685,7 +685,7 @@ export class StyleEditorUI extends EventEmitter { * * @param {StyleSheet} styleSheet * Object representing stylesheet - * @return {Number} + * @return {number} * 1-based Integer representing the index of the current stylesheet * among all stylesheets of its type (inline, constructed or user-created). * Defaults to 0 when non-applicable (e.g. for stylesheet with href) @@ -1254,9 +1254,9 @@ export class StyleEditorUI extends EventEmitter { * * @param {StyleSheetResource} stylesheet * Stylesheet to select or href of stylesheet to select - * @param {Number} line + * @param {number} line * Line to which the caret should be moved (zero-indexed). - * @param {Number} col + * @param {number} col * Column to which the caret should be moved (zero-indexed). * @return {Promise} * Promise that will resolve when the editor is selected and ready @@ -1483,9 +1483,9 @@ export class StyleEditorUI extends EventEmitter { * * @param {HTMLElement} element * The element corresponding to the media sidebar condition - * @param {String} ruleConditionText + * @param {string} ruleConditionText * The rule conditionText - * @param {String} type + * @param {string} type * The type of the at-rule (e.g. "media", "layer", "supports", …) */ #setConditionContents(element, ruleConditionText, type) { @@ -1740,8 +1740,8 @@ export class StyleEditorUI extends EventEmitter { * Set the active item's summary element. * * @param DOMElement summary - * @param {Object} options - * @param {String=} options.reason: Indicates why the summary was selected. It's set to + * @param {object} options + * @param {string=} options.reason: Indicates why the summary was selected. It's set to * "filter-auto" when the summary was automatically selected as the result * of the previous active summary being filtered out. */ @@ -1774,8 +1774,8 @@ export class StyleEditorUI extends EventEmitter { * Show summary's associated editor * * @param DOMElement summary - * @param {Object} options - * @param {String=} options.reason: Indicates why the summary was selected. It's set to + * @param {object} options + * @param {string=} options.reason: Indicates why the summary was selected. It's set to * "filter-auto" when the summary was automatically selected as the result * of the previous active summary being filtered out. */ @@ -1824,8 +1824,8 @@ export class StyleEditorUI extends EventEmitter { * Make the passed element visible or not, depending if it matches the current filter * * @param {Element} summary - * @param {Object} options - * @param {Boolean} options.triggerOnFilterStateChange: Set to false to avoid calling + * @param {object} options + * @param {boolean} options.triggerOnFilterStateChange: Set to false to avoid calling * #onFilterStateChange directly here. This can be useful when this * function is called for every item of the list, like in `setFilter`. */ diff --git a/devtools/client/styleeditor/StyleSheetEditor.sys.mjs b/devtools/client/styleeditor/StyleSheetEditor.sys.mjs @@ -84,7 +84,7 @@ const STYLE_SHEET_UPDATE_CAUSED_BY_STYLE_EDITOR = "styleeditor"; * The STYLESHEET resource which is received from resource command. * @param {DOMWindow} win * panel window for style editor - * @param {Number} styleSheetFriendlyIndex + * @param {number} styleSheetFriendlyIndex * Optional Integer representing the index of the current stylesheet * among all stylesheets of its type (inline, constructed or user-created) */ @@ -310,7 +310,7 @@ StyleSheetEditor.prototype = { * * This will set |this._state.text| to the prettified text if needed. * - * @param {Boolean} force: Set to true to prettify the stylesheet, no matter if it's + * @param {boolean} force: Set to true to prettify the stylesheet, no matter if it's * minified or not. */ _prettifySourceTextIfNeeded(force = false) { @@ -364,8 +364,8 @@ StyleSheetEditor.prototype = { /** * Set the cursor at the given line and column location within the code editor. * - * @param {Number} line - * @param {Number} column + * @param {number} line + * @param {number} column */ setCursor(line, column) { line = line || 0; @@ -381,10 +381,10 @@ StyleSheetEditor.prototype = { * to translate the cursor position to the correct location in the prettified source. * If no mappings exist, return the original cursor position unchanged. * - * @param {Number} line + * @param {number} line * @param {Numer} column * - * @return {Object} + * @return {object} */ translateCursorPosition(line, column) { if (Array.isArray(this._mappings)) { @@ -418,7 +418,7 @@ StyleSheetEditor.prototype = { /** * Called when the stylesheet text changes. * - * @param {Object} update: The stylesheet resource update packet. + * @param {object} update: The stylesheet resource update packet. */ async onStyleApplied(update) { const updateIsFromSyleSheetEditor = @@ -461,7 +461,7 @@ StyleSheetEditor.prototype = { * Handles changes to the list of at-rules (@media, @layer, @container, …) in the stylesheet. * Emits 'at-rules-changed' if the list has changed. * - * @param {array} rules + * @param {Array} rules * Array of MediaRuleFronts for new media rules of sheet. */ onAtRulesChanged(rules) { @@ -590,8 +590,8 @@ StyleSheetEditor.prototype = { /** * Event handler for when the editor is shown. * - * @param {Object} options - * @param {String} options.reason: Indicates why the editor is shown + * @param {object} options + * @param {string} options.reason: Indicates why the editor is shown */ onShow(options = {}) { if (this.sourceEditor) { @@ -696,8 +696,8 @@ StyleSheetEditor.prototype = { * Highlight nodes matching the selector found at coordinates x,y in the * editor, if any. * - * @param {Number} x - * @param {Number} y + * @param {number} x + * @param {number} y */ async _highlightSelectorAt(x, y) { const pos = this.sourceEditor.getPositionFromCoords({ left: x, top: y }); @@ -930,7 +930,7 @@ StyleSheetEditor.prototype = { * Retrieve custom key bindings objects as expected by Editor. * Editor action names are not displayed to the user. * - * @return {array} key binding objects for the source editor + * @return {Array} key binding objects for the source editor */ _getKeyBindings() { const saveStyleSheetKeybind = Editor.accel( @@ -1013,9 +1013,9 @@ function findLinkedFilePath(uri, origUri, file) { * * @param {nsIFile} file * file for that resource on disk - * @param {array} branch + * @param {Array} branch * path parts for branch to chop off file path. - * @return {array} + * @return {Array} * array of path parts */ function findProjectPath(file, branch) { diff --git a/devtools/client/styleeditor/original-source.js b/devtools/client/styleeditor/original-source.js @@ -9,9 +9,9 @@ * editor. An "original" source is one that is mentioned in a source * map. * - * @param {String} url + * @param {string} url * The URL of the original source. - * @param {String} sourceID + * @param {string} sourceID * The source ID of the original source, as used by the source * map service. * @param {SourceMapLoader} sourceMapLoader @@ -68,9 +68,9 @@ OriginalSource.prototype = { * * @param {StyleSheetResource} relatedSheet * The generated style sheet's resource - * @param {Number} line + * @param {number} line * Line number. - * @param {Number} column + * @param {number} column * Column number. * @return {Location} * The original location, an object with at least diff --git a/devtools/client/styleeditor/test/browser_styleeditor_at_rules_sidebar.js b/devtools/client/styleeditor/test/browser_styleeditor_at_rules_sidebar.js @@ -278,16 +278,16 @@ async function testMediaRuleAdded(ui, editor) { /** * Run assertion on given rule * - * @param {Object} options + * @param {object} options * @param {StyleEditorUI} options.ui * @param {StyleSheetEditor} options.editor: The editor the rule is displayed in * @param {Element} options.rule: The rule element in the media sidebar - * @param {String} options.conditionText: at-rule condition text (for @media, @container, @support) - * @param {Boolean} options.matches: Whether or not the document matches the rule - * @param {String} options.layerName: Optional name of the @layer - * @param {String} options.propertyName: Name of the @property if type is "property" - * @param {Number} options.line: Line of the rule - * @param {String} options.type: The type of the rule (container, layer, media, support, property ). + * @param {string} options.conditionText: at-rule condition text (for @media, @container, @support) + * @param {boolean} options.matches: Whether or not the document matches the rule + * @param {string} options.layerName: Optional name of the @layer + * @param {string} options.propertyName: Name of the @property if type is "property" + * @param {number} options.line: Line of the rule + * @param {string} options.type: The type of the rule (container, layer, media, support, property ). * Defaults to "media". */ async function testRule({ diff --git a/devtools/client/styleeditor/test/browser_styleeditor_autocomplete.js b/devtools/client/styleeditor/test/browser_styleeditor_autocomplete.js @@ -245,7 +245,7 @@ function checkState(testCases, index, sourceEditor, popup) { * Returns a list of all property names and a map of property name vs possible * CSS values provided by the Gecko engine. * - * @return {Object} An object with following properties: + * @return {object} An object with following properties: * - CSSProperties {Array} Array of string containing all the possible * CSS property names. * - CSSValues {Object|Map} A map where key is the property name and diff --git a/devtools/client/styleeditor/test/browser_styleeditor_highlight-selector.js b/devtools/client/styleeditor/test/browser_styleeditor_highlight-selector.js @@ -172,7 +172,7 @@ function querySelectorCodeMirror(stylesheetEditor, selector) { * The last CSS selector of the array is for the node in its frame doc. * The before-last CSS selector is for the frame in its parent frame, etc... * Ex: ["frame.first-frame", ..., "frame.last-frame", ".target-node"] - * @returns {Object} with left/top/width/height properties representing the node bounds + * @returns {object} with left/top/width/height properties representing the node bounds */ async function getElementNodeRectWithinTarget(selectors) { // Retrieve the browsing context in which the element is diff --git a/devtools/client/styleeditor/test/head.js b/devtools/client/styleeditor/test/head.js @@ -22,7 +22,7 @@ const TEST_HOST = "mochi.test:8888"; /** * Add a new test tab in the browser and load the given url. * - * @param {String} url The url to be loaded in the new tab + * @param {string} url The url to be loaded in the new tab * @param {Window} win The window to add the tab to (default: current window). * @return a promise that resolves to the tab object when the url is loaded */ @@ -107,11 +107,11 @@ var openStyleEditorForURL = async function (url, win) { * Send an async message to the frame script and get back the requested * computed style property. * - * @param {String} selector + * @param {string} selector * The selector used to obtain the element. - * @param {String} pseudo + * @param {string} pseudo * pseudo id to query, or null. - * @param {String} name + * @param {string} name * name of the property. */ var getComputedStyleProperty = async function (args) { @@ -132,7 +132,7 @@ var getComputedStyleProperty = async function (args) { * * @param {StyleEditorUI} ui * Current StyleEditorUI on which at-rules-list-changed events should be fired. - * @param {Number} delay + * @param {number} delay */ function waitForManyEvents(ui, delay) { return new Promise(resolve => { @@ -205,7 +205,7 @@ function getContextMenuElement(panel) { * Assert the number of rules displayed in UI * * @param {StyleSheetEditor} editor - * @param {Number} expected + * @param {number} expected */ async function assertRuleCount(editor, expected) { // The rule count is displayed via l10n.setArgs which only applies the value diff --git a/devtools/client/webconsole/actions/autocomplete.js b/devtools/client/webconsole/actions/autocomplete.js @@ -26,11 +26,11 @@ loader.lazyRequireGetter( /** * Update the data used for the autocomplete popup in the console input (JsTerm). * - * @param {Boolean} force: True to force a call to the server (as opposed to retrieve + * @param {boolean} force: True to force a call to the server (as opposed to retrieve * from the cache). - * @param {Array<String>} getterPath: Array representing the getter access (i.e. + * @param {Array<string>} getterPath: Array representing the getter access (i.e. * `a.b.c.d.` is described as ['a', 'b', 'c', 'd'] ). - * @param {Array<String>} expressionVars: Array of the variables defined in the expression. + * @param {Array<string>} expressionVars: Array of the variables defined in the expression. */ function autocompleteUpdate(force, getterPath, expressionVars) { return async ({ dispatch, getState, webConsoleUI, hud }) => { @@ -96,11 +96,11 @@ function autocompleteUpdate(force, getterPath, expressionVars) { /** * Combine or replace authorizedEvaluations with the newly authorized getter path, if any. * - * @param {Array<Array<String>>} authorizedEvaluations Existing authorized evaluations (may + * @param {Array<Array<string>>} authorizedEvaluations Existing authorized evaluations (may * be updated in place) - * @param {Array<String>} getterPath The new getter path - * @param {{[String]: String}} mappedVars Map of original to generated variable names. - * @returns {Array<Array<String>>} The updated authorized evaluations (the original array, + * @param {Array<string>} getterPath The new getter path + * @param {{[string]: string}} mappedVars Map of original to generated variable names. + * @returns {Array<Array<string>>} The updated authorized evaluations (the original array, * if it was updated in place) */ function updateAuthorizedEvaluations( @@ -148,10 +148,10 @@ function updateAuthorizedEvaluations( /** * Apply source mapping to the autocomplete input. * - * @param {String} rawInput The input to map. - * @param {{[String]: String}} mappedVars Map of original to generated variable names. + * @param {string} rawInput The input to map. + * @param {{[string]: string}} mappedVars Map of original to generated variable names. * @param {WebConsole} hud A reference to the webconsole hud. - * @returns {String} The source-mapped expression to autocomplete. + * @returns {string} The source-mapped expression to autocomplete. */ async function getMappedInput(rawInput, mappedVars, hud) { if (!mappedVars || !Object.keys(mappedVars).length) { @@ -207,7 +207,7 @@ function autocompleteClear() { * Called when the autocompletion data should be retrieved from the cache (i.e. * client-side). * - * @param {String} input: The input used to filter the cached data. + * @param {string} input: The input used to filter the cached data. */ function autoCompleteDataRetrieveFromCache(input) { return { @@ -224,7 +224,7 @@ function generateRequestId() { /** * Action that fetch autocompletion data from the server. * - * @param {Object} Object of the following shape: + * @param {object} Object of the following shape: * - {String} input: the expression that we want to complete. * - {String} frameActorId: The id of the frame we want to autocomplete in. * - {Boolean} force: true if the user forced an autocompletion (with Ctrl+Space). @@ -311,11 +311,11 @@ function autocompleteDataFetch({ * Replace generated variable names in an unsafe getter path with their original * counterparts. * - * @param {Array<String>} getterPath Array of properties leading up to and including the + * @param {Array<string>} getterPath Array of properties leading up to and including the * unsafe getter. - * @param {String} originalExpression The expression that was evaluated, before mapping. - * @param {{[String]: String}} mappedVars Map of original to generated variable names. - * @returns {Array<String>} An updated getter path containing original variables. + * @param {string} originalExpression The expression that was evaluated, before mapping. + * @param {{[string]: string}} mappedVars Map of original to generated variable names. + * @returns {Array<string>} An updated getter path containing original variables. */ function unmapGetterPath(getterPath, originalExpression, mappedVars) { // We know that the original expression is a sequence of property accesses, that only @@ -343,7 +343,7 @@ function unmapGetterPath(getterPath, originalExpression, mappedVars) { /** * Called when we receive the autocompletion data from the server. * - * @param {Object} Object of the following shape: + * @param {object} Object of the following shape: * - {Integer} id: The autocompletion request id. This will be used in the reducer * to check that we update the state with the last request results. * - {String} input: the expression that we want to complete. diff --git a/devtools/client/webconsole/actions/input.js b/devtools/client/webconsole/actions/input.js @@ -160,7 +160,7 @@ function evaluateExpression(expression, from = "input") { * The JavaScript evaluation response handler. * * @private - * @param {Object} response + * @param {object} response * The message received from the server. */ function onExpressionEvaluated(response) { @@ -399,8 +399,8 @@ function setInputValue(value) { /** * Request an eager evaluation from the server. * - * @param {String} expression: The expression to evaluate. - * @param {Boolean} force: When true, will request an eager evaluation again, even if + * @param {string} expression: The expression to evaluate. + * @param {boolean} force: When true, will request an eager evaluation again, even if * the expression is the same one than the one that was used in * the previous evaluation. */ diff --git a/devtools/client/webconsole/actions/ui.js b/devtools/client/webconsole/actions/ui.js @@ -180,8 +180,8 @@ function setEditorWidth(width) { * Dispatches a SHOW_OBJECT_IN_SIDEBAR action, with a grip property corresponding to the * {actor} parameter in the {messageId} message. * - * @param {String} actorID: Actor id of the object we want to place in the sidebar. - * @param {String} messageId: id of the message containing the {actor} parameter. + * @param {string} actorID: Actor id of the object we want to place in the sidebar. + * @param {string} messageId: id of the message containing the {actor} parameter. */ function showMessageObjectInSidebar(actorID, messageId) { return ({ dispatch, getState }) => { diff --git a/devtools/client/webconsole/components/Input/JSTerm.js b/devtools/client/webconsole/components/Input/JSTerm.js @@ -595,7 +595,7 @@ class JSTerm extends Component { /** * Do all the imperative work needed after a Redux store update. * - * @param {Object} nextProps: props passed from shouldComponentUpdate. + * @param {object} nextProps: props passed from shouldComponentUpdate. */ imperativeUpdate(nextProps) { if (!nextProps) { @@ -654,7 +654,7 @@ class JSTerm extends Component { /** * - * @param {Number|null} editorWidth: The width to set the node to. If null, removes any + * @param {number | null} editorWidth: The width to set the node to. If null, removes any * `width` property on node style. */ setEditorWidth(editorWidth) { @@ -911,7 +911,7 @@ class JSTerm extends Component { * Fired after a key is handled through a key map. * * @param {CodeMirror} cm: codeMirror instance - * @param {String} key: The key that was handled + * @param {string} key: The key that was handled */ _onEditorKeyHandled(cm, key) { // The autocloseBracket addon handle closing brackets keys when they're typed, but @@ -1071,7 +1071,7 @@ class JSTerm extends Component { * Takes the data returned by the server and update the autocomplete popup state (i.e. * its visibility and items). * - * @param {Object} data + * @param {object} data * The autocompletion data as returned by the webconsole actor's autocomplete * service. Should be of the following shape: * { @@ -1290,7 +1290,7 @@ class JSTerm extends Component { * current completion text. This is more than the current input + the completion text, * as there are special cases for element access and case-insensitive matches. * - * @return {Object}: An object of the following shape: + * @return {object}: An object of the following shape: * - {String} expression: The complete expression * - {String} completionText: the completion text only, which should be used * with the next property @@ -1475,7 +1475,7 @@ class JSTerm extends Component { * Calculates and returns the width of a single character of the input box. * This will be used in opening the popup at the correct offset. * - * @returns {Number|null}: Width off the "x" char, or null if the input does not exist. + * @returns {number | null}: Width off the "x" char, or null if the input does not exist. */ _getInputCharWidth() { return this.editor ? this.editor.defaultCharWidth() : null; diff --git a/devtools/client/webconsole/components/Output/LazyMessageList.js b/devtools/client/webconsole/components/Output/LazyMessageList.js @@ -194,7 +194,7 @@ class LazyMessageList extends Component { * @param Number deltaPx * The difference in pixels between where we want to be and * where we are. - * @return {Number} The new computed start index. + * @return {number} The new computed start index. */ #increaseStartIndex(startIndex, deltaPx) { for (let i = startIndex + 1; i < this.props.items.length; i++) { @@ -217,7 +217,7 @@ class LazyMessageList extends Component { * @param Number deltaPx * The difference in pixels between where we want to be and * where we are. - * @return {Number} The new computed start index. + * @return {number} The new computed start index. */ #decreaseStartIndex(startIndex, diff) { for (let i = startIndex - 1; i >= 0; i--) { diff --git a/devtools/client/webconsole/reducers/autocomplete.js b/devtools/client/webconsole/reducers/autocomplete.js @@ -108,9 +108,9 @@ function autocomplete(state = getDefaultState(), action) { /** * Retrieve from cache action reducer. * - * @param {Object} state - * @param {Object} action - * @returns {Object} new state. + * @param {object} state + * @param {object} action + * @returns {object} new state. */ function autoCompleteRetrieveFromCache(state, action) { const { input } = action; diff --git a/devtools/client/webconsole/reducers/messages.js b/devtools/client/webconsole/reducers/messages.js @@ -853,10 +853,10 @@ function setVisibleMessages({ * Returns the new current group id given the previous current group and the groupsById * state property. * - * @param {String} currentGroup: id of the current group + * @param {string} currentGroup: id of the current group * @param {Map} groupsById * @param {Array} ignoredIds: An array of ids which can't be the new current group. - * @returns {String|null} The new current group id, or null if there isn't one. + * @returns {string | null} The new current group id, or null if there isn't one. */ function getNewCurrentGroup(currentGroup, groupsById, ignoredIds = new Set()) { if (!currentGroup) { @@ -1112,7 +1112,7 @@ function getToplevelMessageCount(state) { * causes it to be hidden. * * @param {Message} message: The message to check - * @param {Object} option: An option object of the following shape: + * @param {object} option: An option object of the following shape: * - {MessageState} messagesState: The current messages state * - {FilterState} filtersState: The current filters state * - {PrefsState} prefsState: The current preferences state @@ -1125,7 +1125,7 @@ function getToplevelMessageCount(state) { * - {Boolean} hasMatchedAncestor: Set to true if message is part of a * group that has been set to visible * - * @return {Object} An object of the following form: + * @return {object} An object of the following form: * - visible {Boolean}: true if the message should be visible * - cause {String}: if visible is false, what causes the message to be hidden. */ @@ -1337,9 +1337,9 @@ function isGroupClosed(groupId, messagesUI) { /** * Returns true if the message shouldn't be hidden because of the network filter state. * - * @param {Object} message - The message to check the filter against. + * @param {object} message - The message to check the filter against. * @param {FilterState} filters - redux "filters" state. - * @returns {Boolean} + * @returns {boolean} */ function passNetworkFilter(message, filters) { // The message passes the filter if it is not a network message, @@ -1356,9 +1356,9 @@ function passNetworkFilter(message, filters) { /** * Returns true if the message shouldn't be hidden because of the xhr filter state. * - * @param {Object} message - The message to check the filter against. + * @param {object} message - The message to check the filter against. * @param {FilterState} filters - redux "filters" state. - * @returns {Boolean} + * @returns {boolean} */ function passXhrFilter(message, filters) { // The message passes the filter if it is not a network message, @@ -1375,9 +1375,9 @@ function passXhrFilter(message, filters) { /** * Returns true if the message shouldn't be hidden because of levels filter state. * - * @param {Object} message - The message to check the filter against. + * @param {object} message - The message to check the filter against. * @param {FilterState} filters - redux "filters" state. - * @returns {Boolean} + * @returns {boolean} */ function passLevelFilters(message, filters) { // The message passes the filter if it is not a console call, @@ -1393,9 +1393,9 @@ function passLevelFilters(message, filters) { /** * Returns true if the message shouldn't be hidden because of the CSS filter state. * - * @param {Object} message - The message to check the filter against. + * @param {object} message - The message to check the filter against. * @param {FilterState} filters - redux "filters" state. - * @returns {Boolean} + * @returns {boolean} */ function passCssFilters(message, filters) { // The message passes the filter if it is not a CSS message, @@ -1406,9 +1406,9 @@ function passCssFilters(message, filters) { /** * Returns true if the message shouldn't be hidden because of search filter state. * - * @param {Object} message - The message to check the filter against. + * @param {object} message - The message to check the filter against. * @param {FilterState} filters - redux "filters" state. - * @returns {Boolean} + * @returns {boolean} */ function passSearchFilters(message, filters) { const trimmed = (filters.text || "").trim(); @@ -1626,11 +1626,11 @@ function getDefaultFiltersCounter() { * Sort state.visibleMessages if needed. * * @param {MessageState} state - * @param {Boolean} sortWarningGroupMessage: set to true to sort warningGroup + * @param {boolean} sortWarningGroupMessage: set to true to sort warningGroup * messages. Default to false, as in some * situations we already take care of putting * the ids at the right position. - * @param {Boolean} timeStampSort: set to true to sort messages by their timestamps. + * @param {boolean} timeStampSort: set to true to sort messages by their timestamps. */ function maybeSortVisibleMessages( state, diff --git a/devtools/client/webconsole/test/browser/browser_jsterm_screenshot_command_clipboard.js b/devtools/client/webconsole/test/browser/browser_jsterm_screenshot_command_clipboard.js @@ -116,7 +116,7 @@ async function testFullpageClipboardScrollbar(hud) { * saying that the screenshot was copied to clipboard is rendered in the console. * * @param {WebConsole} hud - * @param {String} command + * @param {string} command */ function executeScreenshotClipboardCommand(hud, command) { return executeAndWaitForMessageByType( diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_console_trace_distinct.js b/devtools/client/webconsole/test/browser/browser_webconsole_console_trace_distinct.js @@ -65,7 +65,7 @@ function getFrames(hud) { * Given a stacktrace element, return an array of the frame names displayed in it. * * @param {HTMLElement} traceEl - * @returns {Array<String>} + * @returns {Array<string>} */ function getFramesTitleFromTrace(traceEl) { return Array.from(traceEl.querySelectorAll(".frame .title")).map( diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_console_trace_duplicates.js b/devtools/client/webconsole/test/browser/browser_webconsole_console_trace_duplicates.js @@ -96,9 +96,9 @@ add_task(async function testTraceMessagesNoRepeat() { /** * Check stack info returned by getStackInfo(). * - * @param {Object} stackInfo + * @param {object} stackInfo * A stackInfo object returned by getStackInfo(). - * @param {Object} expected + * @param {object} expected * An object in the same format as the expected stackInfo object. */ function checkStacktraceFrames(frames, expectedFrames) { diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_context_menu_copy_entire_message.js b/devtools/client/webconsole/test/browser/browser_webconsole_context_menu_copy_entire_message.js @@ -230,7 +230,7 @@ async function copyMessageContent(hud, messageEl) { * using the Selection API. * * @param {HTMLElement} el - * @returns {String} the text representation of the element. + * @returns {string} the text representation of the element. */ function getSelectionTextFromElement(el) { const doc = el.ownerDocument; diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_filter_groups.js b/devtools/client/webconsole/test/browser/browser_webconsole_filter_groups.js @@ -244,8 +244,8 @@ add_task(async function () { /** * * @param {WebConsole} hud - * @param {String} expected - * @param {String} assertionMessage + * @param {string} expected + * @param {string} assertionMessage */ function checkMessages(hud, expected, assertionMessage) { const expectedMessages = expected diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_requestStorageAccess_errors.js b/devtools/client/webconsole/test/browser/browser_webconsole_requestStorageAccess_errors.js @@ -21,7 +21,7 @@ registerCleanupFunction(function () { /** * Run document.requestStorageAccess in an iframe. * - * @param {Object} options - Request / iframe options. + * @param {object} options - Request / iframe options. * @param {boolean} [options.withUserActivation] - Whether the requesting iframe * should have user activation prior to calling rsA. * @param {string} [options.sandboxAttr] - Iframe sandbox attributes. diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_warning_group_enhanced_tracking_protection.js b/devtools/client/webconsole/test/browser/browser_webconsole_warning_group_enhanced_tracking_protection.js @@ -176,7 +176,7 @@ add_task(cleanUp); /** * Test that storage access blocked messages are grouped by emitting 2 messages. * - * @param {String} groupLabel: The warning group label that should be created. + * @param {string} groupLabel: The warning group label that should be created. * It should contain "<URL>". */ async function testStorageAccessBlockedGrouping(groupLabel) { diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_warning_group_multiples.js b/devtools/client/webconsole/test/browser/browser_webconsole_warning_group_multiples.js @@ -307,7 +307,7 @@ function emitStorageAccessBlockedMessage() { * Log a string from the content page. * * @param {WebConsole} hud - * @param {String} str + * @param {string} str */ function logString(hud, str) { const onMessage = waitForMessageByType(hud, str, ".console-api"); diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_warning_groups.js b/devtools/client/webconsole/test/browser/browser_webconsole_warning_groups.js @@ -279,7 +279,7 @@ function emitEnhancedTrackingProtectionMessage() { * Log a string from the content page. * * @param {WebConsole} hud - * @param {String} str + * @param {string} str */ function logString(hud, str) { const onMessage = waitForMessageByType(hud, str, ".console-api"); diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_warning_groups_filtering.js b/devtools/client/webconsole/test/browser/browser_webconsole_warning_groups_filtering.js @@ -324,7 +324,7 @@ function emitEnhancedTrackingProtectionMessage() { * ordering still works fine). * * @param {WebConsole} hud - * @param {String} str + * @param {string} str */ function logStrings(hud, str) { const onFirstMessage = waitForMessageByType(hud, `${str} #1`, ".console-api"); diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_warning_groups_toggle.js b/devtools/client/webconsole/test/browser/browser_webconsole_warning_groups_toggle.js @@ -257,7 +257,7 @@ function emitEnhancedTrackingProtectionMessage() { * Log a string from the content page. * * @param {WebConsole} hud - * @param {String} str + * @param {string} str */ function logString(hud, str) { const onMessage = waitForMessageByType(hud, str, ".console-api"); diff --git a/devtools/client/webconsole/test/browser/head.js b/devtools/client/webconsole/test/browser/head.js @@ -224,11 +224,11 @@ function waitForMessagesByType({ hud, messages }) { /** * Wait for a message with the provided text and showing the provided repeat count. * - * @param {Object} hud : the webconsole - * @param {String} text : text included in .message-body - * @param {String} typeSelector : A part of selector for the message, to + * @param {object} hud : the webconsole + * @param {string} text : text included in .message-body + * @param {string} typeSelector : A part of selector for the message, to * specify the message type. - * @param {Number} repeat : expected repeat count in .message-repeats + * @param {number} repeat : expected repeat count in .message-repeats */ function waitForRepeatedMessageByType(hud, text, typeSelector, repeat) { return waitFor(() => { @@ -252,9 +252,9 @@ function waitForRepeatedMessageByType(hud, text, typeSelector, repeat) { * Wait for a single message with given message type in the web console output, * resolving with the first message that matches the query once it is received. * - * @param {Object} hud : the webconsole - * @param {String} text : text included in .message-body - * @param {String} typeSelector : A part of selector for the message, to + * @param {object} hud : the webconsole + * @param {string} text : text included in .message-body + * @param {string} typeSelector : A part of selector for the message, to * specify the message type. * @return promise * A promise that is resolved to the message node @@ -270,7 +270,7 @@ async function waitForMessageByType(hud, text, typeSelector) { /** * Wait for the Source editor to be available. * - * @param {Object} panel + * @param {object} panel * @returns */ async function waitForSourceEditor(panel) { @@ -282,8 +282,8 @@ async function waitForSourceEditor(panel) { /** * Execute an input expression. * - * @param {Object} hud : The webconsole. - * @param {String} input : The input expression to execute. + * @param {object} hud : The webconsole. + * @param {string} input : The input expression to execute. */ function execute(hud, input) { return hud.ui.wrapper.dispatchEvaluateExpression(input); @@ -293,10 +293,10 @@ function execute(hud, input) { * Execute an input expression and wait for a message with the expected text * with given message type to be displayed in the output. * - * @param {Object} hud : The webconsole. - * @param {String} input : The input expression to execute. - * @param {String} matchingText : A string that should match the message body content. - * @param {String} typeSelector : A part of selector for the message, to + * @param {object} hud : The webconsole. + * @param {string} input : The input expression to execute. + * @param {string} matchingText : A string that should match the message body content. + * @param {string} typeSelector : A part of selector for the message, to * specify the message type. */ function executeAndWaitForMessageByType( @@ -313,9 +313,9 @@ function executeAndWaitForMessageByType( /** * Type-specific wrappers for executeAndWaitForMessageByType * - * @param {Object} hud : The webconsole. - * @param {String} input : The input expression to execute. - * @param {String} matchingText : A string that should match the message body + * @param {object} hud : The webconsole. + * @param {string} input : The input expression to execute. + * @param {string} matchingText : A string that should match the message body * content. */ function executeAndWaitForResultMessage(hud, input, matchingText) { @@ -331,11 +331,11 @@ function executeAndWaitForErrorMessage(hud, input, matchingText) { * depending on if the console is in editor mode or not, and wait for a message * with the expected text with given message type to be displayed in the output. * - * @param {Object} hud : The webconsole. - * @param {String} input : The input expression to execute. - * @param {String} matchingText : A string that should match the message body + * @param {object} hud : The webconsole. + * @param {string} input : The input expression to execute. + * @param {string} matchingText : A string that should match the message body * content. - * @param {String} typeSelector : A part of selector for the message, to + * @param {string} typeSelector : A part of selector for the message, to * specify the message type. */ function keyboardExecuteAndWaitForMessageByType( @@ -360,9 +360,9 @@ function keyboardExecuteAndWaitForMessageByType( /** * Type-specific wrappers for keyboardExecuteAndWaitForMessageByType * - * @param {Object} hud : The webconsole. - * @param {String} input : The input expression to execute. - * @param {String} matchingText : A string that should match the message body + * @param {object} hud : The webconsole. + * @param {string} input : The input expression to execute. + * @param {string} matchingText : A string that should match the message body * content. */ function keyboardExecuteAndWaitForResultMessage(hud, input, matchingText) { @@ -503,7 +503,7 @@ function checkConsoleSettingState(hud, selector, enabled) { * according to the passed configuration. * * @param {Node} node - The node to observe mutations on. - * @param {Object} observeConfig - A configuration object for MutationObserver.observe. + * @param {object} observeConfig - A configuration object for MutationObserver.observe. * @returns {Promise} */ function waitForNodeMutation(node, observeConfig = {}) { @@ -522,9 +522,9 @@ function waitForNodeMutation(node, observeConfig = {}) { * the corresponding URL. If the message was generated by a logpoint, * check if the corresponding logpoint editing panel is opened. * - * @param {Object} hud + * @param {object} hud * The webconsole - * @param {Object} options + * @param {object} options * - text: {String} The text to search for. This should be contained in * the message. The searching is done with * @see findMessageByType. @@ -567,7 +567,7 @@ function hasFocus(node) { * Get the value of the console input . * * @param {WebConsole} hud: The webconsole - * @returns {String}: The value of the console input. + * @returns {string}: The value of the console input. */ function getInputValue(hud) { return hud.jsterm._getValue(); @@ -577,7 +577,7 @@ function getInputValue(hud) { * Set the value of the console input . * * @param {WebConsole} hud: The webconsole - * @param {String} value : The value to set the console input to. + * @param {string} value : The value to set the console input to. */ function setInputValue(hud, value) { const onValueSet = hud.jsterm.once("set-input-value"); @@ -590,7 +590,7 @@ function setInputValue(hud, value) { * autocompletion to be updated. * * @param {WebConsole} hud: The webconsole - * @param {String} value : The value to set the jsterm to. + * @param {string} value : The value to set the jsterm to. * @param {Integer} caretPosition : The index where to place the cursor. A negative * number will place the caret at (value.length - offset) position. * Default to value.length (caret set at the end). @@ -638,7 +638,7 @@ async function setInputValueForAutocompletion( * * @param {Toolbox} toolbox * @param {WebConsole} hud - * @param {String} value : The value to set the jsterm to. + * @param {string} value : The value to set the jsterm to. * Default to value.length (caret set at the end). * @returns {Promise<HTMLElement>} resolves with dialog element when it is opened. */ @@ -653,8 +653,8 @@ async function setInputValueForGetterConfirmDialog(toolbox, hud, value) { * Checks if the console input has the expected completion value. * * @param {WebConsole} hud - * @param {String} expectedValue - * @param {String} assertionInfo: Description of the assertion passed to `is`. + * @param {string} expectedValue + * @param {string} assertionInfo: Description of the assertion passed to `is`. */ function checkInputCompletionValue(hud, expectedValue, assertionInfo) { const completionValue = getInputCompletionValue(hud); @@ -671,7 +671,7 @@ function checkInputCompletionValue(hud, expectedValue, assertionInfo) { * * @param {WebConsole} hud * @param {Integer} expectedCursorIndex - * @param {String} assertionInfo: Description of the assertion passed to `is`. + * @param {string} assertionInfo: Description of the assertion passed to `is`. */ function checkInputCursorPosition(hud, expectedCursorIndex, assertionInfo) { const { jsterm } = hud; @@ -683,12 +683,12 @@ function checkInputCursorPosition(hud, expectedCursorIndex, assertionInfo) { * containing a "|" to indicate the expected cursor position. * * @param {WebConsole} hud - * @param {String} expectedStringWithCursor: + * @param {string} expectedStringWithCursor: * String with a "|" to indicate the expected cursor position. * For example, this is how you assert an empty value with the focus "|", * and this indicates the value should be "test" and the cursor at the * end of the input: "test|". - * @param {String} assertionInfo: Description of the assertion passed to `is`. + * @param {string} assertionInfo: Description of the assertion passed to `is`. */ function checkInputValueAndCursorPosition( hud, @@ -718,7 +718,7 @@ function checkInputValueAndCursorPosition( * Returns the console input completion value. * * @param {WebConsole} hud - * @returns {String} + * @returns {string} */ function getInputCompletionValue(hud) { const { jsterm } = hud; @@ -742,7 +742,7 @@ function closeAutocompletePopup(hud) { * Returns a boolean indicating if the console input is focused. * * @param {WebConsole} hud - * @returns {Boolean} + * @returns {boolean} */ function isInputFocused(hud) { const { jsterm } = hud; @@ -859,11 +859,11 @@ async function closeConsole(tab = gBrowser.selectedTab) { /** * Open a network request logged in the webconsole in the netmonitor panel. * - * @param {Object} toolbox - * @param {Object} hud - * @param {String} url + * @param {object} toolbox + * @param {object} hud + * @param {string} url * URL of the request as logged in the netmonitor. - * @param {String} urlInConsole + * @param {string} urlInConsole * (optional) Use if the logged URL in webconsole is different from the real URL. */ async function openMessageInNetmonitor(toolbox, hud, url, urlInConsole) { @@ -952,7 +952,7 @@ async function waitForBrowserConsole() { /** * Get the state of a console filter. * - * @param {Object} hud + * @param {object} hud */ async function getFilterState(hud) { const { outputNode } = hud.ui; @@ -971,7 +971,7 @@ async function getFilterState(hud) { /** * Return the filter input element. * - * @param {Object} hud + * @param {object} hud * @return {HTMLInputElement} */ function getFilterInput(hud) { @@ -981,8 +981,8 @@ function getFilterInput(hud) { /** * Set the state of a console filter. * - * @param {Object} hud - * @param {Object} settings + * @param {object} hud + * @param {object} settings * Category settings in the following format: * { * error: true, @@ -1053,7 +1053,7 @@ async function setFilterState(hud, settings) { * * The css, netxhr and net filters are disabled by default. * - * @param {Object} hud + * @param {object} hud */ async function resetFilters(hud) { info("Resetting filters to their default state"); @@ -1065,7 +1065,7 @@ async function resetFilters(hud) { /** * Open the reverse search input by simulating the appropriate keyboard shortcut. * - * @param {Object} hud + * @param {object} hud * @returns {DOMNode} The reverse search dom node. */ async function openReverseSearch(hud) { @@ -1100,7 +1100,7 @@ function getReverseSearchInfoElement(hud) { * Returns a boolean indicating if the reverse search input is focused. * * @param {WebConsole} hud - * @returns {Boolean} + * @returns {boolean} */ function isReverseSearchInputFocused(hud) { const { outputNode } = hud.ui; @@ -1144,8 +1144,8 @@ async function waitForNoEagerEvaluationResult(hud) { /** * Selects a node in the inspector. * - * @param {Object} toolbox - * @param {String} selector: The selector for the node we want to select. + * @param {object} toolbox + * @param {string} selector: The selector for the node we want to select. */ async function selectNodeWithPicker(toolbox, selector) { const inspector = toolbox.getPanel("inspector"); @@ -1236,7 +1236,7 @@ function getObjectInspectorNodeArrow(node) { * Check if a single object inspector node is expandable. * * @param {HTMLElement} node: Object inspector node (.tree-node) - * @return {Boolean} true if the node can be expanded + * @return {boolean} true if the node can be expanded */ function isObjectInspectorNodeExpandable(node) { return !!getObjectInspectorNodeArrow(node); @@ -1292,7 +1292,7 @@ function getObjectInspectorInvokeGetterButton(node) { * element. * * @param {HTMLElement} oi: Object inspector element - * @param {String} nodeLabel: label of the searched node + * @param {string} nodeLabel: label of the searched node * @return {HTMLElement|null} the Object inspector node with the matching label */ function findObjectInspectorNode(oi, nodeLabel) { @@ -1309,7 +1309,7 @@ function findObjectInspectorNode(oi, nodeLabel) { * Return an array of the label of the autocomplete popup items. * * @param {AutocompletPopup} popup - * @returns {Array<String>} + * @returns {Array<string>} */ function getAutocompletePopupLabels(popup) { return popup.getItems().map(item => item.label); @@ -1320,7 +1320,7 @@ function getAutocompletePopupLabels(popup) { * includes all of the expected labels. * * @param {AutocompletPopup} popup - * @param {Array<String>} expected the array of expected labels + * @param {Array<string>} expected the array of expected labels */ function hasExactPopupLabels(popup, expected) { return hasPopupLabels(popup, expected, true); @@ -1331,7 +1331,7 @@ function hasExactPopupLabels(popup, expected) { * of the specific popup. * * @param {AutocompletPopup} popup - * @param {String} label the label to check + * @param {string} label the label to check */ function hasPopupLabel(popup, label) { return hasPopupLabels(popup, [label]); @@ -1341,8 +1341,8 @@ function hasPopupLabel(popup, label) { * Validate the expected labels against the autocomplete labels. * * @param {AutocompletPopup} popup - * @param {Array<String>} expectedLabels - * @param {Boolean} checkAll + * @param {Array<string>} expectedLabels + * @param {boolean} checkAll */ function hasPopupLabels(popup, expectedLabels, checkAll = false) { const autocompleteLabels = getAutocompletePopupLabels(popup); @@ -1374,7 +1374,7 @@ function getConfirmDialog(toolbox) { * Returns true if the Confirm Dialog is opened. * * @param toolbox - * @returns {Boolean} + * @returns {boolean} */ function isConfirmDialogOpened(toolbox) { const tooltip = getConfirmDialog(toolbox); @@ -1404,7 +1404,7 @@ async function pauseDebugger(dbg, options) { * Check that the passed HTMLElement vertically overflows. * * @param {HTMLElement} container - * @returns {Boolean} + * @returns {boolean} */ function hasVerticalOverflow(container) { return container.scrollHeight > container.clientHeight; @@ -1414,7 +1414,7 @@ function hasVerticalOverflow(container) { * Check that the passed HTMLElement is scrolled to the bottom. * * @param {HTMLElement} container - * @returns {Boolean} + * @returns {boolean} */ function isScrolledToBottom(container) { if (!container.lastChild) { @@ -1430,7 +1430,7 @@ function isScrolledToBottom(container) { /** * * @param {WebConsole} hud - * @param {Array<String>} expectedMessages: An array of string representing the messages + * @param {Array<string>} expectedMessages: An array of string representing the messages * from the output. This can only be a part of the string of the * message. * Start the string with "▶︎⚠ " or "▼⚠ " to indicate that the @@ -1624,7 +1624,7 @@ function reloadPage() { * Check if the editor mode is enabled (i.e. .webconsole-app has the expected class). * * @param {WebConsole} hud - * @returns {Boolean} + * @returns {boolean} */ function isEditorModeEnabled(hud) { const { outputNode } = hud.ui; @@ -1668,7 +1668,7 @@ async function waitForLazyRequests(toolbox) { * Clear the console output and wait for eventual object actors to be released. * * @param {WebConsole} hud - * @param {Object} An options object with the following properties: + * @param {object} An options object with the following properties: * - {Boolean} keepStorage: true to prevent clearing the messages storage. */ async function clearOutput(hud, { keepStorage = false } = {}) { @@ -1704,7 +1704,7 @@ function getContextSelectorItems(hud) { * state. * * @param {WebConsole} hud - * @param {Array<Object>} expected: An array of object (see checkContextSelectorMenuItemAt + * @param {Array<object>} expected: An array of object (see checkContextSelectorMenuItemAt * for expected properties) */ function checkContextSelectorMenu(hud, expected) { @@ -1725,13 +1725,13 @@ function checkContextSelectorMenu(hud, expected) { * Check that the evaluation context selector menu has the expected item at the specified index. * * @param {WebConsole} hud - * @param {Number} index - * @param {Object} expected - * @param {String} expected.label: The label of the target - * @param {String} expected.tooltip: The tooltip of the target element in the menu - * @param {Boolean} expected.checked: if the target should be selected or not - * @param {Boolean} expected.separator: if the element is a simple separator - * @param {Boolean} expected.indented: if the element is indented + * @param {number} index + * @param {object} expected + * @param {string} expected.label: The label of the target + * @param {string} expected.tooltip: The tooltip of the target element in the menu + * @param {boolean} expected.checked: if the target should be selected or not + * @param {boolean} expected.separator: if the element is a simple separator + * @param {boolean} expected.indented: if the element is indented */ function checkContextSelectorMenuItemAt(hud, index, expected) { const el = getContextSelectorItems(hud).at(index); @@ -1764,7 +1764,7 @@ function checkContextSelectorMenuItemAt(hud, index, expected) { * Select a target in the context selector. * * @param {WebConsole} hud - * @param {String} targetLabel: The label of the target to select. + * @param {string} targetLabel: The label of the target to select. */ function selectTargetInContextSelector(hud, targetLabel) { const items = getContextSelectorItems(hud); diff --git a/devtools/client/webconsole/test/browser/stub-generator-helpers.js b/devtools/client/webconsole/test/browser/stub-generator-helpers.js @@ -243,9 +243,9 @@ function cleanTimeStamp(packet) { /** * Write stubs to a given file * - * @param {String} fileName: The file to write the stubs in. + * @param {string} fileName: The file to write the stubs in. * @param {Map} packets: A Map of the packets. - * @param {Boolean} isNetworkMessage: Is the packets are networkMessage packets + * @param {boolean} isNetworkMessage: Is the packets are networkMessage packets */ async function writeStubsToFile(fileName, packets, isNetworkMessage) { const mozRepo = Services.env.get("MOZ_DEVELOPER_REPO_DIR"); @@ -330,13 +330,13 @@ function sortObjectKeys(obj) { } /** - * @param {Object} packet + * @param {object} packet * The packet to serialize. - * @param {Object} options - * @param {Boolean} options.sortKeys + * @param {object} options + * @param {boolean} options.sortKeys * Pass true to sort all keys alphabetically in the packet before serialization. * For instance stub comparison should not fail if the order of properties changed. - * @param {Boolean} options.replaceActorIds + * @param {boolean} options.replaceActorIds * Pass true to replace actorIDs with a fake one so it's easier to compare stubs * that includes grips. */ diff --git a/devtools/client/webconsole/test/browser/test-dynamic-import.mjs b/devtools/client/webconsole/test/browser/test-dynamic-import.mjs @@ -2,8 +2,8 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ /** - * @param {Number} numbers that will be summed. - * @returns {String} A string of the following form: `${arg1} + ${arg2} ${argn} = ${sum}` + * @param {number} numbers that will be summed. + * @returns {string} A string of the following form: `${arg1} + ${arg2} ${argn} = ${sum}` */ function sum(...args) { return `${args.join(" + ")} = ${args.reduce((acc, i) => acc + i)}`; diff --git a/devtools/client/webconsole/utils/clipboard.js b/devtools/client/webconsole/utils/clipboard.js @@ -16,7 +16,7 @@ * we fallback to `HTMLElement.textContent`. * * @param {HTMLElement} el: The element we want the text of. - * @returns {String|null} The text of the element, or null if el is falsy. + * @returns {string | null} The text of the element, or null if el is falsy. */ function getElementText(el) { if (!el) { diff --git a/devtools/client/webconsole/utils/context-menu.js b/devtools/client/webconsole/utils/context-menu.js @@ -40,10 +40,10 @@ loader.lazyRequireGetter( * Create a Menu instance for the webconsole. * * @param {Event} context menu event - * {Object} message (optional) message object containing metadata such as: + * {object} message (optional) message object containing metadata such as: * - {String} source * - {String} request - * @param {Object} options + * @param {object} options * - {Actions} bound actions * - {WebConsoleWrapper} wrapper instance used for accessing properties like the store * and window. diff --git a/devtools/client/webconsole/utils/messages.js b/devtools/client/webconsole/utils/messages.js @@ -114,9 +114,9 @@ function prepareMessage(resource, idGenerator, persistLogs) { /** * Transforms a resource given its type. * - * @param {Object} resource: This can be either a simple RDP packet or an object emitted + * @param {object} resource: This can be either a simple RDP packet or an object emitted * by the Resource API. - * @param {Boolean} persistLogs: Value of the "Persist logs" setting + * @param {boolean} persistLogs: Value of the "Persist logs" setting */ function transformResource(resource, persistLogs) { switch (resource.resourceType || resource.type) { @@ -625,7 +625,7 @@ function transformEvaluationResultPacket(packet) { * * @param {Message} message1 * @param {Message} message2 - * @returns {Boolean} + * @returns {boolean} */ // eslint-disable-next-line complexity function areMessagesSimilar(message1, message2) { @@ -675,7 +675,7 @@ function areMessagesSimilar(message1, message2) { * * @param {Message} message1 * @param {Message} message2 - * @returns {Boolean} + * @returns {boolean} */ // eslint-disable-next-line complexity function areMessagesParametersSimilar(message1, message2) { @@ -737,7 +737,7 @@ function areMessagesParametersSimilar(message1, message2) { * * @param {Message} message1 * @param {Message} message2 - * @returns {Boolean} + * @returns {boolean} */ function areMessagesStacktracesSimilar(message1, message2) { const message1StackLength = message1.stacktrace?.length; @@ -858,7 +858,7 @@ function createSimpleTableMessage(columns, items, timeStamp) { * The resource at “<URL>” was blocked because Enhanced Tracking Protection is enabled * * @param {ConsoleMessage} firstMessage - * @returns {String} The computed label + * @returns {string} The computed label */ function getWarningGroupLabel(firstMessage) { if ( @@ -884,9 +884,9 @@ function getWarningGroupLabel(firstMessage) { * Replace any URL in the provided text by the provided replacement text, or an empty * string. * - * @param {String} text - * @param {String} replacementText - * @returns {String} + * @param {string} text + * @param {string} replacementText + * @returns {string} */ function replaceURL(text, replacementText = "") { let result = ""; @@ -930,7 +930,7 @@ function replaceURL(text, replacementText = "") { * Get the warningGroup type in which the message could be in. * * @param {ConsoleMessage} message - * @returns {String|null} null if the message can't be part of a warningGroup. + * @returns {string | null} null if the message can't be part of a warningGroup. */ function getWarningGroupType(message) { // We got report that this can be called with `undefined` (See Bug 1801462 and Bug 1810109). @@ -976,7 +976,7 @@ function getWarningGroupType(message) { * * @param {ConsoleMessage} type: the message type, from MESSAGE_TYPE. * @param {Integer} innerWindowID: the message innerWindowID. - * @returns {String} + * @returns {string} */ function getParentWarningGroupMessageId(message) { const warningGroupType = getWarningGroupType(message); @@ -991,7 +991,7 @@ function getParentWarningGroupMessageId(message) { * Returns true if the message is a warningGroup message (i.e. the "Header"). * * @param {ConsoleMessage} message - * @returns {Boolean} + * @returns {boolean} */ function isWarningGroup(message) { return ( @@ -1008,7 +1008,7 @@ function isWarningGroup(message) { * Returns true if the message is an Enhanced Tracking Protection message. * * @param {ConsoleMessage} message - * @returns {Boolean} + * @returns {boolean} */ function isEnhancedTrackingProtectionMessage(message) { const { category } = message; @@ -1024,7 +1024,7 @@ function isEnhancedTrackingProtectionMessage(message) { * Returns true if the message is a storage isolation message. * * @param {ConsoleMessage} message - * @returns {Boolean} + * @returns {boolean} */ function isStorageIsolationMessage(message) { const { category } = message; @@ -1035,7 +1035,7 @@ function isStorageIsolationMessage(message) { * Returns true if the message is a tracking protection message. * * @param {ConsoleMessage} message - * @returns {Boolean} + * @returns {boolean} */ function isTrackingProtectionMessage(message) { const { category } = message; @@ -1046,7 +1046,7 @@ function isTrackingProtectionMessage(message) { * Returns true if the message is a cookie message. * * @param {ConsoleMessage} message - * @returns {Boolean} + * @returns {boolean} */ function isCookieMessage(message) { const { category } = message; @@ -1062,7 +1062,7 @@ function isCookieMessage(message) { * Returns true if the message is a Content Security Policy (CSP) message. * * @param {ConsoleMessage} message - * @returns {Boolean} + * @returns {boolean} */ function isCSPMessage(message) { const { category } = message; diff --git a/devtools/client/webconsole/utils/object-inspector.js b/devtools/client/webconsole/utils/object-inspector.js @@ -49,11 +49,11 @@ loader.lazyRequireGetter( /** * Create and return an ObjectInspector for the given front. * - * @param {Object} grip + * @param {object} grip * The object grip to create an ObjectInspector for. - * @param {Object} serviceContainer + * @param {object} serviceContainer * Object containing various utility functions - * @param {Object} override + * @param {object} override * Object containing props that should override the default props passed to * ObjectInspector. * @returns {ObjectInspector} diff --git a/devtools/client/webconsole/webconsole-ui.js b/devtools/client/webconsole/webconsole-ui.js @@ -92,7 +92,7 @@ class WebConsoleUI { /** * Initialize the WebConsoleUI instance. * - * @return {Object} + * @return {object} * A promise object that resolves once the frame is ready to use. */ init() { @@ -211,10 +211,10 @@ class WebConsoleUI { * * This method emits the "messages-cleared" notification. * - * @param {Boolean} clearStorage + * @param {boolean} clearStorage * True if you want to clear the console messages storage associated to * this Web Console. - * @param {Object} event + * @param {object} event * If the event exists, calls preventDefault on it. */ async clearOutput(clearStorage, event) { @@ -306,7 +306,7 @@ class WebConsoleUI { * Connect to the server using the remote debugging protocol. * * @private - * @return {Object} + * @return {object} * A promise object that is resolved/reject based on the proxies connections. */ async _attachTargets() { @@ -436,7 +436,7 @@ class WebConsoleUI { /** * Handler for when the page is done loading. * - * @param {Boolean} hasNativeConsoleAPI + * @param {boolean} hasNativeConsoleAPI * True if the `console` object is the native one and hasn't been overloaded by a custom * object by the page itself. */ @@ -714,7 +714,7 @@ class WebConsoleUI { /** * Returns system-specific key shortcuts for clearing the console. * - * @return {String[]} + * @return {string[]} * An array of key shortcut strings. */ getClearKeyShortcuts() { diff --git a/devtools/client/webconsole/webconsole-wrapper.js b/devtools/client/webconsole/webconsole-wrapper.js @@ -185,9 +185,9 @@ class WebConsoleWrapper { * Query the reducer store for the current state of filtering * a given type of message * - * @param {String} filter + * @param {string} filter * Type of message to be filtered. - * @return {Boolean} + * @return {boolean} * True if this type of message should be displayed. */ getFilterState(filter) { @@ -370,7 +370,7 @@ class WebConsoleWrapper { /** * - * @param {String} expression: The expression to evaluate + * @param {string} expression: The expression to evaluate */ dispatchEvaluateExpression(expression) { store.dispatch(actions.evaluateExpression(expression)); diff --git a/devtools/client/webconsole/webconsole.js b/devtools/client/webconsole/webconsole.js @@ -130,7 +130,7 @@ class WebConsole { /** * Initialize the Web Console instance. * - * @param {Boolean} emitCreatedEvent: Defaults to true. If false is passed, + * @param {boolean} emitCreatedEvent: Defaults to true. If false is passed, * We won't be sending the 'web-console-created' event. * * @return object @@ -159,7 +159,7 @@ class WebConsole { /** * Get the value from the input field. * - * @returns {String|null} returns null if there's no input. + * @returns {string | null} returns null if there's no input. */ getInputValue() { if (!this.jsterm) { @@ -184,7 +184,7 @@ class WebConsole { /** * Sets the value of the input field (command line) * - * @param {String} newValue: The new value to set. + * @param {string} newValue: The new value to set. */ setInputValue(newValue) { if (!this.jsterm) { @@ -258,7 +258,7 @@ class WebConsole { * Retrieve information about the JavaScript debugger's currently selected stackframe. * is used to allow the Web Console to evaluate code in the selected stackframe. * - * @return {String} + * @return {string} * The Frame Actor ID. * If the debugger is not open or if it's not paused, then |null| is * returned. @@ -282,8 +282,8 @@ class WebConsole { * parser worker to provide additional feature for the user (top-level await, * original languages mapping, …). * - * @param {String} expression: The input to maybe map. - * @returns {Object|null} + * @param {string} expression: The input to maybe map. + * @returns {object | null} * Returns null if the input can't be mapped. * If it can, returns an object containing the following: * - {String} expression: The mapped expression diff --git a/devtools/server/actors/accessibility/accessibility.js b/devtools/server/actors/accessibility/accessibility.js @@ -64,9 +64,9 @@ class AccessibilityActor extends Actor { * * @param {null} subject * Not used. - * @param {String} topic + * @param {string} topic * Name of the a11y service event: "a11y-init-or-shutdown". - * @param {String} data + * @param {string} data * "0" corresponds to shutdown and "1" to init. */ observe(subject, topic, data) { @@ -85,7 +85,7 @@ class AccessibilityActor extends Actor { /** * Get or create AccessibilityWalker actor, similar to WalkerActor. * - * @return {Object} + * @return {object} * AccessibleWalkerActor for the current tab. */ getWalker() { @@ -103,7 +103,7 @@ class AccessibilityActor extends Actor { * <feColorMatrix> since it is accelerated and scrolling with filter applied * needs to be smooth (Bug1431466). * - * @return {Object|null} + * @return {object | null} * SimulatorActor for the current tab. */ getSimulator() { diff --git a/devtools/server/actors/accessibility/accessible.js b/devtools/server/actors/accessibility/accessible.js @@ -90,7 +90,7 @@ const CSS_TEXT_SELECTOR = "#text"; * * @param {DOMNode} node * Node for which to get the information. - * @return {Object} + * @return {object} * Information about the type of the node and how to locate it. */ function getNodeDescription(node) { @@ -492,7 +492,7 @@ class AccessibleActor extends Actor { * Provide additional (full) information about the accessible object that is * otherwise missing from the form. * - * @return {Object} + * @return {object} * Object that contains accessible object information such as states, * actions, attributes, etc. */ @@ -556,11 +556,11 @@ class AccessibleActor extends Actor { /** * Run an accessibility audit for a given audit type. * - * @param {String} type + * @param {string} type * Type of an audit (Check AUDIT_TYPE in devtools/shared/constants * to see available audit types). * - * @return {null|Object} + * @return {null | object} * Object that contains accessible audit data for a given type or null * if there's nothing to report for this accessible. */ @@ -583,11 +583,11 @@ class AccessibleActor extends Actor { /** * Audit the state of the accessible object. * - * @param {Object} options + * @param {object} options * Options for running audit, may include: * - types: Array of audit types to be performed during audit. * - * @return {Object|null} + * @return {object | null} * Audit results for the accessible object. */ audit(options = {}) { diff --git a/devtools/server/actors/accessibility/audit/contrast.js b/devtools/server/actors/accessibility/audit/contrast.js @@ -66,13 +66,13 @@ loader.lazyGetter(this, "worker", () => new lazy.DevToolsWorker(WORKER_URL)); * Get canvas rendering context for the current target window bound by the bounds of the * accessible objects. * - * @param {Object} win + * @param {object} win * Current target window. - * @param {Object} bounds + * @param {object} bounds * Bounds for the accessible object. - * @param {Object} zoom + * @param {object} zoom * Current zoom level for the window. - * @param {Object} scale + * @param {object} scale * Scale value to scale down the drawn image. * @param {null|DOMNode} node * If not null, a node that corresponds to the accessible object to be used to @@ -153,16 +153,16 @@ function getTransformedRGBA(rgba, colorMatrix) { * * @param {DOMNode} node * Node for which we want to get the background color data. - * @param {Object} options - * - bounds {Object} + * @param {object} options + * - bounds {object} * Bounds for the accessible object. - * - win {Object} + * - win {object} * Target window. * - size {Number} * Font size of the selected text node * - isBoldText {Boolean} * True if selected text node is bold - * @return {Object} + * @return {object} * Object with one or more of the following RGBA fields: value, min, max */ function getBackgroundFor(node, { win, bounds, size, isBoldText }) { @@ -221,15 +221,15 @@ function getBackgroundFor(node, { win, bounds, size, isBoldText }) { * * @param {DOMNode} node * The node for which we want to calculate the contrast ratio. - * @param {Object} options - * - bounds {Object} + * @param {object} options + * - bounds {object} * Bounds for the accessible object. - * - win {Object} + * - win {object} * Target window. * - appliedColorMatrix {Array|null} * Simulation color matrix applied to * to the viewport, if it exists. - * @return {Object} + * @return {object} * An object that may contain one or more of the following fields: error, * isLargeText, value, min, max values for contrast. */ diff --git a/devtools/server/actors/accessibility/audit/keyboard.js b/devtools/server/actors/accessibility/audit/keyboard.js @@ -111,7 +111,7 @@ const INTERACTIVE_IF_FOCUSABLE_ROLES = new Set([ * @param {DOMNode} node * Node to be tested for validity. * - * @returns {Boolean} + * @returns {boolean} * True if the node is either dead or is not an element node. */ function isInvalidNode(node) { @@ -129,7 +129,7 @@ function isInvalidNode(node) { * @param {nsIAccessible} accessible * Accessible for which to determine if it is keyboard focusable. * - * @returns {Boolean} + * @returns {boolean} * True if focusable with the keyboard. */ function isKeyboardFocusable(accessible) { @@ -154,10 +154,10 @@ function isKeyboardFocusable(accessible) { * Node to apply focus-related pseudo class to. * @param {DOMNode} currentNode * Node to be checked for having focus specific styling. - * @param {String} pseudoClass + * @param {string} pseudoClass * A focus related pseudo-class to be simulated for style comparison. * - * @returns {Boolean} + * @returns {boolean} * True if the currentNode has focus specific styling. */ function hasStylesForFocusRelatedPseudoClass( @@ -219,7 +219,7 @@ function hasStylesForFocusRelatedPseudoClass( * @param {DOMNode} currentNode * Node to be checked for having focus specific styling. * - * @returns {Boolean} + * @returns {boolean} * True if the node or its descendant has distinct focus styling. */ function hasFocusStyling(focusableNode, currentNode) { @@ -270,7 +270,7 @@ function hasFocusStyling(focusableNode, currentNode) { * Accessible to be checked for being focusable and having focus * styling. * - * @return {null|Object} + * @return {null | object} * Null if accessible has keyboard focus styling, audit report object * otherwise. */ @@ -307,7 +307,7 @@ function focusStyleRule(accessible) { * Accessible to be checked for being interactive and having accessible * actions. * - * @return {null|Object} + * @return {null | object} * Null if accessible is not interactive or if it is and it has * accessible action associated with it, audit report object otherwise. */ @@ -331,7 +331,7 @@ function interactiveRule(accessible) { * Accessible to be checked for being interactive and being focusable * when enabled. * - * @return {null|Object} + * @return {null | object} * Null if accessible is not interactive or if it is and it is focusable * when enabled, audit report object otherwise. */ @@ -372,7 +372,7 @@ function focusableRule(accessible) { * Accessible to be checked for having an interactive role if it is * focusable. * - * @return {null|Object} + * @return {null | object} * Null if accessible is not interactive or if it is and it has an * interactive role, audit report object otherwise. */ @@ -438,7 +438,7 @@ function semanticsRule(accessible) { * Accessible to be checked for having an element with positive tabindex * attribute. * - * @return {null|Object} + * @return {null | object} * Null if accessible is not focusable or if it is and its element's * tabindex attribute is less than 1, audit report object otherwise. */ diff --git a/devtools/server/actors/accessibility/audit/text-label.js b/devtools/server/actors/accessibility/audit/text-label.js @@ -39,7 +39,7 @@ const { * @param {nsIAccessible} accessible * Accessible object to be tested for visibility. * - * @returns {Boolean} + * @returns {boolean} * True if accessible object is visible to assistive technology. */ function isVisible(accessible) { @@ -71,7 +71,7 @@ function getLabels(accessible) { * @param {nsIAccessible} accessible * Accessible objects to get a name for. * - * @returns {null|String} + * @returns {null | string} * Trimmed name of the accessible object if available. */ function getAccessibleName(accessible) { @@ -82,7 +82,7 @@ function getAccessibleName(accessible) { * A text label rule for accessible objects that must have a non empty * accessible name. * - * @returns {null|Object} + * @returns {null | object} * Failure audit report if accessible object has no or empty name, null * otherwise. */ @@ -95,7 +95,7 @@ const mustHaveNonEmptyNameRule = function (issue, accessible) { * A text label rule for accessible objects that should have a non empty * accessible name as a best practice. * - * @returns {null|Object} + * @returns {null | object} * Best practices audit report if accessible object has no or empty * name, null otherwise. */ @@ -108,7 +108,7 @@ const shouldHaveNonEmptyNameRule = function (issue, accessible) { * A text label rule for accessible objects that can be activated via user * action and must have a non-empty name. * - * @returns {null|Object} + * @returns {null | object} * Failure audit report if interactive accessible object has no or * empty name, null otherwise. */ @@ -121,7 +121,7 @@ const interactiveRule = mustHaveNonEmptyNameRule.bind( * A text label rule for accessible objects that correspond to dialogs and thus * should have a non-empty name. * - * @returns {null|Object} + * @returns {null | object} * Best practices audit report if dialog accessible object has no or * empty name, null otherwise. */ @@ -132,7 +132,7 @@ const dialogRule = shouldHaveNonEmptyNameRule.bind(null, DIALOG_NO_NAME); * (images, canvas, etc.) and must have a defined name (that can be empty, e.g. * ""). * - * @returns {null|Object} + * @returns {null | object} * Failure audit report if interactive accessible object has no name, * null otherwise. */ @@ -145,7 +145,7 @@ const imageRule = function (accessible) { * A text label rule for accessible objects that correspond to form elements. * These objects must have a non-empty name and must have a visible label. * - * @returns {null|Object} + * @returns {null | object} * Failure audit report if form element accessible object has no name, * warning if the name does not come from a visible label, null * otherwise. @@ -171,7 +171,7 @@ const formRule = function (accessible) { * * <FIELDSET> must have a non-empty name and must be provided via the * corresponding <LEGEND> element. * - * @returns {null|Object} + * @returns {null | object} * Failure audit report if form grouping accessible object has no name, * or has a name that is not derived from a required location, null * otherwise. @@ -220,7 +220,7 @@ const formGroupingRule = function (accessible) { * the visible label. Note: Will only work when bug 559770 is resolved (right * now, unlabelled meters are not mapped to an accessible object). * - * @returns {null|Object} + * @returns {null | object} * Failure audit report depending on requirements for dialogs or form * meter element, null otherwise. */ @@ -246,7 +246,7 @@ const textContainerRule = function (accessible) { * * <FRAME> and <IFRAME> map to ROLE_INTERNAL_FRAME and must have a non-empty * title attribute. * - * @returns {null|Object} + * @returns {null | object} * Failure audit report if the internal frame accessible object name is * not provided or if it is not derived from a required location, null * otherwise. @@ -288,7 +288,7 @@ const internalFrameRule = function (accessible) { * A text label rule for accessible objects that represent documents and should * have title element provided. * - * @returns {null|Object} + * @returns {null | object} * Failure audit report if document accessible object has no or empty * title, null otherwise. */ @@ -301,7 +301,7 @@ const documentRule = function (accessible) { * A text label rule for accessible objects that correspond to headings and thus * must be non-empty. * - * @returns {null|Object} + * @returns {null | object} * Failure audit report if heading accessible object has no or * empty name or if its text content is empty, null otherwise. */ @@ -320,7 +320,7 @@ const headingRule = function (accessible) { * A text label rule for accessible objects that represent toolbars and must * have a non-empty name if there is more than one toolbar present. * - * @returns {null|Object} + * @returns {null | object} * Failure audit report if toolbar accessible object is not the only * toolbar in the document and has no or empty title, null otherwise. */ @@ -337,7 +337,7 @@ const toolbarRule = function (accessible) { * A text label rule for accessible objects that represent link (anchors, areas) * and must have a non-empty name. * - * @returns {null|Object} + * @returns {null | object} * Failure audit report if link accessible object has no or empty name, * or in case when it's an <area> element with href attribute the name * is not specified by an alt attribute, null otherwise. @@ -360,7 +360,7 @@ const linkRule = function (accessible) { * non-standard symbols where existing Unicode characters are not available and * must have a non-empty name. * - * @returns {null|Object} + * @returns {null | object} * Failure audit report if mglyph accessible object has no or empty * name, and no or empty alt attribute, null otherwise. */ @@ -429,7 +429,7 @@ const RULES = { * Accessible object to be tested to determine if it requires and has * an appropriate text alternative. * - * @return {null|Object} + * @return {null | object} * Null if accessible does not need or has the right text alternative, * audit data otherwise. This data is used in the accessibility panel * for its audit filters, audit badges, sidebar checks section and diff --git a/devtools/server/actors/accessibility/parent-accessibility.js b/devtools/server/actors/accessibility/parent-accessibility.js @@ -65,7 +65,7 @@ class ParentAccessibilityActor extends Actor { /** * A getter that indicates if accessibility service is enabled. * - * @return {Boolean} + * @return {boolean} * True if accessibility service is on. */ get enabled() { @@ -75,7 +75,7 @@ class ParentAccessibilityActor extends Actor { /** * A getter that indicates if the accessibility service can be disabled. * - * @return {Boolean} + * @return {boolean} * True if accessibility service can be disabled. */ get canBeDisabled() { @@ -93,7 +93,7 @@ class ParentAccessibilityActor extends Actor { /** * A getter that indicates if the accessibility service can be enabled. * - * @return {Boolean} + * @return {boolean} * True if accessibility service can be enabled. */ get canBeEnabled() { diff --git a/devtools/server/actors/accessibility/simulator.js b/devtools/server/actors/accessibility/simulator.js @@ -26,11 +26,11 @@ class SimulatorActor extends Actor { /** * Simulates a type of visual impairment (i.e. color blindness or contrast loss). * - * @param {Object} options + * @param {object} options * Properties: {Array} types * Contains the types of visual impairment(s) to be simulated. * Set default color matrix if array is empty. - * @return {Boolean} + * @return {boolean} * True if matrix was successfully applied, false otherwise. */ simulate(options) { diff --git a/devtools/server/actors/accessibility/walker.js b/devtools/server/actors/accessibility/walker.js @@ -148,7 +148,7 @@ const { * * @param {nsIAccessible} accessible * object to be tested. - * @return {Boolean} + * @return {boolean} * True if accessible object is stale, false otherwise. */ function isStale(accessible) { @@ -162,14 +162,14 @@ function isStale(accessible) { /** * Get accessibility audit starting with the passed accessible object as a root. * - * @param {Object} acc + * @param {object} acc * AccessibileActor to be used as the root for the audit. - * @param {Object} options + * @param {object} options * Options for running audit, may include: * - types: Array of audit types to be performed during audit. * @param {Map} report * An accumulator map to be used to store audit information. - * @param {Object} progress + * @param {object} progress * An audit project object that is used to track the progress of the * audit and send progress "audit-event" events to the client. */ @@ -474,7 +474,7 @@ class AccessibleWalkerActor extends Actor { /** * Get an accessible actor for a domnode actor. * - * @param {Object} domNode + * @param {object} domNode * domnode actor for which accessible actor is being created. * @return {Promse} * A promise that resolves when accessible actor is created for a @@ -546,7 +546,7 @@ class AccessibleWalkerActor extends Actor { * Run accessibility audit and return relevant ancestries for AccessibleActors * that have non-empty audit checks. * - * @param {Object} options + * @param {object} options * Options for running audit, may include: * - types: Array of audit types to be performed during audit. * @@ -590,7 +590,7 @@ class AccessibleWalkerActor extends Actor { * report. Instead, an "audit-event" event will be fired when the audit is * completed or fails. * - * @param {Object} options + * @param {object} options * Options for running audit, may include: * - types: Array of audit types to be performed during audit. */ @@ -749,7 +749,7 @@ class AccessibleWalkerActor extends Actor { * preventing transitions and applying transparency when calculating colour * contrast as well as temporarily hiding accessible highlighter overlay. * - * @param {Object} win + * @param {object} win * Window where highlighting happens. */ async clearStyles(win) { @@ -774,7 +774,7 @@ class AccessibleWalkerActor extends Actor { * for preventing transitions and applying transparency when calculating * colour contrast and potentially restoring accessible highlighter overlay. * - * @param {Object} win + * @param {object} win * Window where highlighting was happenning. */ async restoreStyles(win) { @@ -817,13 +817,13 @@ class AccessibleWalkerActor extends Actor { * Public method used to show an accessible object highlighter on the client * side. * - * @param {Object} accessible + * @param {object} accessible * AccessibleActor to be highlighted. - * @param {Object} options + * @param {object} options * Object used for passing options. Available options: * - duration {Number} * Duration of time that the highlighter should be shown. - * @return {Boolean} + * @return {boolean} * True if highlighter shows the accessible object. */ async highlightAccessible(accessible, options = {}) { @@ -937,7 +937,7 @@ class AccessibleWalkerActor extends Actor { /** * Click event handler for when picking is enabled. * - * @param {Object} event + * @param {object} event * Current click event. */ onPick(event) { @@ -971,7 +971,7 @@ class AccessibleWalkerActor extends Actor { /** * Hover event handler for when picking is enabled. * - * @param {Object} event + * @param {object} event * Current hover event. */ async onHovered(event) { @@ -1002,7 +1002,7 @@ class AccessibleWalkerActor extends Actor { /** * Keyboard event handler for when picking is enabled. * - * @param {Object} event + * @param {object} event * Current keyboard event. */ onKey(event) { @@ -1093,9 +1093,9 @@ class AccessibleWalkerActor extends Actor { * Find deepest accessible object that corresponds to the screen coordinates of the * mouse pointer and attach it to the AccessibilityWalker tree. * - * @param {Object} event + * @param {object} event * Correspoinding content event. - * @return {null|Object} + * @return {null | object} * Accessible object, if available, that corresponds to a DOM node. */ _findAndAttachAccessible(event) { @@ -1216,7 +1216,7 @@ class AccessibleWalkerActor extends Actor { /** * Focusin event handler for when interacting with tabbing order overlay. * - * @param {Object} event + * @param {object} event * Most recent focusin event. */ async onFocusIn(event) { @@ -1239,7 +1239,7 @@ class AccessibleWalkerActor extends Actor { /** * Focusout event handler for when interacting with tabbing order overlay. * - * @param {Object} event + * @param {object} event * Most recent focusout event. */ async onFocusOut(event) { @@ -1268,10 +1268,10 @@ class AccessibleWalkerActor extends Actor { /** * Show tabbing order overlay for a given target. * - * @param {Object} elm + * @param {object} elm * domnode actor to be used as the starting point for generating the * tabbing order. - * @param {Number} index + * @param {number} index * Starting index for the tabbing order. * * @return {JSON} diff --git a/devtools/server/actors/accessibility/worker.js b/devtools/server/actors/accessibility/worker.js @@ -25,7 +25,7 @@ createTask(self, "getBgRGBA", ({ dataTextBuf, dataBackgroundBuf }) => * https://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef * * @param {Array} rgba An array with [r,g,b,a] values. - * @return {Number} The calculated luminance. + * @return {number} The calculated luminance. */ function calculateLuminance(rgba) { for (let i = 0; i < 3; i++) { @@ -47,7 +47,7 @@ function calculateLuminance(rgba) { * pixel data for the accessible object with text visible. * @param {ImageData} dataBackgroundBuf * pixel data for the accessible object with transparent text. - * @return {Object} + * @return {object} * RGBA or a range of RGBAs with min and max values. */ function getBgRGBA(dataTextBuf, dataBackgroundBuf) { diff --git a/devtools/server/actors/animation.js b/devtools/server/actors/animation.js @@ -81,7 +81,7 @@ class AnimationPlayerActor extends Actor { /** * @param {AnimationsActor} The main AnimationsActor instance * @param {AnimationPlayer} The player object returned by getAnimationPlayers - * @param {Number} Time which animation created + * @param {number} Time which animation created */ constructor(animationsActor, player, createdTime) { super(animationsActor.conn, animationPlayerSpec); @@ -224,7 +224,7 @@ class AnimationPlayerActor extends Actor { * property if it was set, or the keyframe rule name or the transition * property. * - * @return {String} + * @return {string} */ getName() { if (this.player.id) { @@ -241,7 +241,7 @@ class AnimationPlayerActor extends Actor { /** * Get the animation duration from this player, in milliseconds. * - * @return {Number} + * @return {number} */ getDuration() { return this.player.effect.getComputedTiming().duration; @@ -250,7 +250,7 @@ class AnimationPlayerActor extends Actor { /** * Get the animation delay from this player, in milliseconds. * - * @return {Number} + * @return {number} */ getDelay() { return this.player.effect.getComputedTiming().delay; @@ -259,7 +259,7 @@ class AnimationPlayerActor extends Actor { /** * Get the animation endDelay from this player, in milliseconds. * - * @return {Number} + * @return {number} */ getEndDelay() { return this.player.effect.getComputedTiming().endDelay; @@ -269,7 +269,7 @@ class AnimationPlayerActor extends Actor { * Get the animation iteration count for this player. That is, how many times * is the animation scheduled to run. * - * @return {Number} The number of iterations, or null if the animation repeats + * @return {number} The number of iterations, or null if the animation repeats * infinitely. */ getIterationCount() { @@ -281,7 +281,7 @@ class AnimationPlayerActor extends Actor { * Get the animation iterationStart from this player, in ratio. * That is offset of starting position of the animation. * - * @return {Number} + * @return {number} */ getIterationStart() { return this.player.effect.getComputedTiming().iterationStart; @@ -290,7 +290,7 @@ class AnimationPlayerActor extends Actor { /** * Get the animation easing from this player. * - * @return {String} + * @return {string} */ getEasing() { return this.player.effect.getComputedTiming().easing; @@ -299,7 +299,7 @@ class AnimationPlayerActor extends Actor { /** * Get the animation fill mode from this player. * - * @return {String} + * @return {string} */ getFill() { return this.player.effect.getComputedTiming().fill; @@ -308,7 +308,7 @@ class AnimationPlayerActor extends Actor { /** * Get the animation direction from this player. * - * @return {String} + * @return {string} */ getDirection() { return this.player.effect.getComputedTiming().direction; @@ -317,7 +317,7 @@ class AnimationPlayerActor extends Actor { /** * Get animation-timing-function from animated element if CSS Animations. * - * @return {String} + * @return {string} */ getAnimationTimingFunction() { if (!this.isCssAnimation()) { @@ -348,7 +348,7 @@ class AnimationPlayerActor extends Actor { /** * Return the current start of the Animation. * - * @return {Object} + * @return {object} */ getState() { const compositorStatus = this.getPropertiesCompositorStatus(); @@ -398,7 +398,7 @@ class AnimationPlayerActor extends Actor { * case some properties haven't changed since last time (since the front can * reconstruct those). If you want the full state, use the getState method. * - * @return {Object} + * @return {object} */ getCurrentState() { const newState = this.getState(); @@ -572,7 +572,7 @@ class AnimationPlayerActor extends Actor { * Get the animation types for a given list of CSS property names. * * @param {Array} propertyNames - CSS property names (e.g. background-color) - * @return {Object} Returns animation types (e.g. {"background-color": "rgb(0, 0, 0)"}. + * @return {object} Returns animation types (e.g. {"background-color": "rgb(0, 0, 0)"}. */ getAnimationTypes(propertyNames) { const animationTypes = {}; @@ -585,11 +585,11 @@ class AnimationPlayerActor extends Actor { /** * Returns the distance of between value1, value2. * - * @param {Object} target - dom element - * @param {String} propertyName - e.g. transform - * @param {String} value1 - e.g. translate(0px) - * @param {String} value2 - e.g. translate(10px) - * @param {Object} DOMWindowUtils + * @param {object} target - dom element + * @param {string} propertyName - e.g. transform + * @param {string} value1 - e.g. translate(0px) + * @param {string} value2 - e.g. translate(10px) + * @param {object} DOMWindowUtils * @param {float} distance */ getDistance(target, propertyName, value1, value2, DOMWindowUtils) { @@ -864,8 +864,8 @@ exports.AnimationsActor = class AnimationsActor extends Actor { * Set the current time of several animations at the same time. * * @param {Array} players A list of AnimationPlayerActor. - * @param {Number} time The new currentTime. - * @param {Boolean} shouldPause Should the players be paused too. + * @param {number} time The new currentTime. + * @param {boolean} shouldPause Should the players be paused too. */ setCurrentTimes(players, time, shouldPause) { for (const actor of players) { @@ -889,7 +889,7 @@ exports.AnimationsActor = class AnimationsActor extends Actor { * Set the playback rate of several animations at the same time. * * @param {Array} actors A list of AnimationPlayerActor. - * @param {Number} rate The new rate. + * @param {number} rate The new rate. */ setPlaybackRates(players, rate) { return Promise.all( @@ -903,7 +903,7 @@ exports.AnimationsActor = class AnimationsActor extends Actor { /** * Pause given player synchronously. * - * @param {Object} player + * @param {object} player */ pauseSync(player) { player.startTime = null; @@ -912,7 +912,7 @@ exports.AnimationsActor = class AnimationsActor extends Actor { /** * Play given player synchronously. * - * @param {Object} player + * @param {object} player */ playSync(player) { if (!player.playbackRate) { @@ -929,7 +929,7 @@ exports.AnimationsActor = class AnimationsActor extends Actor { /** * Return created fime of given animaiton. * - * @param {Object} animation + * @param {object} animation */ getCreatedTime(animation) { return ( diff --git a/devtools/server/actors/blackboxing.js b/devtools/server/actors/blackboxing.js @@ -35,7 +35,7 @@ class BlackboxingActor extends Actor { * Request to blackbox a new JS file either completely if no range is passed. * Or only a precise subset of lines described by range attribute. * - * @param {String} url + * @param {string} url * Mandatory argument to mention what URL of JS file should be blackboxed. * @param {Array<Objects>} ranges * The whole file will be blackboxed if this array is empty. diff --git a/devtools/server/actors/breakpoint-list.js b/devtools/server/actors/breakpoint-list.js @@ -48,11 +48,11 @@ class BreakpointListActor extends Actor { /** * Request to break on next XHR or Fetch request for a given URL and HTTP Method. * - * @param {String} path + * @param {string} path * If empty, will pause on regardless or the request's URL. * Otherwise, will pause on any request whose URL includes this string. * This is not specific to URL's path. It can match the URL origin. - * @param {String} method + * @param {string} method * If set to "ANY", will pause regardless of which method is used. * Otherwise, should be set to any valid HTTP Method (GET, POST, ...) */ @@ -78,7 +78,7 @@ class BreakpointListActor extends Actor { /** * Set the active breakpoints * - * @param {Array<String>} ids + * @param {Array<string>} ids * An array of eventlistener breakpoint ids. These * are unique identifiers for event breakpoints. * See devtools/server/actors/utils/event-breakpoints.js diff --git a/devtools/server/actors/changes.js b/devtools/server/actors/changes.js @@ -82,7 +82,7 @@ class ChangesActor extends Actor { * * TODO: Clear changes made within sources in iframes when they navigate. Bug 1513940 * - * @param {Object} eventData + * @param {object} eventData * Event data with these properties: * { * window: Object // Window DOM object of the event source page diff --git a/devtools/server/actors/compatibility/compatibility.js b/devtools/server/actors/compatibility/compatibility.js @@ -57,15 +57,15 @@ class CompatibilityActor extends Actor { /** * Responsible for computing the compatibility issues for a list of CSS declaration blocks * - * @param {Array<Array<Object>>} domRulesDeclarations: An array of arrays of CSS declaration object + * @param {Array<Array<object>>} domRulesDeclarations: An array of arrays of CSS declaration object * @param {string} domRulesDeclarations[][].name: Declaration name * @param {string} domRulesDeclarations[][].value: Declaration value - * @param {Array<Object>} targetBrowsers: Array of target browsers () to be used to check CSS compatibility against + * @param {Array<object>} targetBrowsers: Array of target browsers () to be used to check CSS compatibility against * @param {string} targetBrowsers[].id: Browser id as specified in `devtools/shared/compatibility/datasets/browser.json` * @param {string} targetBrowsers[].name * @param {string} targetBrowsers[].version * @param {string} targetBrowsers[].status: Browser status - esr, current, beta, nightly - * @returns {Array<Array<Object>>} An Array of arrays of JSON objects with compatibility + * @returns {Array<Array<object>>} An Array of arrays of JSON objects with compatibility * information in following form: * { * // Type of compatibility issue diff --git a/devtools/server/actors/compatibility/lib/MDNCompatibility.js b/devtools/server/actors/compatibility/lib/MDNCompatibility.js @@ -162,7 +162,7 @@ class MDNCompatibility { * The terms which is checked the compatibility summary from the * database. The paremeters are passed as `rest parameters`. * e.g. _getCompatSummary(browsers, database, "user-select", ...) - * @return {Object} + * @return {object} * { * database: The passed database as a parameter, * terms: The passed terms as a parameter, @@ -224,7 +224,7 @@ class MDNCompatibility { * @param {Array} browsers * All browsers that to check * e.g. [{ id: "firefox", name: "Firefox", version: "68" }, ...] - * @return {Object} compatibility summary + * @return {object} compatibility summary */ _getCSSPropertyCompatSummary(browsers, property) { const summary = this._getCompatSummary( diff --git a/devtools/server/actors/css-properties.js b/devtools/server/actors/css-properties.js @@ -35,7 +35,7 @@ exports.CssPropertiesActor = CssPropertiesActor; * the values are objects that contain information about that property. * * @param {Document} doc - * @return {Object} + * @return {object} */ function generateCssProperties(doc) { const properties = {}; @@ -71,7 +71,7 @@ exports.generateCssProperties = generateCssProperties; * Test if a CSS is property is known using server-code. * * @param {string} name - * @return {Boolean} + * @return {boolean} */ function isCssPropertyKnown(name) { try { @@ -91,9 +91,9 @@ exports.isCssPropertyKnown = isCssPropertyKnown; * A wrapper for InspectorUtils.cssPropertySupportsType that ignores invalid * properties. * - * @param {String} name The property name. + * @param {string} name The property name. * @param {number} type The type tested for support. - * @return {Boolean} Whether the property supports the type. + * @return {boolean} Whether the property supports the type. * If the property is unknown, false is returned. */ function safeCssPropertySupportsType(name, type) { diff --git a/devtools/server/actors/descriptors/tab.js b/devtools/server/actors/descriptors/tab.js @@ -243,8 +243,8 @@ class TabDescriptorActor extends Actor { /** * Navigate this tab to a new URL. * - * @param {String} url - * @param {Boolean} waitForLoad + * @param {string} url + * @param {boolean} waitForLoad * @return {Promise} * A promise which resolves only once the requested URL is fully loaded. */ diff --git a/devtools/server/actors/emulation/responsive.js b/devtools/server/actors/emulation/responsive.js @@ -63,8 +63,8 @@ class ResponsiveActor extends Actor { * too, then we could add code in here to detect the picker mode as described in * https://bugzilla.mozilla.org/show_bug.cgi?id=1409085#c3 - * @param {Boolean} state - * @param {String} pickerType + * @param {boolean} state + * @param {string} pickerType */ setElementPickerState(state, pickerType) { this.targetActor.touchSimulator.setElementPickerState(state, pickerType); diff --git a/devtools/server/actors/emulation/touch-simulator.js b/devtools/server/actors/emulation/touch-simulator.js @@ -86,9 +86,9 @@ class TouchSimulator { * In theory only one picker can ever be active at a time, but tracking the * different pickers independantly avoids race issues in the client code. * - * @param {Boolean} state + * @param {boolean} state * True if the picker is currently active, false otherwise. - * @param {String} pickerType + * @param {string} pickerType * One of PICKER_TYPES. */ setElementPickerState(state, pickerType) { @@ -222,11 +222,11 @@ class TouchSimulator { * * @param {Window} win * The target window. - * @param {Number} clientX + * @param {number} clientX * The `x` screen coordinate relative to the viewport origin. - * @param {Number} clientY + * @param {number} clientY * The `y` screen coordinate relative to the viewport origin. - * @param {String} type + * @param {string} type * The type of the touch event. */ sendTouchEvent(win, clientX, clientY, type) { diff --git a/devtools/server/actors/events/events.js b/devtools/server/actors/events/events.js @@ -15,8 +15,8 @@ eventList.push("DOMContentLoaded"); * Reports if a given DOM Event name is probably supported by Gecko. * If it isn't, it is most likely a custom event implemented by the web page. * - * @param {String} name - * @return {Boolean} + * @param {string} name + * @return {boolean} */ exports.isUserDefinedEventName = function (name) { return !eventList.includes(name); diff --git a/devtools/server/actors/heap-snapshot-file.js b/devtools/server/actors/heap-snapshot-file.js @@ -45,7 +45,7 @@ exports.HeapSnapshotFileActor = class HeapSnapshotFileActor extends Actor { /** * @see MemoryFront.prototype.transferHeapSnapshot * - * @param {String} snapshotId + * @param {string} snapshotId * The ID returned by MemoryActor's saveHeapSnapshot method. * @param {Function} startBulkSend * Function provided by protocol.js Actor framework to initiate diff --git a/devtools/server/actors/highlighters.js b/devtools/server/actors/highlighters.js @@ -115,8 +115,8 @@ exports.CustomHighlighterActor = class CustomHighligherActor extends Actor { * provided CSS selector on. * * @param {NodeActor} The node to be highlighted - * @param {Object} Options for the custom highlighter - * @return {Boolean} True, if the highlighter has been successfully shown + * @param {object} Options for the custom highlighter + * @return {boolean} True, if the highlighter has been successfully shown */ show(node, options) { if (!this._highlighter) { diff --git a/devtools/server/actors/highlighters/accessible.js b/devtools/server/actors/highlighters/accessible.js @@ -37,19 +37,19 @@ loader.lazyRequireGetter( * h.hide(); * h.destroy(); * - * @param {Number} options.x + * @param {number} options.x * X coordinate of the top left corner of the accessible object - * @param {Number} options.y + * @param {number} options.y * Y coordinate of the top left corner of the accessible object - * @param {Number} options.w + * @param {number} options.w * Width of the the accessible object - * @param {Number} options.h + * @param {number} options.h * Height of the the accessible object - * @param {Number} options.duration + * @param {number} options.duration * Duration of time that the highlighter should be shown. - * @param {String|null} options.name + * @param {string | null} options.name * Name of the the accessible object - * @param {String} options.role + * @param {string} options.role * Role of the the accessible object * * Structure: @@ -107,7 +107,7 @@ class AccessibleHighlighter extends AutoRefreshHighlighter { /** * Build highlighter markup. * - * @return {Object} Container element for the highlighter markup. + * @return {object} Container element for the highlighter markup. */ _buildMarkup() { const container = this.markup.createNode({ @@ -180,7 +180,7 @@ class AccessibleHighlighter extends AutoRefreshHighlighter { /** * Find an element in highlighter markup. * - * @param {String} id + * @param {string} id * Highlighter markup elemet id attribute. * @return {DOMNode} Element in the highlighter markup. */ @@ -194,7 +194,7 @@ class AccessibleHighlighter extends AutoRefreshHighlighter { * @override * @param {DOMNode} node * The node to highlight. - * @return {Boolean} whether or not node is valid. + * @return {boolean} whether or not node is valid. */ _isNodeValid(node) { return ( @@ -207,7 +207,7 @@ class AccessibleHighlighter extends AutoRefreshHighlighter { /** * Show the highlighter on a given accessible. * - * @return {Boolean} True if accessible is highlighted, false otherwise. + * @return {boolean} True if accessible is highlighted, false otherwise. */ _show() { if (this._highlightTimer) { @@ -232,7 +232,7 @@ class AccessibleHighlighter extends AutoRefreshHighlighter { /** * Update and show accessible bounds for a current accessible. * - * @return {Boolean} True if accessible is highlighted, false otherwise. + * @return {boolean} True if accessible is highlighted, false otherwise. */ _update() { let shown = false; @@ -326,7 +326,7 @@ class AccessibleHighlighter extends AutoRefreshHighlighter { /** * Get current accessible bounds. * - * @return {Object|null} Returns, if available, positioning and bounds + * @return {object | null} Returns, if available, positioning and bounds * information for the accessible object. */ get _bounds() { @@ -350,7 +350,7 @@ class AccessibleHighlighter extends AutoRefreshHighlighter { * Update accessible bounds for a current accessible. Re-draw highlighter * markup. * - * @return {Boolean} True if accessible is highlighted, false otherwise. + * @return {boolean} True if accessible is highlighted, false otherwise. */ _updateAccessibleBounds() { const bounds = this._bounds; diff --git a/devtools/server/actors/highlighters/auto-refresh.js b/devtools/server/actors/highlighters/auto-refresh.js @@ -116,7 +116,7 @@ class AutoRefreshHighlighter extends EventEmitter { * Show the highlighter on a given node * * @param {DOMNode} node - * @param {Object} options + * @param {object} options * Object used for passing options */ show(node, options = {}) { @@ -172,7 +172,7 @@ class AutoRefreshHighlighter extends EventEmitter { * sub-classes should override this method if they want to highlight other node types. * * @param {DOMNode} node - * @return {Boolean} + * @return {boolean} */ _isNodeValid(node) { return isNodeValid(node); @@ -231,7 +231,7 @@ class AutoRefreshHighlighter extends EventEmitter { * Update the knowledge we have of the current node's boxquads and return true * if any of the points x/y or bounds have change since. * - * @return {Boolean} + * @return {boolean} */ _hasMoved() { const oldQuads = this.currentQuads; @@ -244,7 +244,7 @@ class AutoRefreshHighlighter extends EventEmitter { * Update the knowledge we have of the current window's scrolling offset, both * horizontal and vertical, and return `true` if they have changed since. * - * @return {Boolean} + * @return {boolean} */ _hasWindowScrolled() { if (!this.win) { @@ -264,7 +264,7 @@ class AutoRefreshHighlighter extends EventEmitter { * Update the knowledge we have of the current window's dimensions and return `true` * if they have changed since. * - * @return {Boolean} + * @return {boolean} */ _haveWindowDimensionsChanged() { const { width, height } = getWindowDimensions(this.win); diff --git a/devtools/server/actors/highlighters/box-model.js b/devtools/server/actors/highlighters/box-model.js @@ -51,18 +51,18 @@ const GUIDE_STROKE_WIDTH = 1; * h.hide(); * h.destroy(); * - * @param {String} options.region + * @param {string} options.region * Specifies the region that the guides should outline: * "content" (default), "padding", "border" or "margin". - * @param {Boolean} options.hideGuides + * @param {boolean} options.hideGuides * Defaults to false - * @param {Boolean} options.hideInfoBar + * @param {boolean} options.hideInfoBar * Defaults to false - * @param {String} options.showOnly + * @param {string} options.showOnly * If set, only this region will be highlighted. Use with onlyRegionArea * to only highlight the area of the region: * "content", "padding", "border" or "margin" - * @param {Boolean} options.onlyRegionArea + * @param {boolean} options.onlyRegionArea * This can be set to true to make each region's box only highlight the * area of the corresponding region rather than the area of nested * regions too. This is useful when used with showOnly. @@ -320,7 +320,7 @@ class BoxModelHighlighter extends AutoRefreshHighlighter { * text nodes since these can also be highlighted. * * @param {DOMNode} node - * @return {Boolean} + * @return {boolean} */ _isNodeValid(node) { return ( @@ -466,8 +466,8 @@ class BoxModelHighlighter extends AutoRefreshHighlighter { * This may happen if the BoxModelHighlighter is used to highlight an inline * element that spans line breaks. * - * @param {String} region The box-model region to get the outer quad for. - * @return {Object} A quad-like object {p1,p2,p3,p4,bounds} + * @param {string} region The box-model region to get the outer quad for. + * @return {object} A quad-like object {p1,p2,p3,p4,bounds} */ _getOuterQuad(region) { const quads = this.currentQuads[region]; @@ -665,7 +665,7 @@ class BoxModelHighlighter extends AutoRefreshHighlighter { /** * Can the current node be highlighted? Does it have quads. * - * @return {Boolean} + * @return {boolean} */ _nodeNeedsHighlighting() { return ( @@ -708,7 +708,7 @@ class BoxModelHighlighter extends AutoRefreshHighlighter { * We only want to show guides for horizontal and vertical edges as this helps * to line them up. This method finds these edges and displays a guide there. * - * @param {String} region The region around which the guides should be shown. + * @param {string} region The region around which the guides should be shown. */ _showGuides(region) { const quad = this._getOuterQuad(region); @@ -757,7 +757,7 @@ class BoxModelHighlighter extends AutoRefreshHighlighter { * Move a guide to the appropriate position and display it. If no point is * passed then the guide is hidden. * - * @param {String} side + * @param {string} side * The guide to update * @param {Integer} point * x or y co-ordinate. If this is undefined we hide the guide. diff --git a/devtools/server/actors/highlighters/css-grid.js b/devtools/server/actors/highlighters/css-grid.js @@ -147,45 +147,45 @@ const gCachedGridPattern = new Map(); * h.hide(); * h.destroy(); * - * @param {String} options.color + * @param {string} options.color * The color that should be used to draw the highlighter for this grid. - * @param {Number} options.globalAlpha + * @param {number} options.globalAlpha * The alpha (transparency) value that should be used to draw the highlighter for * this grid. - * @param {Boolean} options.showAllGridAreas + * @param {boolean} options.showAllGridAreas * Shows all the grid area highlights for the current grid if isShown is * true. - * @param {String} options.showGridArea + * @param {string} options.showGridArea * Shows the grid area highlight for the given area name. - * @param {Boolean} options.showGridAreasOverlay + * @param {boolean} options.showGridAreasOverlay * Displays an overlay of all the grid areas for the current grid * container if isShown is true. - * @param {Object} options.showGridCell + * @param {object} options.showGridCell * An object containing the grid fragment index, row and column numbers * to the corresponding grid cell to highlight for the current grid. - * @param {Number} options.showGridCell.gridFragmentIndex + * @param {number} options.showGridCell.gridFragmentIndex * Index of the grid fragment to render the grid cell highlight. - * @param {Number} options.showGridCell.rowNumber + * @param {number} options.showGridCell.rowNumber * Row number of the grid cell to highlight. - * @param {Number} options.showGridCell.columnNumber + * @param {number} options.showGridCell.columnNumber * Column number of the grid cell to highlight. - * @param {Object} options.showGridLineNames + * @param {object} options.showGridLineNames * An object containing the grid fragment index and line number to the * corresponding grid line to highlight for the current grid. - * @param {Number} options.showGridLineNames.gridFragmentIndex + * @param {number} options.showGridLineNames.gridFragmentIndex * Index of the grid fragment to render the grid line highlight. - * @param {Number} options.showGridLineNames.lineNumber + * @param {number} options.showGridLineNames.lineNumber * Line number of the grid line to highlight. - * @param {String} options.showGridLineNames.type + * @param {string} options.showGridLineNames.type * The dimension type of the grid line. - * @param {Boolean} options.showGridLineNumbers + * @param {boolean} options.showGridLineNumbers * Displays the grid line numbers on the grid lines if isShown is true. - * @param {Boolean} options.showInfiniteLines + * @param {boolean} options.showInfiniteLines * Displays an infinite line to represent the grid lines if isShown is * true. - * @param {Number} options.isParent + * @param {number} options.isParent * Set to true if this is a "parent" grid, i.e. a grid with a subgrid. - * @param {Number} options.zIndex + * @param {number} options.zIndex * The z-index to decide the displaying order. * * Structure: @@ -523,9 +523,9 @@ class CssGridHighlighter extends AutoRefreshHighlighter { * Gets the grid gap pattern used to render the gap regions based on the device * pixel ratio given. * - * @param {Number} devicePixelRatio + * @param {number} devicePixelRatio * The device pixel ratio we want the pattern for. - * @param {Object} dimension + * @param {object} dimension * Refers to the Map key for the grid dimension type which is either the * constant COLUMNS or ROWS. * @return {CanvasPattern} grid gap pattern. @@ -584,7 +584,7 @@ class CssGridHighlighter extends AutoRefreshHighlighter { * * @param {GridTracks} tracks * The grid track of a given grid dimension. - * @return {Number} index of the last edge of the explicit grid for a grid dimension. + * @return {number} index of the last edge of the explicit grid for a grid dimension. */ getLastEdgeLineIndex(tracks) { let trackIndex = tracks.length - 1; @@ -675,7 +675,7 @@ class CssGridHighlighter extends AutoRefreshHighlighter { /** * Checks if the current node has a CSS Grid layout. * - * @return {Boolean} true if the current node has a CSS grid layout, false otherwise. + * @return {boolean} true if the current node has a CSS grid layout, false otherwise. */ isGrid() { return this.currentNode.hasGridFragments(); @@ -686,8 +686,8 @@ class CssGridHighlighter extends AutoRefreshHighlighter { * may have a fragment that defines column tracks but doesn't have any rows (or vice * versa). In which case we do not want to draw anything for that fragment. * - * @param {Object} fragment - * @return {Boolean} + * @param {object} fragment + * @return {boolean} */ isValidFragment(fragment) { return fragment.cols.tracks.length && fragment.rows.tracks.length; @@ -778,7 +778,7 @@ class CssGridHighlighter extends AutoRefreshHighlighter { /** * Shows the grid area highlight for the given area name. * - * @param {String} areaName + * @param {string} areaName * Grid area name. */ showGridArea(areaName) { @@ -788,11 +788,11 @@ class CssGridHighlighter extends AutoRefreshHighlighter { /** * Shows the grid cell highlight for the given grid cell options. * - * @param {Number} options.gridFragmentIndex + * @param {number} options.gridFragmentIndex * Index of the grid fragment to render the grid cell highlight. - * @param {Number} options.rowNumber + * @param {number} options.rowNumber * Row number of the grid cell to highlight. - * @param {Number} options.columnNumber + * @param {number} options.columnNumber * Column number of the grid cell to highlight. */ showGridCell({ gridFragmentIndex, rowNumber, columnNumber }) { @@ -802,11 +802,11 @@ class CssGridHighlighter extends AutoRefreshHighlighter { /** * Shows the grid line highlight for the given grid line options. * - * @param {Number} options.gridFragmentIndex + * @param {number} options.gridFragmentIndex * Index of the grid fragment to render the grid line highlight. - * @param {Number} options.lineNumber + * @param {number} options.lineNumber * Line number of the grid line to highlight. - * @param {String} options.type + * @param {string} options.type * The dimension type of the grid line. */ showGridLineNames({ gridFragmentIndex, lineNumber, type }) { @@ -886,7 +886,7 @@ class CssGridHighlighter extends AutoRefreshHighlighter { /** * Render the grid area highlight for the given area name or for all the grid areas. * - * @param {String} areaName + * @param {string} areaName * Name of the grid area to be highlighted. If no area name is provided, all * the grid areas should be highlighted. */ @@ -954,9 +954,9 @@ class CssGridHighlighter extends AutoRefreshHighlighter { /** * Render grid area name on the containing grid area cell. * - * @param {Object} fragment + * @param {object} fragment * The grid fragment of the grid container. - * @param {Object} area + * @param {object} area * The area overlay to render on the CSS highlighter canvas. */ renderGridAreaName(fragment, area) { @@ -1101,11 +1101,11 @@ class CssGridHighlighter extends AutoRefreshHighlighter { * Render the grid cell highlight for the given grid fragment index, row and column * number. * - * @param {Number} gridFragmentIndex + * @param {number} gridFragmentIndex * Index of the grid fragment to render the grid cell highlight. - * @param {Number} rowNumber + * @param {number} rowNumber * Row number of the grid cell to highlight. - * @param {Number} columnNumber + * @param {number} columnNumber * Column number of the grid cell to highlight. */ renderGridCell(gridFragmentIndex, rowNumber, columnNumber) { @@ -1156,16 +1156,16 @@ class CssGridHighlighter extends AutoRefreshHighlighter { /** * Render the grid gap area on the css grid highlighter canvas. * - * @param {Number} linePos + * @param {number} linePos * The line position along the x-axis for a column grid line and * y-axis for a row grid line. - * @param {Number} startPos + * @param {number} startPos * The start position of the cross side of the grid line. - * @param {Number} endPos + * @param {number} endPos * The end position of the cross side of the grid line. - * @param {Number} breadth + * @param {number} breadth * The grid line breadth value. - * @param {String} dimensionType + * @param {string} dimensionType * The grid dimension type which is either the constant COLUMNS or ROWS. */ renderGridGap(linePos, startPos, endPos, breadth, dimensionType) { @@ -1233,11 +1233,11 @@ class CssGridHighlighter extends AutoRefreshHighlighter { * Render the grid line name highlight for the given grid fragment index, lineNumber, * and dimensionType. * - * @param {Number} gridFragmentIndex + * @param {number} gridFragmentIndex * Index of the grid fragment to render the grid line highlight. - * @param {Number} lineNumber + * @param {number} lineNumber * Line number of the grid line to highlight. - * @param {String} dimensionType + * @param {string} dimensionType * The dimension type of the grid line. */ renderGridLineNames(gridFragmentIndex, lineNumber, dimensionType) { @@ -1283,16 +1283,16 @@ class CssGridHighlighter extends AutoRefreshHighlighter { /** * Render the grid line number on the css grid highlighter canvas. * - * @param {Number} lineNumber + * @param {number} lineNumber * The grid line number. - * @param {Number} linePos + * @param {number} linePos * The line position along the x-axis for a column grid line and * y-axis for a row grid line. - * @param {Number} startPos + * @param {number} startPos * The start position of the cross side of the grid line. - * @param {Number} breadth + * @param {number} breadth * The grid line breadth value. - * @param {String} dimensionType + * @param {string} dimensionType * The grid dimension type which is either the constant COLUMNS or ROWS. * @param {Boolean||undefined} isStackedLine * Boolean indicating if the line is stacked. @@ -1517,11 +1517,11 @@ class CssGridHighlighter extends AutoRefreshHighlighter { /** * Determine which edge of a line number box to aim the line number arrow at. * - * @param {String} dimensionType + * @param {string} dimensionType * The grid line dimension type which is either the constant COLUMNS or ROWS. - * @param {Number} lineNumber + * @param {number} lineNumber * The grid line number. - * @return {String} The edge of the box: top, right, bottom or left. + * @return {string} The edge of the box: top, right, bottom or left. */ getBoxEdge(dimensionType, lineNumber) { let boxEdge; @@ -1578,16 +1578,16 @@ class CssGridHighlighter extends AutoRefreshHighlighter { /** * Render the grid line on the css grid highlighter canvas. * - * @param {Number} linePos + * @param {number} linePos * The line position along the x-axis for a column grid line and * y-axis for a row grid line. - * @param {Number} startPos + * @param {number} startPos * The start position of the cross side of the grid line. - * @param {Number} endPos + * @param {number} endPos * The end position of the cross side of the grid line. - * @param {String} dimensionType + * @param {string} dimensionType * The grid dimension type which is either the constant COLUMNS or ROWS. - * @param {String} lineType + * @param {string} lineType * The grid line type - "edge", "explicit", or "implicit". */ renderLine(linePos, startPos, endPos, dimensionType, lineType) { @@ -1645,14 +1645,14 @@ class CssGridHighlighter extends AutoRefreshHighlighter { * * @param {GridDimension} gridDimension * Column or row grid dimension object. - * @param {Object} quad.bounds + * @param {object} quad.bounds * The content bounds of the box model region quads. - * @param {String} dimensionType + * @param {string} dimensionType * The grid dimension type which is either the constant COLUMNS or ROWS. - * @param {Number} startPos + * @param {number} startPos * The start position of the cross side ("left" for ROWS and "top" for COLUMNS) * of the grid dimension. - * @param {Number} endPos + * @param {number} endPos * The end position of the cross side ("left" for ROWS and "top" for COLUMNS) * of the grid dimension. */ @@ -1702,9 +1702,9 @@ class CssGridHighlighter extends AutoRefreshHighlighter { * * @param {GridDimension} gridDimension * Column or row grid dimension object. - * @param {String} dimensionType + * @param {string} dimensionType * The grid dimension type which is either the constant COLUMNS or ROWS. - * @param {Number} startPos + * @param {number} startPos * The start position of the cross side ("left" for ROWS and "top" for COLUMNS) * of the grid dimension. */ @@ -1762,9 +1762,9 @@ class CssGridHighlighter extends AutoRefreshHighlighter { * * @param {GridDimension} gridDimension * Column or row grid dimension object. - * @param {String} dimensionType + * @param {string} dimensionType * The grid dimension type which is either the constant COLUMNS or ROWS. - * @param {Number} startPos + * @param {number} startPos * The start position of the cross side ("left" for ROWS and "top" for COLUMNS) * of the grid dimension. */ @@ -1880,7 +1880,7 @@ class CssGridHighlighter extends AutoRefreshHighlighter { * * @param {GridArea} area * The grid area object. - * @param {Object} bounds + * @param {object} bounds * A DOMRect-like object represent the grid area rectangle. */ _updateGridAreaInfobar(area, bounds) { @@ -1902,11 +1902,11 @@ class CssGridHighlighter extends AutoRefreshHighlighter { /** * Update the grid information displayed in the grid cell info bar. * - * @param {Number} rowNumber + * @param {number} rowNumber * The grid cell's row number. - * @param {Number} columnNumber + * @param {number} columnNumber * The grid cell's column number. - * @param {Object} bounds + * @param {object} bounds * A DOMRect-like object represent the grid cell rectangle. */ _updateGridCellInfobar(rowNumber, columnNumber, bounds) { @@ -1932,13 +1932,13 @@ class CssGridHighlighter extends AutoRefreshHighlighter { /** * Update the grid information displayed in the grid line info bar. * - * @param {String} gridLineNames + * @param {string} gridLineNames * Comma-separated string of names for the grid line. - * @param {Number} gridLineNumber + * @param {number} gridLineNumber * The grid line number. - * @param {Number} x + * @param {number} x * The x-coordinate of the grid line. - * @param {Number} y + * @param {number} y * The y-coordinate of the grid line. */ _updateGridLineInfobar(gridLineNames, gridLineNumber, x, y) { diff --git a/devtools/server/actors/highlighters/eye-dropper.js b/devtools/server/actors/highlighters/eye-dropper.js @@ -143,7 +143,7 @@ class EyeDropper { * Show the eye-dropper highlighter. * * @param {DOMNode} node The node which document the highlighter should be inserted in. - * @param {Object} options The options object may contain the following properties: + * @param {object} options The options object may contain the following properties: * - {Boolean} copyOnSelect: Whether selecting a color should copy it to the clipboard. * - {String|null} screenshot: a dataURL representation of the page screenshot. If null, * the eyedropper will use `drawWindow` to get the the screenshot @@ -241,7 +241,7 @@ class EyeDropper { * Create an image bitmap from the page screenshot, draw the eyedropper and set the * "drawn" attribute on the "root" element once it's done. * - * @params {String|null} screenshot: a dataURL representation of the page screenshot. + * @params {string | null} screenshot: a dataURL representation of the page screenshot. * If null, we'll use `drawWindow` to get the the page screenshot * (⚠️ but it won't handle remote frames). */ @@ -591,7 +591,7 @@ function getWindowAsImageData(win) { /** * Get a formatted CSS color string from a color value. * - * @param {array} rgb Rgb values of a color to format. + * @param {Array} rgb Rgb values of a color to format. * @param {string} format Format of string. One of "hex", "rgb", "hsl", "name". * @return {string} Formatted color value, e.g. "#FFF" or "hsl(20, 10%, 10%)". */ @@ -617,7 +617,7 @@ function toColorString(rgb, format) { /** * Produce a hex-formatted color string from rgb values. * - * @param {array} rgb Rgb values of color to stringify. + * @param {Array} rgb Rgb values of color to stringify. * @return {string} Hex formatted string for color, e.g. "#FFEE00". */ function hexString([r, g, b]) { diff --git a/devtools/server/actors/highlighters/flexbox.js b/devtools/server/actors/highlighters/flexbox.js @@ -61,7 +61,7 @@ const JUSTIFY_CONTENT = "justify-content"; * The FlexboxHighlighter is the class that overlays a visual canvas on top of * display: [inline-]flex elements. * - * @param {String} options.color + * @param {string} options.color * The color that should be used to draw the highlighter for this flexbox. * Structure: * <div class="highlighter-container"> @@ -209,7 +209,7 @@ class FlexboxHighlighter extends AutoRefreshHighlighter { /** * Gets the flexbox container pattern used to render the container regions. * - * @param {Number} devicePixelRatio + * @param {number} devicePixelRatio * The device pixel ratio we want the pattern for. * @return {CanvasPattern} flex container pattern. */ @@ -256,7 +256,7 @@ class FlexboxHighlighter extends AutoRefreshHighlighter { /** * Gets the flexbox justify content pattern used to render the justify content regions. * - * @param {Number} devicePixelRatio + * @param {number} devicePixelRatio * The device pixel ratio we want the pattern for. * @return {CanvasPattern} flex justify content pattern. */ @@ -761,7 +761,7 @@ class FlexboxHighlighter extends AutoRefreshHighlighter { /** * Set up the canvas with the given options prior to drawing. * - * @param {String} [options.lineDash = null] + * @param {string} [options.lineDash = null] * An Array of numbers that specify distances to alternately draw a * line and a gap (in coordinate space units). If the number of * elements in the array is odd, the elements of the array get copied @@ -773,13 +773,13 @@ class FlexboxHighlighter extends AutoRefreshHighlighter { * FLEXBOX_LINES_PROPERTIES.edge.lineDash, * FLEXBOX_LINES_PROPERTIES.item.lineDash * FLEXBOX_LINES_PROPERTIES.alignItems.lineDash - * @param {Number} [options.lineWidthMultiplier = 1] + * @param {number} [options.lineWidthMultiplier = 1] * The width of the line. - * @param {Number} [options.offset = `(displayPixelRatio / 2) % 1`] + * @param {number} [options.offset = `(displayPixelRatio / 2) % 1`] * The single line width used to obtain a crisp line. - * @param {Boolean} [options.skipLineAndStroke = false] + * @param {boolean} [options.skipLineAndStroke = false] * Skip the setting of lineWidth and strokeStyle. - * @param {Boolean} [options.useContainerScrollOffsets = false] + * @param {boolean} [options.useContainerScrollOffsets = false] * Take the flexbox container's scroll and zoom offsets into account. * This is needed for drawing flex lines and justify content when the * flexbox container itself is display:scroll. @@ -883,7 +883,7 @@ class FlexboxHighlighter extends AutoRefreshHighlighter { * * @param {DOMNode} container * The flex container. - * @return {Object|null} representation of the Flex data object. + * @return {object | null} representation of the Flex data object. */ function getFlexData(container) { const flex = container.getAsFlexContainer(); @@ -957,7 +957,7 @@ function getRectFromFlexItemValues(item, container) { * The old Flex data object. * @param {Flex} newFlexData * The new Flex data object. - * @return {Boolean} true if the flex data has changed and false otherwise. + * @return {boolean} true if the flex data has changed and false otherwise. */ // eslint-disable-next-line complexity function compareFlexData(oldFlexData, newFlexData) { diff --git a/devtools/server/actors/highlighters/fonts.js b/devtools/server/actors/highlighters/fonts.js @@ -63,7 +63,7 @@ class FontsHighlighter { * Show the highlighter for a given node. * * @param {DOMNode} node The node in which we want to search for text runs. - * @param {Object} options A bunch of options that can be set: + * @param {object} options A bunch of options that can be set: * - {String} name The actual font name to look for in the node. * - {String} CSSFamilyName The CSS font-family name given to this font. */ diff --git a/devtools/server/actors/highlighters/geometry-editor.js b/devtools/server/actors/highlighters/geometry-editor.js @@ -99,7 +99,7 @@ var GeoProp = { * non-positioned itself, we just return null to let consumers know the node is * actually positioned relative to the viewport. * - * @return {Object} + * @return {object} */ function getOffsetParent(node) { const win = node.ownerGlobal; diff --git a/devtools/server/actors/highlighters/node-tabbing-order.js b/devtools/server/actors/highlighters/node-tabbing-order.js @@ -35,7 +35,7 @@ loader.lazyRequireGetter( * h.hide(); * h.destroy(); * - * @param {Number} options.index + * @param {number} options.index * Tabbing index value to be displayed in the highlighter info bar. */ class NodeTabbingOrderHighlighter extends AutoRefreshHighlighter { @@ -128,7 +128,7 @@ class NodeTabbingOrderHighlighter extends AutoRefreshHighlighter { /** * Update focused styling for a node tabbing index highlight. * - * @param {Boolean} focused + * @param {boolean} focused * Indicates if the highlighted node needs to be focused. */ updateFocus(focused) { @@ -230,7 +230,7 @@ class NodeTabbingOrderHighlighter extends AutoRefreshHighlighter { /** * Calculate border bounds based on the quads returned by getAdjustedQuads. * - * @return {Object} A bounds object {bottom,height,left,right,top,width,x,y} + * @return {object} A bounds object {bottom,height,left,right,top,width,x,y} */ _getBorderBounds() { const quads = this.currentQuads.border; @@ -292,7 +292,7 @@ class NodeTabbingOrderHighlighter extends AutoRefreshHighlighter { /** * Can the current node be highlighted? Does it have quads. * - * @return {Boolean} + * @return {boolean} */ _nodeNeedsHighlighting() { return ( @@ -336,7 +336,7 @@ class NodeTabbingOrderHighlighter extends AutoRefreshHighlighter { * * @param {DOMNode} container * The container element which will be used to position the infobar. - * @param {Object} bounds + * @param {object} bounds * The content bounds of the container element. * @param {Window} win * The window object. diff --git a/devtools/server/actors/highlighters/selector.js b/devtools/server/actors/highlighters/selector.js @@ -32,10 +32,10 @@ class SelectorHighlighter { * @param {DOMNode} node * A context node used to get the document element on which to run * querySelectorAll(). This node will not be highlighted. - * @param {Object} options + * @param {object} options * Configuration options for SelectorHighlighter. * All of the options for BoxModelHighlighter.show() are also valid here. - * @param {String} options.selector + * @param {string} options.selector * Required. CSS selector used with querySelectorAll() to find matching elements. */ async show(node, options = {}) { @@ -80,7 +80,7 @@ class SelectorHighlighter { * * @param {DOMNode} node * Node to be highlighted - * @param {Object} options + * @param {object} options * Configuration options for the BoxModelHighlighter * @return {Promise} Promise that resolves when the BoxModelHighlighter is ready */ diff --git a/devtools/server/actors/highlighters/shapes.js b/devtools/server/actors/highlighters/shapes.js @@ -77,9 +77,9 @@ const _dragging = Symbol("shapes/dragging"); * A refresher for coordinates and change of basis that may be helpful: * https://www.math.ubc.ca/~behrend/math221/Coords.pdf * - * @param {String} options.hoverPoint + * @param {string} options.hoverPoint * The point to highlight. - * @param {Boolean} options.transformMode + * @param {boolean} options.transformMode * Whether to show the highlighter in transforms mode. * @param {} options.mode */ @@ -442,7 +442,7 @@ class ShapesHighlighter extends AutoRefreshHighlighter { * mouse position, resulting in an undesirable visual effect where the cursor * rapidly flickers between "grab" and "auto". * - * @param {String} cursorType the name of the cursor to display + * @param {string} cursorType the name of the cursor to display */ setCursor(cursorType) { const container = this.getElement("shapes-root"); @@ -465,7 +465,7 @@ class ShapesHighlighter extends AutoRefreshHighlighter { * a virtual viewport which ensures some element remains visible even when at the edges * of the actual viewport. * - * @param {Number} padding + * @param {number} padding * Optional. Amount by which to inset the viewport in all directions. */ setViewport(padding = 0) { @@ -609,8 +609,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Handle a mouse click in transform mode. * - * @param {Number} pageX the x coordinate of the mouse - * @param {Number} pageY the y coordinate of the mouse + * @param {number} pageX the x coordinate of the mouse + * @param {number} pageY the y coordinate of the mouse */ _handleTransformClick(pageX, pageY) { const { percentX, percentY } = this.convertPageCoordsToPercent( @@ -636,9 +636,9 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Handle a click in transform mode while highlighting a polygon. * - * @param {Number} pageX the x coordinate of the mouse. - * @param {Number} pageY the y coordinate of the mouse. - * @param {String} type the type of transform handle that was clicked. + * @param {number} pageX the x coordinate of the mouse. + * @param {number} pageY the y coordinate of the mouse. + * @param {string} type the type of transform handle that was clicked. */ _handlePolygonTransformClick(pageX, pageY, type) { const { width, height } = this.currentDimensions; @@ -669,9 +669,9 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Handle a click in transform mode while highlighting a circle. * - * @param {Number} pageX the x coordinate of the mouse. - * @param {Number} pageY the y coordinate of the mouse. - * @param {String} type the type of transform handle that was clicked. + * @param {number} pageX the x coordinate of the mouse. + * @param {number} pageY the y coordinate of the mouse. + * @param {string} type the type of transform handle that was clicked. */ _handleCircleTransformClick(pageX, pageY, type) { const { width, height } = this.currentDimensions; @@ -715,9 +715,9 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Handle a click in transform mode while highlighting an ellipse. * - * @param {Number} pageX the x coordinate of the mouse. - * @param {Number} pageY the y coordinate of the mouse. - * @param {String} type the type of transform handle that was clicked. + * @param {number} pageX the x coordinate of the mouse. + * @param {number} pageY the y coordinate of the mouse. + * @param {string} type the type of transform handle that was clicked. */ _handleEllipseTransformClick(pageX, pageY, type) { const { width, height } = this.currentDimensions; @@ -767,9 +767,9 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Handle a click in transform mode while highlighting an inset. * - * @param {Number} pageX the x coordinate of the mouse. - * @param {Number} pageY the y coordinate of the mouse. - * @param {String} type the type of transform handle that was clicked. + * @param {number} pageX the x coordinate of the mouse. + * @param {number} pageY the y coordinate of the mouse. + * @param {string} type the type of transform handle that was clicked. */ _handleInsetTransformClick(pageX, pageY, type) { const { width, height } = this.currentDimensions; @@ -798,8 +798,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Handle mouse movement after a click on a handle in transform mode. * - * @param {Number} pageX the x coordinate of the mouse - * @param {Number} pageY the y coordinate of the mouse + * @param {number} pageX the x coordinate of the mouse + * @param {number} pageY the y coordinate of the mouse */ _handleTransformMove(pageX, pageY) { const { type } = this[_dragging]; @@ -817,8 +817,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Translates a shape based on the current mouse position. * - * @param {Number} pageX the x coordinate of the mouse. - * @param {Number} pageY the y coordinate of the mouse. + * @param {number} pageX the x coordinate of the mouse. + * @param {number} pageY the y coordinate of the mouse. */ _translateShape(pageX, pageY) { const { x, y, matrix } = this[_dragging]; @@ -840,8 +840,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Scales a shape according to the current mouse position. * - * @param {Number} pageX the x coordinate of the mouse. - * @param {Number} pageY the y coordinate of the mouse. + * @param {number} pageX the x coordinate of the mouse. + * @param {number} pageY the y coordinate of the mouse. */ _scaleShape(pageX, pageY) { /** @@ -937,8 +937,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Rotates a polygon based on the current mouse position. * - * @param {Number} pageX the x coordinate of the mouse. - * @param {Number} pageY the y coordinate of the mouse. + * @param {number} pageX the x coordinate of the mouse. + * @param {number} pageY the y coordinate of the mouse. */ _rotateShape(pageX, pageY) { const { matrix } = this[_dragging]; @@ -1003,7 +1003,7 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Transform a circle depending on the current transformation matrix. * - * @param {Number} transX the number of pixels the shape is translated on the x axis + * @param {number} transX the number of pixels the shape is translated on the x axis * before scaling */ _transformCircle(transX = null) { @@ -1034,9 +1034,9 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Transform an ellipse depending on the current transformation matrix. * - * @param {Number} transX the number of pixels the shape is translated on the x axis + * @param {number} transX the number of pixels the shape is translated on the x axis * before scaling - * @param {Number} transY the number of pixels the shape is translated on the y axis + * @param {number} transY the number of pixels the shape is translated on the y axis * before scaling */ _transformEllipse(transX = null, transY = null) { @@ -1115,8 +1115,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Handle a click when highlighting a polygon. * - * @param {Number} pageX the x coordinate of the click - * @param {Number} pageY the y coordinate of the click + * @param {number} pageX the x coordinate of the click + * @param {number} pageY the y coordinate of the click */ _handlePolygonClick(pageX, pageY) { const { width, height } = this.currentDimensions; @@ -1158,8 +1158,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter { * Update the dragged polygon point with the given x/y coords and update * the element style. * - * @param {Number} pageX the new x coordinate of the point - * @param {Number} pageY the new y coordinate of the point + * @param {number} pageX the new x coordinate of the point + * @param {number} pageY the new y coordinate of the point */ _handlePolygonMove(pageX, pageY) { const { point, unitX, unitY, valueX, valueY, ratioX, ratioY, x, y } = @@ -1187,9 +1187,9 @@ class ShapesHighlighter extends AutoRefreshHighlighter { * TODO: Bug 1436054 - Do not default to percentage unit when inserting new point. * https://bugzilla.mozilla.org/show_bug.cgi?id=1436054 * - * @param {Number} after the index of the point that the new point should be added after - * @param {Number} x the x coordinate of the new point - * @param {Number} y the y coordinate of the new point + * @param {number} after the index of the point that the new point should be added after + * @param {number} x the x coordinate of the new point + * @param {number} y the y coordinate of the new point */ _addPolygonPoint(after, x, y) { let polygonDef = this.fillRule ? `${this.fillRule}, ` : ""; @@ -1210,7 +1210,7 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Remove point from polygon defintion and update the element style. * - * @param {Number} point the index of the point to delete + * @param {number} point the index of the point to delete */ _deletePolygonPoint(point) { const coordinates = this.coordUnits.slice(); @@ -1230,8 +1230,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Handle a click when highlighting a circle. * - * @param {Number} pageX the x coordinate of the click - * @param {Number} pageY the y coordinate of the click + * @param {number} pageX the x coordinate of the click + * @param {number} pageY the y coordinate of the click */ _handleCircleClick(pageX, pageY) { const { width, height } = this.currentDimensions; @@ -1285,10 +1285,10 @@ class ShapesHighlighter extends AutoRefreshHighlighter { * Set the center/radius of the circle according to the mouse position and * update the element style. * - * @param {String} point either "center" or "radius" - * @param {Number} pageX the x coordinate of the mouse position, in terms of % + * @param {string} point either "center" or "radius" + * @param {number} pageX the x coordinate of the mouse position, in terms of % * relative to the element - * @param {Number} pageY the y coordinate of the mouse position, in terms of % + * @param {number} pageY the y coordinate of the mouse position, in terms of % * relative to the element */ _handleCircleMove(point, pageX, pageY) { @@ -1335,8 +1335,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Handle a click when highlighting an ellipse. * - * @param {Number} pageX the x coordinate of the click - * @param {Number} pageY the y coordinate of the click + * @param {number} pageX the x coordinate of the click + * @param {number} pageY the y coordinate of the click */ _handleEllipseClick(pageX, pageY) { const { width, height } = this.currentDimensions; @@ -1398,10 +1398,10 @@ class ShapesHighlighter extends AutoRefreshHighlighter { * Set center/rx/ry of the ellispe according to the mouse position and update the * element style. * - * @param {String} point "center", "rx", or "ry" - * @param {Number} pageX the x coordinate of the mouse position, in terms of % + * @param {string} point "center", "rx", or "ry" + * @param {number} pageX the x coordinate of the mouse position, in terms of % * relative to the element - * @param {Number} pageY the y coordinate of the mouse position, in terms of % + * @param {number} pageY the y coordinate of the mouse position, in terms of % * relative to the element */ _handleEllipseMove(point, pageX, pageY) { @@ -1460,8 +1460,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Handle a click when highlighting an inset. * - * @param {Number} pageX the x coordinate of the click - * @param {Number} pageY the y coordinate of the click + * @param {number} pageX the x coordinate of the click + * @param {number} pageY the y coordinate of the click */ _handleInsetClick(pageX, pageY) { const { width, height } = this.currentDimensions; @@ -1490,10 +1490,10 @@ class ShapesHighlighter extends AutoRefreshHighlighter { * Set the top/left/right/bottom of the inset shape according to the mouse position * and update the element style. * - * @param {String} point "top", "left", "right", or "bottom" - * @param {Number} pageX the x coordinate of the mouse position, in terms of % + * @param {string} point "top", "left", "right", or "bottom" + * @param {number} pageX the x coordinate of the mouse position, in terms of % * relative to the element - * @param {Number} pageY the y coordinate of the mouse position, in terms of % + * @param {number} pageY the y coordinate of the mouse position, in terms of % * relative to the element * @memberof ShapesHighlighter */ @@ -1571,7 +1571,7 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Change the appearance of the given marker when the mouse hovers over it. * - * @param {String|Number} point if the shape is a polygon, the integer index of the + * @param {string | number} point if the shape is a polygon, the integer index of the * point being hovered. Otherwise, a string identifying the point being hovered. * Integers < 0 and falsey values excluding 0 indicate no point is being hovered. */ @@ -1715,9 +1715,9 @@ class ShapesHighlighter extends AutoRefreshHighlighter { * Convert the given coordinates on the page to percentages relative to the current * element. * - * @param {Number} pageX the x coordinate on the page - * @param {Number} pageY the y coordinate on the page - * @returns {Object} object of form {percentX, percentY}, which are the x/y coords + * @param {number} pageX the x coordinate on the page + * @param {number} pageY the y coordinate on the page + * @returns {object} object of form {percentX, percentY}, which are the x/y coords * in percentages relative to the element. */ convertPageCoordsToPercent(pageX, pageY) { @@ -1735,9 +1735,9 @@ class ShapesHighlighter extends AutoRefreshHighlighter { * Convert the given x/y coordinates, in percentages relative to the current element, * to pixel coordinates relative to the page * - * @param {Number} x the x coordinate - * @param {Number} y the y coordinate - * @returns {Object} object of form {x, y}, which are the x/y coords in pixels + * @param {number} x the x coordinate + * @param {number} y the y coordinate + * @returns {object} object of form {x, y}, which are the x/y coords in pixels * relative to the page * * @memberof ShapesHighlighter @@ -1755,9 +1755,9 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Get which transformation should be applied based on the mouse position. * - * @param {Number} pageX the x coordinate of the mouse. - * @param {Number} pageY the y coordinate of the mouse. - * @returns {String} a string describing the transformation that should be applied + * @param {number} pageX the x coordinate of the mouse. + * @param {number} pageY the y coordinate of the mouse. + * @returns {string} a string describing the transformation that should be applied * to the shape. */ getTransformPointAt(pageX, pageY) { @@ -1815,9 +1815,9 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Get the id of the point on the polygon highlighter at the given coordinate. * - * @param {Number} pageX the x coordinate on the page, in % relative to the element - * @param {Number} pageY the y coordinate on the page, in % relative to the element - * @returns {Number} the index of the point that was clicked on in this.coordinates, + * @param {number} pageX the x coordinate on the page, in % relative to the element + * @param {number} pageY the y coordinate on the page, in % relative to the element + * @returns {number} the index of the point that was clicked on in this.coordinates, * or -1 if none of the points were clicked on. */ getPolygonPointAt(pageX, pageY) { @@ -1846,8 +1846,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter { * Check if the mouse clicked on a line of the polygon, and if so, add a point near * the click. * - * @param {Number} pageX the x coordinate on the page, in % relative to the element - * @param {Number} pageY the y coordinate on the page, in % relative to the element + * @param {number} pageX the x coordinate on the page, in % relative to the element + * @param {number} pageY the y coordinate on the page, in % relative to the element */ getPolygonClickedLine(pageX, pageY) { const { coordinates } = this; @@ -1880,9 +1880,9 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Check if the center point or radius of the circle highlighter is at given coords * - * @param {Number} pageX the x coordinate on the page, in % relative to the element - * @param {Number} pageY the y coordinate on the page, in % relative to the element - * @returns {String} "center" if the center point was clicked, "radius" if the radius + * @param {number} pageX the x coordinate on the page, in % relative to the element + * @param {number} pageY the y coordinate on the page, in % relative to the element + * @returns {string} "center" if the center point was clicked, "radius" if the radius * was clicked, "" if neither was clicked. */ getCirclePointAt(pageX, pageY) { @@ -1920,9 +1920,9 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Check if the center or rx/ry points of the ellipse highlighter is at given point * - * @param {Number} pageX the x coordinate on the page, in % relative to the element - * @param {Number} pageY the y coordinate on the page, in % relative to the element - * @returns {String} "center" if the center point was clicked, "rx" if the x-radius + * @param {number} pageX the x coordinate on the page, in % relative to the element + * @param {number} pageY the y coordinate on the page, in % relative to the element + * @returns {string} "center" if the center point was clicked, "rx" if the x-radius * point was clicked, "ry" if the y-radius point was clicked, * "" if none was clicked. */ @@ -1951,9 +1951,9 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Check if the edges of the inset highlighter is at given coords * - * @param {Number} pageX the x coordinate on the page, in % relative to the element - * @param {Number} pageY the y coordinate on the page, in % relative to the element - * @returns {String} "top", "left", "right", or "bottom" if any of those edges were + * @param {number} pageX the x coordinate on the page, in % relative to the element + * @param {number} pageY the y coordinate on the page, in % relative to the element + * @returns {string} "top", "left", "right", or "bottom" if any of those edges were * clicked. "" if none were clicked. */ // eslint-disable-next-line complexity @@ -2029,8 +2029,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter { * Parses the CSS definition given and returns the shape type associated * with the definition and the coordinates necessary to draw the shape. * - * @param {String} definition the input CSS definition - * @returns {Object} null if the definition is not of a known shape type, + * @param {string} definition the input CSS definition + * @returns {object} null if the definition is not of a known shape type, * or an object of the type { shapeType, coordinates }, where * shapeType is the name of the shape and coordinates are an array * or object of the coordinates needed to draw the shape. @@ -2100,7 +2100,7 @@ class ShapesHighlighter extends AutoRefreshHighlighter { * Parses the definition of the CSS polygon() function and returns its points, * converted to percentages. * - * @param {String} definition the arguments of the polygon() function + * @param {string} definition the arguments of the polygon() function * @returns {Array} an array of the points of the polygon, with all values * evaluated and converted to percentages */ @@ -2173,8 +2173,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter { * Parses the definition of the CSS circle() function and returns the x/y radiuses and * center coordinates, converted to percentages. * - * @param {String} definition the arguments of the circle() function - * @returns {Object} an object of the form { rx, ry, cx, cy }, where rx and ry are the + * @param {string} definition the arguments of the circle() function + * @returns {object} an object of the form { rx, ry, cx, cy }, where rx and ry are the * radiuses for the x and y axes, and cx and cy are the x/y coordinates for the * center of the circle. All values are evaluated and converted to percentages. */ @@ -2240,7 +2240,7 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Parse the raw (non-computed) definition of the CSS circle. * - * @returns {Object} an object of the points of the circle (cx, cy, radius), + * @returns {object} an object of the points of the circle (cx, cy, radius), * with units preserved. */ circleRawPoints() { @@ -2266,8 +2266,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter { * Parses the computed style definition of the CSS ellipse() function and returns the * x/y radii and center coordinates, converted to percentages. * - * @param {String} definition the arguments of the ellipse() function - * @returns {Object} an object of the form { rx, ry, cx, cy }, where rx and ry are the + * @param {string} definition the arguments of the ellipse() function + * @returns {object} an object of the form { rx, ry, cx, cy }, where rx and ry are the * radiuses for the x and y axes, and cx and cy are the x/y coordinates for the * center of the ellipse. All values are evaluated and converted to percentages */ @@ -2315,7 +2315,7 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Parse the raw (non-computed) definition of the CSS ellipse. * - * @returns {Object} an object of the points of the ellipse (cx, cy, rx, ry), + * @returns {object} an object of the points of the ellipse (cx, cy, rx, ry), * with units preserved. */ ellipseRawPoints() { @@ -2346,8 +2346,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter { * width/height of the shape, converted to percentages. Border radiuses (given after * "round" in the definition) are currently ignored. * - * @param {String} definition the arguments of the inset() function - * @returns {Object} an object of the form { x, y, width, height }, which are the top/ + * @param {string} definition the arguments of the inset() function + * @returns {object} an object of the form { x, y, width, height }, which are the top/ * left positions and width/height of the shape. */ insetPoints(definition) { @@ -2398,7 +2398,7 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Parse the raw (non-computed) definition of the CSS inset. * - * @returns {Object} an object of the points of the inset (top, right, bottom, left), + * @returns {object} an object of the points of the inset (top, right, bottom, left), * with units preserved. */ insetRawPoints() { @@ -2445,9 +2445,9 @@ class ShapesHighlighter extends AutoRefreshHighlighter { * computation. See `convertCoordsToPercentFromCurrentDimension()` if you * need to specify width or height. * - * @param {Number} coord a single coordinate - * @param {Number} i the index of its position in the function - * @returns {Number} the coordinate as a percentage value + * @param {number} coord a single coordinate + * @param {number} i the index of its position in the function + * @returns {number} the coordinate as a percentage value */ convertCoordsToPercent(coord, i) { const { width, height } = this.currentDimensions; @@ -2461,10 +2461,10 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Converts a value to percent based on the specified dimension. * - * @param {Number} coord a single coordinate - * @param {Number} currentDimensionProperty the dimension ("width" or + * @param {number} coord a single coordinate + * @param {number} currentDimensionProperty the dimension ("width" or * "height") to base the calculation off of - * @returns {Number} the coordinate as a percentage value + * @returns {number} the coordinate as a percentage value */ convertCoordsToPercentFromCurrentDimension(coord, currentDimensionProperty) { const size = this.currentDimensions[currentDimensionProperty]; @@ -2492,8 +2492,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Get the element in the highlighter markup with the given id * - * @param {String} id - * @returns {Object} the element with the given id + * @param {string} id + * @returns {object} the element with the given id */ getElement(id) { return this.markup.getElement(id); @@ -2502,7 +2502,7 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Return whether all the elements used to draw shapes are hidden. * - * @returns {Boolean} + * @returns {boolean} */ areShapesHidden() { return ( @@ -2608,7 +2608,7 @@ class ShapesHighlighter extends AutoRefreshHighlighter { * Update the highlighter for the current node. Called whenever the element's quads * or CSS shape has changed. * - * @returns {Boolean} whether the highlighter was successfully updated + * @returns {boolean} whether the highlighter was successfully updated */ _update() { setIgnoreLayoutChanges(true); @@ -2668,9 +2668,9 @@ class ShapesHighlighter extends AutoRefreshHighlighter { * Update the SVGs to render the current CSS shape and add markers depending on shape * type and transform mode. * - * @param {Number} width the width of the element quads - * @param {Number} height the height of the element quads - * @param {Number} zoom the zoom level of the window + * @param {number} width the width of the element quads + * @param {number} height the height of the element quads + * @param {number} zoom the zoom level of the window */ _updateShapes(width, height, zoom) { if (this.transformMode && this.shapeType !== "none") { @@ -2726,9 +2726,9 @@ class ShapesHighlighter extends AutoRefreshHighlighter { /** * Update the SVGs for transform mode to fit the new shape. * - * @param {Number} width the width of the element quads - * @param {Number} height the height of the element quads - * @param {Number} zoom the zoom level of the window + * @param {number} width the width of the element quads + * @param {number} height the height of the element quads + * @param {number} zoom the zoom level of the window */ _updateTransformMode(width, height, zoom) { const { nw, ne, sw, se, n, w, s, e, rotatePoint, center } = @@ -2838,9 +2838,9 @@ class ShapesHighlighter extends AutoRefreshHighlighter { * Draw markers for the given coordinates. * * @param {Array} coords an array of coordinate arrays, of form [[x, y] ...] - * @param {Number} width the width of the element markers are being drawn for - * @param {Number} height the height of the element markers are being drawn for - * @param {Number} zoom the zoom level of the window + * @param {number} width the width of the element markers are being drawn for + * @param {number} height the height of the element markers are being drawn for + * @param {number} zoom the zoom level of the window */ _drawMarkers(coords, width, height, zoom) { const markers = coords @@ -2862,7 +2862,7 @@ class ShapesHighlighter extends AutoRefreshHighlighter { * Calculate the bounding box of the shape after it is transformed according to * the transformation matrix. * - * @returns {Object} of form { nw, ne, sw, se, n, s, w, e, rotatePoint, center }. + * @returns {object} of form { nw, ne, sw, se, n, s, w, e, rotatePoint, center }. * Each element in the object is an array of form [x,y], denoting the x/y * coordinates of the given point. */ @@ -2937,9 +2937,9 @@ class ShapesHighlighter extends AutoRefreshHighlighter { * If the handle is roughly above/right or below/left, return "nesw" * If the handle is roughly above/left or below/right, return "nwse" * - * @param {String} pointName the name of the point being hovered - * @param {String} anchor the name of the anchor point - * @returns {String} The rough direction of the point relative to the anchor + * @param {string} pointName the name of the point being hovered + * @param {string} anchor the name of the anchor point + * @returns {string} The rough direction of the point relative to the anchor */ getRoughDirection(pointName, anchor) { const scalePoint = pointName.split("-")[1]; @@ -2967,11 +2967,11 @@ class ShapesHighlighter extends AutoRefreshHighlighter { * Percentage units (%) are relative to a size. This must be provided when requesting * a ratio for converting from pixels to percentages. * - * @param {String} unit + * @param {string} unit * One of: %, em, rem, vw, vh - * @param {Number} size + * @param {number} size * Size to which percentage values are relative to. - * @return {Number} + * @return {number} */ getUnitToPixelRatio(unit, size) { let ratio; @@ -3014,8 +3014,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter { * Get the "raw" (i.e. non-computed) shape definition on the given node. * * @param {Node} node the node to analyze - * @param {String} property the CSS property for which a value should be retrieved. - * @returns {String} the value of the given CSS property on the given node. + * @param {string} property the CSS property for which a value should be retrieved. + * @returns {string} the value of the given CSS property on the given node. */ function getDefinedShapeProperties(node, property) { let prop = ""; @@ -3045,7 +3045,7 @@ function getDefinedShapeProperties(node, property) { /** * Split coordinate pairs separated by a space and return an array. * - * @param {String} coords the coordinate pair, where each coord is separated by a space. + * @param {string} coords the coordinate pair, where each coord is separated by a space. * @returns {Array} a 2 element array containing the coordinates. */ function splitCoords(coords) { @@ -3065,10 +3065,10 @@ exports.splitCoords = splitCoords; /** * Convert a coordinate to a percentage value. * - * @param {String} coord a single coordinate - * @param {Number} size the size of the element (width or height) that the percentages + * @param {string} coord a single coordinate + * @param {number} size the size of the element (width or height) that the percentages * are relative to - * @returns {Number} the coordinate as a percentage value + * @returns {number} the coordinate as a percentage value */ function coordToPercent(coord, size) { if (coord.includes("%")) { @@ -3089,10 +3089,10 @@ exports.coordToPercent = coordToPercent; /** * Evaluates a CSS calc() expression (only handles addition) * - * @param {String} expression the arguments to the calc() function - * @param {Number} size the size of the element (width or height) that percentage values + * @param {string} expression the arguments to the calc() function + * @param {number} size the size of the element (width or height) that percentage values * are relative to - * @returns {Number} the result of the expression as a percentage value + * @returns {number} the result of the expression as a percentage value */ function evalCalcExpression(expression, size) { // the calc() values returned by getComputedStyle only have addition, as it @@ -3109,7 +3109,7 @@ exports.evalCalcExpression = evalCalcExpression; /** * Converts a shape mode to the proper CSS property name. * - * @param {String} mode the mode of the CSS shape + * @param {string} mode the mode of the CSS shape * @returns the equivalent CSS property name */ const shapeModeToCssPropertyName = mode => { @@ -3121,13 +3121,13 @@ exports.shapeModeToCssPropertyName = shapeModeToCssPropertyName; /** * Get the SVG path definition for a circle with given attributes. * - * @param {Number} size the radius of the circle in pixels - * @param {Number} cx the x coordinate of the centre of the circle - * @param {Number} cy the y coordinate of the centre of the circle - * @param {Number} width the width of the element the circle is being drawn for - * @param {Number} height the height of the element the circle is being drawn for - * @param {Number} zoom the zoom level of the window the circle is drawn in - * @returns {String} the definition of the circle in SVG path description format. + * @param {number} size the radius of the circle in pixels + * @param {number} cx the x coordinate of the centre of the circle + * @param {number} cy the y coordinate of the centre of the circle + * @param {number} width the width of the element the circle is being drawn for + * @param {number} height the height of the element the circle is being drawn for + * @param {number} zoom the zoom level of the window the circle is drawn in + * @returns {string} the definition of the circle in SVG path description format. */ const getCirclePath = (size, cx, cy, width, height, zoom) => { // We use a viewBox of 100x100 for shape-container so it's easy to position things @@ -3151,12 +3151,12 @@ exports.getCirclePath = getCirclePath; /** * Calculates the object bounding box for a node given its stroke bounding box. * - * @param {Number} top the y coord of the top edge of the stroke bounding box - * @param {Number} left the x coord of the left edge of the stroke bounding box - * @param {Number} width the width of the stroke bounding box - * @param {Number} height the height of the stroke bounding box - * @param {Object} node the node object - * @returns {Object} an object of the form { top, left, width, height }, which + * @param {number} top the y coord of the top edge of the stroke bounding box + * @param {number} left the x coord of the left edge of the stroke bounding box + * @param {number} width the width of the stroke bounding box + * @param {number} height the height of the stroke bounding box + * @param {object} node the node object + * @returns {object} an object of the form { top, left, width, height }, which * are the top/left/width/height of the object bounding box for the node. */ const getObjectBoundingBox = (top, left, width, height, node) => { @@ -3196,7 +3196,7 @@ const getObjectBoundingBox = (top, left, width, height, node) => { * Get the unit (e.g. px, %, em) for the given point value. * * @param {any} point a point value for which a unit should be retrieved. - * @returns {String} the unit. + * @returns {string} the unit. */ const getUnit = point => { // If the point has no unit, default to px. @@ -3212,7 +3212,7 @@ exports.getUnit = getUnit; * Check if the given point value has a unit. * * @param {any} point a point value. - * @returns {Boolean} whether the given value has a unit. + * @returns {boolean} whether the given value has a unit. */ const isUnitless = point => { return ( @@ -3230,8 +3230,8 @@ const isUnitless = point => { /** * Return the anchor corresponding to the given scale type. * - * @param {String} type a scale type, of form "scale-[direction]" - * @returns {String} a string describing the anchor, one of the 8 cardinal directions. + * @param {string} type a scale type, of form "scale-[direction]" + * @returns {string} a string describing the anchor, one of the 8 cardinal directions. */ const getAnchorPoint = type => { let anchor = type.split("-")[1]; @@ -3260,8 +3260,8 @@ const getAnchorPoint = type => { * Only handle pixels and falsy values for now. Round them to the nearest integer value. * All other unit types round to two decimal points. * - * @param {String|undefined} unitType any one of the accepted CSS unit types for position. - * @return {Number} decimal precision when rounding a value + * @param {string | undefined} unitType any one of the accepted CSS unit types for position. + * @return {number} decimal precision when rounding a value */ function getDecimalPrecision(unitType) { switch (unitType) { @@ -3281,11 +3281,11 @@ exports.getDecimalPrecision = getDecimalPrecision; * - transforming shapes * - inserting new points on a polygon. * - * @param {Number} number + * @param {number} number * Value to round up. - * @param {String} unitType + * @param {string} unitType * CSS unit type, like "px", "%", "em", "vh", etc. - * @return {Number} + * @return {number} * Rounded value */ function round(number, unitType) { diff --git a/devtools/server/actors/highlighters/tabbing-order.js b/devtools/server/actors/highlighters/tabbing-order.js @@ -204,7 +204,7 @@ class TabbingOrderHighlighter { * Update NodeTabbingOrderHighlighter focus styling for a node that, * potentially, belongs to the tabbing order. * - * @param {Object} options + * @param {object} options * Options specifying the node and its focused state. */ updateFocus({ node, focused }) { diff --git a/devtools/server/actors/highlighters/utils/accessibility.js b/devtools/server/actors/highlighters/utils/accessibility.js @@ -177,7 +177,7 @@ class Infobar { /** * Gets the element with the specified ID. * - * @param {String} id + * @param {string} id * Element ID. * @return {Element} The element with specified ID. */ @@ -188,9 +188,9 @@ class Infobar { /** * Gets the text content of element. * - * @param {String} id + * @param {string} id * Element ID to retrieve text content from. - * @return {String} The text content of the element. + * @return {string} The text content of the element. */ getTextContent(id) { const anonymousContent = this.markup.content; @@ -238,7 +238,7 @@ class Infobar { * * @param {Element} el * Element to set text content on. - * @param {String} text + * @param {string} text * Text for content. */ setTextContent(el, text) { @@ -248,7 +248,7 @@ class Infobar { /** * Show the accessible's name message. * - * @param {String} name + * @param {string} name * Accessible's name value. * @param {Element} el * Element to set text content on. @@ -261,7 +261,7 @@ class Infobar { /** * Show the accessible's role. * - * @param {String} role + * @param {string} role * Accessible's role value. * @param {Element} el * Element to set text content on. @@ -431,9 +431,9 @@ class ContrastRatio extends AuditReport { /** * Update contrast ratio score infobar markup. * - * @param {Object} + * @param {object} * Audit report for a given highlighted accessible. - * @return {Boolean} + * @return {boolean} * True if the contrast ratio markup was updated correctly and infobar audit * block should be visible. */ @@ -547,9 +547,9 @@ class Keyboard extends AuditReport { /** * Update keyboard audit infobar markup. * - * @param {Object} + * @param {object} * Audit report for a given highlighted accessible. - * @return {Boolean} + * @return {boolean} * True if the keyboard markup was updated correctly and infobar audit * block should be visible. */ @@ -626,9 +626,9 @@ class TextLabel extends AuditReport { /** * Update text label audit infobar markup. * - * @param {Object} + * @param {object} * Audit report for a given highlighted accessible. - * @return {Boolean} + * @return {boolean} * True if the text label markup was updated correctly and infobar * audit block should be visible. */ @@ -662,9 +662,9 @@ class TextLabel extends AuditReport { * A helper function that calculate accessible object bounds and positioning to * be used for highlighting. * - * @param {Object} win + * @param {object} win * window that contains accessible object. - * @param {Object} options + * @param {object} options * Object used for passing options: * - {Number} x * x coordinate of the top left corner of the accessible object @@ -674,7 +674,7 @@ class TextLabel extends AuditReport { * width of the the accessible object * - {Number} h * height of the the accessible object - * @return {Object|null} Returns, if available, positioning and bounds information for + * @return {object | null} Returns, if available, positioning and bounds information for * the accessible object. */ function getBounds(win, { x, y, w, h }) { @@ -705,9 +705,9 @@ function getBounds(win, { x, y, w, h }) { * A helper function that calculate accessible object bounds and positioning to * be used for highlighting in browser toolbox. * - * @param {Object} win + * @param {object} win * window that contains accessible object. - * @param {Object} options + * @param {object} options * Object used for passing options: * - {Number} x * x coordinate of the top left corner of the accessible object @@ -719,7 +719,7 @@ function getBounds(win, { x, y, w, h }) { * height of the the accessible object * - {Number} zoom * zoom level of the accessible object's parent window - * @return {Object|null} Returns, if available, positioning and bounds information for + * @return {object | null} Returns, if available, positioning and bounds information for * the accessible object. */ function getBoundsXUL(win, { x, y, w, h, zoom }) { diff --git a/devtools/server/actors/highlighters/utils/canvas.js b/devtools/server/actors/highlighters/utils/canvas.js @@ -51,13 +51,13 @@ const DEFAULT_COLOR = "#9400FF"; * * @param {CanvasRenderingContext2D} ctx * The 2D canvas context. - * @param {Number} x1 + * @param {number} x1 * The x-axis coordinate of the rectangle's diagonal start point. - * @param {Number} y1 + * @param {number} y1 * The y-axis coordinate of the rectangle's diagonal start point. - * @param {Number} x2 + * @param {number} x2 * The x-axis coordinate of the rectangle's diagonal end point. - * @param {Number} y2 + * @param {number} y2 * The y-axis coordinate of the rectangle's diagonal end point. * @param {Array} [matrix=identity()] * The transformation matrix to apply. @@ -97,21 +97,21 @@ function clearRect(ctx, x1, y1, x2, y2, matrix = identity()) { * * @param {CanvasRenderingContext2D} ctx * The 2D canvas context. - * @param {Number} x + * @param {number} x * The x-axis origin of the rectangle. - * @param {Number} y + * @param {number} y * The y-axis origin of the rectangle. - * @param {Number} width + * @param {number} width * The width of the rectangle. - * @param {Number} height + * @param {number} height * The height of the rectangle. - * @param {Number} radius + * @param {number} radius * The radius of the rounding. - * @param {Number} margin + * @param {number} margin * The distance of the origin point from the pointer. - * @param {Number} arrowSize + * @param {number} arrowSize * The size of the arrow. - * @param {String} alignment + * @param {string} alignment * The alignment of the rectangle in relation to its position to the grid. */ function drawBubbleRect( @@ -178,15 +178,15 @@ function drawBubbleRect( * * @param {CanvasRenderingContext2D} ctx * The 2D canvas context. - * @param {Number} x1 + * @param {number} x1 * The x-axis of the coordinate for the begin of the line. - * @param {Number} y1 + * @param {number} y1 * The y-axis of the coordinate for the begin of the line. - * @param {Number} x2 + * @param {number} x2 * The x-axis of the coordinate for the end of the line. - * @param {Number} y2 + * @param {number} y2 * The y-axis of the coordinate for the end of the line. - * @param {Object} [options] + * @param {object} [options] * The options object. * @param {Array} [options.matrix=identity()] * The transformation matrix to apply. @@ -227,13 +227,13 @@ function drawLine(ctx, x1, y1, x2, y2, options) { * * @param {CanvasRenderingContext2D} ctx * The 2D canvas context. - * @param {Number} x1 + * @param {number} x1 * The x-axis coordinate of the rectangle's diagonal start point. - * @param {Number} y1 + * @param {number} y1 * The y-axis coordinate of the rectangle's diagonal start point. - * @param {Number} x2 + * @param {number} x2 * The x-axis coordinate of the rectangle's diagonal end point. - * @param {Number} y2 + * @param {number} y2 * The y-axis coordinate of the rectangle's diagonal end point. * @param {Array} [matrix=identity()] * The transformation matrix to apply. @@ -254,15 +254,15 @@ function drawRect(ctx, x1, y1, x2, y2, matrix = identity()) { * * @param {CanvasRenderingContext2D} ctx * The 2D canvas context. - * @param {Number} x + * @param {number} x * The x-axis origin of the rectangle. - * @param {Number} y + * @param {number} y * The y-axis origin of the rectangle. - * @param {Number} width + * @param {number} width * The width of the rectangle. - * @param {Number} height + * @param {number} height * The height of the rectangle. - * @param {Number} radius + * @param {number} radius * The radius of the rounding. */ function drawRoundedRect(ctx, x, y, width, height, radius) { @@ -286,7 +286,7 @@ function drawRoundedRect(ctx, x, y, width, height, radius) { * * @param {Array} points * An array with 4 pointer objects {x, y} representing the box quads. - * @return {Object} DOMRect-like object of the 4 points. + * @return {object} DOMRect-like object of the 4 points. */ function getBoundsFromPoints(points) { const bounds = {}; @@ -324,10 +324,10 @@ function getBoundsFromPoints(points) { * The current element. * @param {Window} window * The window object. - * @param {Object} [options.ignoreWritingModeAndTextDirection=false] + * @param {object} [options.ignoreWritingModeAndTextDirection=false] * Avoid transforming the current matrix to match the text direction * and writing mode. - * @return {Object} An object with the following properties: + * @return {object} An object with the following properties: * - {Array} currentMatrix * The current matrix. * - {Boolean} hasNodeTransformations @@ -406,7 +406,7 @@ function getCurrentMatrix( * * @param {Array} points * An array with 4 pointer objects {x, y} representing the box quads. - * @return {String} a Path Description that can be used in svg's <path> element. + * @return {string} a Path Description that can be used in svg's <path> element. */ function getPathDescriptionFromPoints(points) { return ( @@ -437,13 +437,13 @@ function getPathDescriptionFromPoints(points) { * the four coordinates of a rectangle. If a matrix is provided, applies the matrix * function to each of the coordinates' value. * - * @param {Number} x1 + * @param {number} x1 * The x-axis coordinate of the rectangle's diagonal start point. - * @param {Number} y1 + * @param {number} y1 * The y-axis coordinate of the rectangle's diagonal start point. - * @param {Number} x2 + * @param {number} x2 * The x-axis coordinate of the rectangle's diagonal end point. - * @param {Number} y2 + * @param {number} y2 * The y-axis coordinate of the rectangle's diagonal end point. * @param {Array} [matrix=identity()] * A transformation matrix to apply. @@ -471,10 +471,10 @@ function getPointsFromDiagonal(x1, y1, x2, y2, matrix = identity()) { * * @param {Canvas} canvas * The <canvas> element. - * @param {Object} canvasPosition + * @param {object} canvasPosition * A pointer object {x, y} representing the <canvas> position to the top left * corner of the page. - * @param {Number} devicePixelRatio + * @param {number} devicePixelRatio * The device pixel ratio. * @param {Window} [options.zoomWindow] * Optional window object used to calculate zoom (default = undefined). @@ -508,17 +508,17 @@ function updateCanvasElement( * document's size, canvas size, and viewport's size. This is called when a page's scroll * is detected. * - * @param {Object} canvasPosition + * @param {object} canvasPosition * A pointer object {x, y} representing the <canvas> position to the top left * corner of the page. - * @param {Object} scrollPosition + * @param {object} scrollPosition * A pointer object {x, y} representing the window's pageXOffset and pageYOffset. * @param {Window} window * The window object. - * @param {Object} windowDimensions + * @param {object} windowDimensions * An object {width, height} representing the window's dimensions for the * `window` given. - * @return {Boolean} true if the <canvas> position was updated and false otherwise. + * @return {boolean} true if the <canvas> position was updated and false otherwise. */ function updateCanvasPosition( canvasPosition, diff --git a/devtools/server/actors/highlighters/utils/markup.js b/devtools/server/actors/highlighters/utils/markup.js @@ -50,7 +50,7 @@ const STYLESHEET_URI = * Is this content window a XUL window? * * @param {Window} window - * @return {Boolean} + * @return {boolean} */ function isXUL(window) { return window.document.documentElement?.namespaceURI === XUL_NS; @@ -62,8 +62,8 @@ exports.isXUL = isXUL; * object wrapper, is still attached to a document, and is of a given type. * * @param {DOMNode} node - * @param {Number} nodeType Optional, defaults to ELEMENT_NODE - * @return {Boolean} + * @param {number} nodeType Optional, defaults to ELEMENT_NODE + * @return {boolean} */ function isNodeValid(node, nodeType = Node.ELEMENT_NODE) { // Is it still alive? @@ -107,10 +107,10 @@ class CanvasFrameAnonymousContentHelper { * @param {Function} nodeBuilder * A function that, when executed, returns a DOM node to be inserted into * the canvasFrame. - * @param {Object} options - * @param {String|undefined} options.contentRootHostClassName + * @param {object} options + * @param {string | undefined} options.contentRootHostClassName * An optional class to add to the AnonymousContent root's host. - * @param {Boolean} options.waitForDocumentToLoad + * @param {boolean} options.waitForDocumentToLoad * Set to false to try to insert the anonymous content even if the document * isn't loaded yet. Defaults to true. */ @@ -343,8 +343,8 @@ class CanvasFrameAnonymousContentHelper { * ID, the callback is executed (and then IDs of parent nodes of the * originalTarget are checked too). * - * @param {String} id - * @param {String} type + * @param {string} id + * @param {string} type * @param {Function} handler */ addEventListenerForElement(id, type, handler) { @@ -370,8 +370,8 @@ class CanvasFrameAnonymousContentHelper { * Remove an event listener from one of the elements inserted in the * canvasFrame native anonymous container. * - * @param {String} id - * @param {String} type + * @param {string} id + * @param {string} type */ removeEventListenerForElement(id, type) { const listeners = this.#listeners.get(type); @@ -491,7 +491,7 @@ class CanvasFrameAnonymousContentHelper { * * @param {DOMNode} node This node is used to determine which container window * should be used to read the current zoom value. - * @param {String} id The ID of the root element inserted with this API. + * @param {string} id The ID of the root element inserted with this API. */ scaleRootElement(node, id) { const boundaryWindow = this.#highlighterEnv.window; @@ -518,7 +518,7 @@ class CanvasFrameAnonymousContentHelper { /** * Helper function that creates SVG DOM nodes. * - * @param {Object} Options for the node include: + * @param {object} Options for the node include: * - nodeType: the type of node, defaults to "box". * - attributes: a {name:value} object to be used as attributes for the node. * - parent: if provided, the newly created element will be appended to this @@ -537,7 +537,7 @@ class CanvasFrameAnonymousContentHelper { /** * Helper function that creates DOM nodes. * - * @param {Object} Options for the node include: + * @param {object} Options for the node include: * - nodeType: the type of node, defaults to "div". * - namespace: the namespace to use to create the node, defaults to XHTML namespace. * - attributes: a {name:value} object to be used as attributes for the node. @@ -573,7 +573,7 @@ exports.CanvasFrameAnonymousContentHelper = CanvasFrameAnonymousContentHelper; /** * Wait for document readyness. * - * @param {Object} iframeOrWindow + * @param {object} iframeOrWindow * IFrame or Window for which the content should be loaded. */ function waitForContentLoaded(iframeOrWindow) { @@ -610,13 +610,13 @@ function waitForContentLoaded(iframeOrWindow) { * * @param {DOMNode} container * The container element which will be used to position the infobar. - * @param {Object} bounds + * @param {object} bounds * The content bounds of the container element. * @param {Window} win * The window object. - * @param {Object} [options={}] + * @param {object} [options={}] * Advanced options for the infobar. - * @param {String} options.position + * @param {string} options.position * Force the infobar to be displayed either on "top" or "bottom". Any other value * will be ingnored. */ diff --git a/devtools/server/actors/highlighters/viewport-size.js b/devtools/server/actors/highlighters/viewport-size.js @@ -22,11 +22,11 @@ class ViewportSizeHighlighter { * * @param {HighlighterEnvironment} highlighterEnv * @param {InspectorActor} parent - * @param {Object} options - * @param {Number} options.hideTimeout: An optional number. When passed, the viewport + * @param {object} options + * @param {number} options.hideTimeout: An optional number. When passed, the viewport * information will automatically hide after {hideTimeout} ms. - * @param {String} options.extraCls: An extra class to add to the infobar container. - * @param {Boolean} options.waitForDocumentToLoad: Option that will be passed to + * @param {string} options.extraCls: An extra class to add to the infobar container. + * @param {boolean} options.waitForDocumentToLoad: Option that will be passed to * CanvasFrameAnonymousContentHelper. Defaults to true */ constructor(highlighterEnv, parent, options = {}) { diff --git a/devtools/server/actors/inspector/css-logic.js b/devtools/server/actors/inspector/css-logic.js @@ -286,7 +286,7 @@ class CssLogic { /** * Retrieve the list of stylesheets in the document. * - * @return {array} the list of stylesheets in the document. + * @return {Array} the list of stylesheets in the document. */ get sheets() { if (!this._sheetsCached) { @@ -477,7 +477,7 @@ class CssLogic { * @private * @param {DOMRule} domRule * The DOM Rule containing the selector. - * @param {Number} idx + * @param {number} idx * The index of the selector within the DOMRule. * @return {boolean} * true if the given selector matches the highlighted element or any @@ -510,10 +510,10 @@ class CssLogic { /** * Check if the highlighted element or its parents have matched selectors. * - * @param {Array<String>} properties: The list of properties you want to check if they + * @param {Array<string>} properties: The list of properties you want to check if they * have matched selectors or not. For CSS variables, this will check if the variable * is set OR used in a matching rule. - * @return {Set<String>} A Set containing the properties that do have matched selectors. + * @return {Set<string>} A Set containing the properties that do have matched selectors. */ hasMatchedSelectors(properties) { if (!this._matchedRules) { @@ -712,7 +712,7 @@ CssLogic.getShortName = function (element) { * * @param {DOMRule} domRule * The DOMRule to parse. - * @param {Boolean} desugared + * @param {boolean} desugared * Set to true to get the desugared selector (see https://drafts.csswg.org/css-nesting-1/#nest-selector) * @return {Array} * An array of string selectors. @@ -738,7 +738,7 @@ CssLogic.getSelectors = function (domRule, desugared = false) { * (the parent of the anonymous node), along with which pseudo element * it was. Otherwise, return the node itself. * - * @returns {Object} + * @returns {object} * - {DOMNode} node The non-anonymous node * - {string} pseudo One of ':marker', ':before', ':after', or null. */ @@ -1104,7 +1104,7 @@ class CssRule { * Retrieve the list of CssSelector objects for each of the parsed selectors * of the current CSSStyleRule. * - * @return {array} the array hold the CssSelector objects. + * @return {Array} the array hold the CssSelector objects. */ get selectors() { if (this._selectors) { @@ -1140,7 +1140,7 @@ class CssSelector { * @constructor * @param {CssRule} cssRule the CssRule instance from where the selector comes. * @param {string} selector The selector that we wish to investigate. - * @param {Number} index The index of the selector within it's rule. + * @param {number} index The index of the selector within it's rule. */ constructor(cssRule, selector, index) { this.cssRule = cssRule; @@ -1247,7 +1247,7 @@ class CssSelector { * @see http://www.w3.org/TR/css3-selectors/#specificity * @see http://www.w3.org/TR/CSS2/selector.html * - * @return {Number} The selector's specificity. + * @return {number} The selector's specificity. */ get specificity() { if (this.inlineStyle) { @@ -1332,7 +1332,7 @@ class CssPropertyInfo { * selectors, from each of the matched rules. Only selectors coming from * allowed stylesheets are included in the array. * - * @return {array} the list of CssSelectorInfo objects of selectors that match + * @return {Array} the list of CssSelectorInfo objects of selectors that match * the highlighted element and its parents. */ get matchedSelectors() { @@ -1604,7 +1604,7 @@ class CssSelectorInfo { * The instance to compare ourselves against. * @param {Array<CssSelectorInfo>} selectorInfos * The list of CssSelectorInfo we are currently ordering - * @return {Number} + * @return {number} * -1, 0, 1 depending on how that compares with this. */ compareTo(that, selectorInfos) { diff --git a/devtools/server/actors/inspector/document-walker.js b/devtools/server/actors/inspector/document-walker.js @@ -28,7 +28,7 @@ class DocumentWalker { * * @param {DOMNode} node * @param {Window} rootWin - * @param {Object} + * @param {object} * - {Function} filter * A custom filter function Taking in a DOMNode and returning an Int. See * WalkerActor.nodeFilter for an example. diff --git a/devtools/server/actors/inspector/event-collector.js b/devtools/server/actors/inspector/event-collector.js @@ -219,7 +219,7 @@ class MainEventCollector { * * @param {DOMNode} node * The not for which we want to check for event listeners. - * @return {Boolean} + * @return {boolean} * true if the node has event listeners, false otherwise. */ hasListeners(node) { @@ -233,9 +233,9 @@ class MainEventCollector { * * @param {DOMNode} node * The not for which we want to get event listeners. - * @param {Object} options + * @param {object} options * An object for passing in options. - * @param {Boolean} [options.checkOnly = false] + * @param {boolean} [options.checkOnly = false] * Don't get any listeners but return true when the first event is * found. * @return {Array} @@ -798,7 +798,7 @@ class EventCollector { * * @param {DOMNode} node * The node to be checked for events. - * @return {Boolean} + * @return {boolean} * True if the node has event listeners, false otherwise. */ hasEventListeners(node) { @@ -829,7 +829,7 @@ class EventCollector { * * @param {DOMNode} node * The node for which events are to be gathered. - * @return {Array<Object>} + * @return {Array<object>} * An array containing objects in the following format: * { * {String} type: The event type, e.g. "click" diff --git a/devtools/server/actors/inspector/inspector.js b/devtools/server/actors/inspector/inspector.js @@ -211,7 +211,7 @@ class InspectorActor extends Actor { * A new instance will be created everytime the method is called, so it's up * to the consumer to release it when it is not needed anymore * - * @param {String} type The type of highlighter to create + * @param {string} type The type of highlighter to create * @return {Highlighter} The highlighter actor instance or null if the * typeName passed doesn't match any available highlighter */ @@ -254,11 +254,11 @@ class InspectorActor extends Actor { /** * Resolve a URL to its absolute form, in the scope of a given content window. * - * @param {String} url. + * @param {string} url. * @param {NodeActor} node If provided, the owner window of this node will be * used to resolve the URL. Otherwise, the top-level content window will be * used instead. - * @return {String} url. + * @return {string} url. */ resolveRelativeURL(url, node) { const document = InspectorActorUtils.isNodeDead(node) @@ -303,7 +303,7 @@ class InspectorActor extends Actor { * but will cause events to be sent to the front when a color is picked or when the user * cancels the picker. * - * @param {Object} options + * @param {object} options */ async pickColorFromPage(options) { await this.createEyeDropper(); diff --git a/devtools/server/actors/inspector/node-picker.js b/devtools/server/actors/inspector/node-picker.js @@ -61,8 +61,8 @@ class NodePicker { * or `pointer-events: none` style). * * @param {MouseEvent} event - * @param {Boolean} shiftKey: If passed, will override event.shiftKey - * @returns {Object} An object compatible with the disconnectedNode type. + * @param {boolean} shiftKey: If passed, will override event.shiftKey + * @returns {object} An object compatible with the disconnectedNode type. */ _findAndAttachElement(event, shiftKey = event.shiftKey) { // originalTarget allows access to the "real" element before any retargeting @@ -144,7 +144,7 @@ class NodePicker { * * @param {Event} event * The event to allow - * @return {Boolean} + * @return {boolean} */ _isEventAllowed({ view }) { // Allow "non multiprocess" browser toolbox to inspect documents loaded in the parent @@ -160,7 +160,7 @@ class NodePicker { * Returns true if the passed event original target is in the RemoteNodePickerNotice. * * @param {Event} event - * @returns {Boolean} + * @returns {boolean} */ _isEventInRemoteNodePickerNotice(event) { return ( @@ -225,7 +225,7 @@ class NodePicker { * mousemove event handler * * @param {MouseEvent} event - * @param {Boolean} shiftKeyOverride: If passed, will override event.shiftKey in _findAndAttachElement + * @param {boolean} shiftKeyOverride: If passed, will override event.shiftKey in _findAndAttachElement */ _onHovered(event, shiftKeyOverride) { // If the hovered node is a remote frame, then we need to let the event through diff --git a/devtools/server/actors/inspector/node.js b/devtools/server/actors/inspector/node.js @@ -422,7 +422,7 @@ class NodeActor extends Actor { * uses all parsers registered via event-parsers.js.registerEventParser() to * check if there are any event listeners. * - * @returns {Boolean} + * @returns {boolean} */ hasEventListeners(refreshCache = false) { if (this._hasEventListenersCached === undefined || refreshCache) { @@ -547,7 +547,7 @@ class NodeActor extends Actor { /** * Get the full CSS path for this node. * - * @return {String} A CSS selector with a part for the node and each of its ancestors. + * @return {string} A CSS selector with a part for the node and each of its ancestors. */ getCssPath() { if (Cu.isDeadWrapper(this.rawNode)) { @@ -559,7 +559,7 @@ class NodeActor extends Actor { /** * Get the XPath for this node. * - * @return {String} The XPath for finding this node on the page. + * @return {string} The XPath for finding this node on the page. */ getXPath() { if (Cu.isDeadWrapper(this.rawNode)) { @@ -629,7 +629,7 @@ class NodeActor extends Actor { /** * Disable a specific event listener given its associated id * - * @param {String} eventListenerInfoId + * @param {string} eventListenerInfoId */ disableEventListener(eventListenerInfoId) { const nsEventListenerInfo = @@ -643,7 +643,7 @@ class NodeActor extends Actor { /** * (Re-)enable a specific event listener given its associated id * - * @param {String} eventListenerInfoId + * @param {string} eventListenerInfoId */ enableEventListener(eventListenerInfoId) { const nsEventListenerInfo = @@ -714,7 +714,7 @@ class NodeActor extends Actor { * Finds the computed background color of the closest parent with a set background * color. * - * @return {String} + * @return {string} * String with the background color of the form rgba(r, g, b, a). Defaults to * rgba(255, 255, 255, 1) if no background color is found. */ @@ -728,7 +728,7 @@ class NodeActor extends Actor { * background color for single-colored backgrounds. Defaults to the closest * background color if an error is encountered. * - * @return {Object} + * @return {object} * Object with one or more of the following properties: value, min, max */ getBackgroundColor() { @@ -738,7 +738,7 @@ class NodeActor extends Actor { /** * Returns an object with the width and height of the node's owner window. * - * @return {Object} + * @return {object} */ getOwnerGlobalDimensions() { const win = this.rawNode.ownerGlobal; diff --git a/devtools/server/actors/inspector/utils.js b/devtools/server/actors/inspector/utils.js @@ -67,7 +67,7 @@ const IMAGE_FETCHING_TIMEOUT = 500; * * @param {Node} rawNode * Node for which we want the display name - * @return {String} + * @return {string} * Properly cased version of the node tag name */ const getNodeDisplayName = function (rawNode) { @@ -97,7 +97,7 @@ const getNodeDisplayName = function (rawNode) { * * @param {DOMNode} node * The node for which then information is required - * @return {Object} + * @return {object} * An object like { grid: { isContainer, isItem }, flex: { isContainer, isItem } } */ function getNodeGridFlexType(node) { @@ -218,7 +218,7 @@ function allAnonymousContentTreeWalkerFilter(node) { * Is the given node a text node composed of whitespace only? * * @param {DOMNode} node - * @return {Boolean} + * @return {boolean} */ function isWhitespaceTextNode(node) { return node.nodeType == Node.TEXT_NODE && !/[^\s]/.exec(node.nodeValue); @@ -228,7 +228,7 @@ function isWhitespaceTextNode(node) { * Does the given node have non-0 width and height? * * @param {DOMNode} node - * @return {Boolean} + * @return {boolean} */ function nodeHasSize(node) { if (!node.getBoxQuads) { @@ -249,7 +249,7 @@ function nodeHasSize(node) { * finished loading. * * @param {HTMLImageElement} image - The image element. - * @param {Number} timeout - Maximum amount of time the image is allowed to load + * @param {number} timeout - Maximum amount of time the image is allowed to load * before the waiting is aborted. Ignored if flags.testing is set. * * @return {Promise} that is fulfilled once the image has loaded. If the image @@ -296,7 +296,7 @@ function ensureImageLoaded(image, timeout) { * * @param {HTMLImageElement|HTMLCanvasElement} node - The <img> or <canvas> * element, or Image() object. Other types cause the method to reject. - * @param {Number} maxDim - Optionally pass a maximum size you want the longest + * @param {number} maxDim - Optionally pass a maximum size you want the longest * side of the image to be resized to before getting the image data. * @return {Promise} A promise that is fulfilled with an object containing the @@ -368,7 +368,7 @@ const imageToImageData = async function (node, maxDim) { * * @param {DOMNode} node * Node for which we want to find closest background color. - * @return {String} + * @return {string} * String with the background color of the form rgba(r, g, b, a). Defaults to * rgba(255, 255, 255, 1) if no background color is found. */ @@ -398,7 +398,7 @@ function getClosestBackgroundColor(node) { * * @param {DOMNode} node * Node for which we want to find the background image. - * @return {String} + * @return {string} * String with the value of the background iamge property. Defaults to "none" if * no background image is found. */ @@ -456,13 +456,13 @@ function findGridParentContainerForNode(node) { * background color for single-colored backgrounds. Defaults to the closest * background color if an error is encountered. * - * @param {Object} + * @param {object} * Node actor containing the following properties: * {DOMNode} rawNode * Node for which we want to calculate the color contrast. * {WalkerActor} walker * Walker actor used to check whether the node is the parent elm of a single text node. - * @return {Object} + * @return {object} * Object with one or more of the following properties: * {Array|null} value * RGBA array for single-colored background. Null for multi-colored backgrounds. @@ -560,7 +560,7 @@ function getClosestBackgroundColorInRGBA(node) { * Indicates if a document is ready (i.e. if it's not loading anymore) * * @param {HTMLDocument} document: The document we want to check - * @returns {Boolean} + * @returns {boolean} */ function isDocumentReady(document) { if (!document) { diff --git a/devtools/server/actors/inspector/walker.js b/devtools/server/actors/inspector/walker.js @@ -195,7 +195,7 @@ class WalkerActor extends Actor { * The server connection. * @param {TargetActor} targetActor * The top-level Actor for this tab. - * @param {Object} options + * @param {object} options * - {Boolean} showAllAnonymousContent: Show all native anonymous content */ constructor(conn, targetActor, options) { @@ -469,7 +469,7 @@ class WalkerActor extends Actor { * Determine if the walker has come across this DOM node before. * * @param {DOMNode} rawNode - * @return {Boolean} + * @return {boolean} */ hasNode(rawNode) { return this._nodeActorsMap.has(rawNode); @@ -630,7 +630,7 @@ class WalkerActor extends Actor { * Ensures that the node is attached and it can be accessed from the root. * * @param {(Node|NodeActor)} nodes The nodes - * @return {Object} An object compatible with the disconnectedNode type. + * @return {object} An object compatible with the disconnectedNode type. */ attachElement(node) { const { nodes, newParents } = this.attachElements([node]); @@ -644,7 +644,7 @@ class WalkerActor extends Actor { * Ensures that the nodes are attached and they can be accessed from the root. * * @param {(Node[]|NodeActor[])} nodes The nodes - * @return {Object} An object compatible with the disconnectedNodeArray type. + * @return {object} An object compatible with the disconnectedNodeArray type. */ attachElements(nodes) { const nodeActors = []; @@ -1132,7 +1132,7 @@ class WalkerActor extends Actor { * Get a list of nodes that match the given selector in all known frames of * the current content page. * - * @param {String} selector. + * @param {string} selector. * @return {Array} */ _multiFrameQuerySelectorAll(selector) { @@ -1153,7 +1153,7 @@ class WalkerActor extends Actor { * Get a list of nodes that match the given XPath in all known frames of * the current content page. * - * @param {String} xPath. + * @param {string} xPath. * @return {Array} */ _multiFrameXPath(xPath) { @@ -1185,7 +1185,7 @@ class WalkerActor extends Actor { * Return a NodeListActor with all nodes that match the given XPath in all * frames of the current content page. * - * @param {String} xPath + * @param {string} xPath */ multiFrameXPath(xPath) { return new NodeListActor(this, this._multiFrameXPath(xPath)); @@ -1876,7 +1876,7 @@ class WalkerActor extends Actor { * Set the state of some subset of mutation breakpoint types for this actor. * * @param {NodeActor} node The node to set breakpoint info for. - * @param {Object} bps A subset of the breakpoints for this actor that + * @param {object} bps A subset of the breakpoints for this actor that * should be updated to new states. */ setMutationBreakpoints(node, bps) { @@ -1914,7 +1914,7 @@ class WalkerActor extends Actor { * Update the mutation breakpoint state for the given DOM node. * * @param {Node} rawNode The DOM node. - * @param {Object} bpsForNode The state of each mutation bp type we support. + * @param {object} bpsForNode The state of each mutation bp type we support. */ _updateMutationBreakpointState(mutationReason, rawNode, bpsForNode) { const rawDoc = rawNode.ownerDocument || rawNode; @@ -2562,7 +2562,7 @@ class WalkerActor extends Actor { * Check if a node is attached to the DOM tree of the current page. * * @param {Node} rawNode - * @return {Boolean} false if the node is removed from the tree or within a + * @return {boolean} false if the node is removed from the tree or within a * document fragment */ _isInDOMTree(rawNode) { @@ -2686,7 +2686,7 @@ class WalkerActor extends Actor { * toolbox.getPanel("inspector").selection.setNodeFront(nodeFront); * }); * - * @param {String} actorID The ID for the actor that has a reference to the + * @param {string} actorID The ID for the actor that has a reference to the * DOM node. * @param {Array} path Where, on the actor, is the DOM node stored. If in the * scope of the actor, the node is available as `this.data.node`, then this diff --git a/devtools/server/actors/layout.js b/devtools/server/actors/layout.js @@ -163,7 +163,7 @@ class FlexItemActor extends Actor { * The FlexboxActor instance. * @param {DOMNode} element * The flex item element. - * @param {Object} flexItemSizing + * @param {object} flexItemSizing * The flex item sizing data. */ constructor(flexboxActor, element, flexItemSizing) { @@ -374,9 +374,9 @@ class LayoutActor extends Actor { * * @param {Node|NodeActor} node * The node to start iterating at. - * @param {String} type + * @param {string} type * Can be "grid" or "flex", the display type we are searching for. - * @param {Boolean} onlyLookAtContainer + * @param {boolean} onlyLookAtContainer * If true, only look at given node's container and iterate from there. * @return {GridActor|FlexboxActor|null} * The GridActor or FlexboxActor of the grid/flex container of the given node. @@ -459,7 +459,7 @@ class LayoutActor extends Actor { * * @param {Node|NodeActor} node * The node to start iterating at. - * @param {Boolean|null} onlyLookAtParents + * @param {boolean | null} onlyLookAtParents * If true, skip the passed node and only start looking at its parent and up. * @return {FlexboxActor|null} * The FlexboxActor of the flex container of the given node. Otherwise, returns diff --git a/devtools/server/actors/network-monitor/network-content.js b/devtools/server/actors/network-monitor/network-content.js @@ -52,9 +52,9 @@ class NetworkContentActor extends Actor { /** * Send an HTTP request * - * @param {Object} request + * @param {object} request * The details of the HTTP Request. - * @return {Number} + * @return {number} * The channel id for the request */ async sendHTTPRequest(request) { @@ -139,9 +139,9 @@ class NetworkContentActor extends Actor { /** * Gets the stacktrace for the specified network resource. * - * @param {Number} resourceId + * @param {number} resourceId * The id for the network resource - * @return {Object} + * @return {object} * The response packet - stack trace. */ getStackTrace(resourceId) { diff --git a/devtools/server/actors/network-monitor/network-event-actor.js b/devtools/server/actors/network-monitor/network-event-actor.js @@ -50,16 +50,16 @@ function isFileChannel(channel) { * @constructor * @param {DevToolsServerConnection} conn * The connection into which this Actor will be added. - * @param {Object} sessionContext + * @param {object} sessionContext * The Session Context to help know what is debugged. * See devtools/server/actors/watcher/session-context.js - * @param {Object} options + * @param {object} options * Dictionary object with the following attributes: * - onNetworkEventUpdate: optional function * Callback for updates for the network event * - onNetworkEventDestroy: optional function * Callback for the destruction of the network event - * @param {Object} networkEventOptions + * @param {object} networkEventOptions * Object describing the network event or the configuration of the * network observer, and which cannot be easily inferred from the raw * channel. diff --git a/devtools/server/actors/network-monitor/network-parent.js b/devtools/server/actors/network-monitor/network-parent.js @@ -127,7 +127,7 @@ class NetworkParentActor extends Actor { /** * Blocks the requests based on the filters * - * @param {Object} filters + * @param {object} filters */ blockRequest(filters) { if (!this.networkEventWatcher) { @@ -139,7 +139,7 @@ class NetworkParentActor extends Actor { /** * Unblocks requests based on the filters * - * @param {Object} filters + * @param {object} filters */ unblockRequest(filters) { if (!this.networkEventWatcher) { diff --git a/devtools/server/actors/object.js b/devtools/server/actors/object.js @@ -165,7 +165,7 @@ class ObjectActor extends Actor { /** * Returns a grip for this actor for returning in a protocol message. * - * @param {Number} depth + * @param {number} depth * Current depth in the generated preview object sent to the client. */ form({ depth = 0 } = {}) { @@ -287,9 +287,9 @@ class ObjectActor extends Actor { /** * Populate the `preview` property on `grip` given its type. * - * @param {Object} grip + * @param {object} grip * Object onto which preview data attribute should be added. - * @param {Number} depth + * @param {number} depth * Current depth in the generated preview object sent to the client. */ _populateGripPreview(grip, depth) { @@ -365,7 +365,7 @@ class ObjectActor extends Actor { * Handle a protocol request to provide the prototype and own properties of * the object. * - * @returns {Object} An object containing the data of this.obj, of the following form: + * @returns {object} An object containing the data of this.obj, of the following form: * - {Object} prototype: The descriptor of this.obj's prototype. * - {Object} ownProperties: an object where the keys are the names of the * this.obj's ownProperties, and the values the descriptors of @@ -421,7 +421,7 @@ class ObjectActor extends Actor { * @param array ownProperties * The array that holds the list of known ownProperties names for * |this.obj|. - * @param {Number} depth + * @param {number} depth * Current depth in the generated preview object sent to the client. * @param number [limit=Infinity] * Optional limit of getter values to find. @@ -521,7 +521,7 @@ class ObjectActor extends Actor { /** * Evaluate the getter function |desc.get|. * - * @param {Object} getter + * @param {object} getter */ _evaluateGetter(getter) { const result = getter.call(this.obj); @@ -788,7 +788,7 @@ function safeGetOwnPropertyDescriptor(obj, name) { /** * Check if the value is rejected promise * - * @param {Object} getterValue + * @param {object} getterValue * @returns {boolean} true if the value is rejected promise, false otherwise. */ function isRejectedPromise(getterValue) { diff --git a/devtools/server/actors/object/ObjectActorPool.js b/devtools/server/actors/object/ObjectActorPool.js @@ -27,9 +27,9 @@ loader.lazyRequireGetter( * * @param {ThreadActor} threadActor * The related Thread Actor from which JS values are coming from. - * @param {String} label + * @param {string} label * Pool's description (for debugging purpose) - * @param {Boolean} uniqueActorPerValue + * @param {boolean} uniqueActorPerValue * Ensure instantiating only one Object Actor for each unique JS Value * passed to createObjectGrip. */ diff --git a/devtools/server/actors/object/previewers.js b/devtools/server/actors/object/previewers.js @@ -845,9 +845,9 @@ function temporalPreviewer(cls, objectActor, grip) { /** * @param {ObjectActor} objectActor - * @param {Object} grip: The grip built by the objectActor, for which we need to populate + * @param {object} grip: The grip built by the objectActor, for which we need to populate * the `preview` property. - * @param {Number} depth + * @param {number} depth * Depth of the object compared to the top level object, * when we are inspecting nested attributes. * @returns diff --git a/devtools/server/actors/object/property-descriptor.js b/devtools/server/actors/object/property-descriptor.js @@ -18,7 +18,7 @@ const { * The object actor of the object we are current listing properties. * @param string name * The property that the descriptor is generated for. - * @param {Number} depth + * @param {number} depth * Current depth in the generated preview object sent to the client. * @param boolean [onlyEnumerable] * Optional: true if you want a descriptor only for an enumerable diff --git a/devtools/server/actors/object/symbol.js b/devtools/server/actors/object/symbol.js @@ -17,7 +17,7 @@ loader.lazyRequireGetter( * Creates an actor for the specified symbol. * * @param {ThreadActor} threadActor: The related thread actor. - * @param {Symbol} symbol: The symbol we want to create an actor for. + * @param {symbol} symbol: The symbol we want to create an actor for. */ class SymbolActor extends Actor { constructor(threadActor, symbol) { diff --git a/devtools/server/actors/object/utils.js b/devtools/server/actors/object/utils.js @@ -107,9 +107,9 @@ function unwrapDebuggeeValue(value) { * The debuggee value. * @param {Pool} pool * The pool where the created actor will be added to. - * @param {Number} [depth] + * @param {number} [depth] * The current depth within the chain of nested object actor being previewed. - * @param {Object} [objectActorAttributes] + * @param {object} [objectActorAttributes] * An optional object whose properties will be assigned to the ObjectActor if one * is created. */ @@ -184,8 +184,8 @@ function createValueGrip(threadActor, value, pool, depth = 0, objectActorAttribu /** * Returns a grip for the passed BigInt * - * @param {BigInt} value - * @returns {Object} + * @param {bigint} value + * @returns {object} */ function createBigIntValueGrip(value) { return { diff --git a/devtools/server/actors/page-style.js b/devtools/server/actors/page-style.js @@ -172,9 +172,9 @@ class PageStyleActor extends Actor { * Return or create a StyleRuleActor for the given item. * * @param {CSSStyleRule|Element} item - * @param {String} pseudoElement An optional pseudo-element type in cases when the CSS + * @param {string} pseudoElement An optional pseudo-element type in cases when the CSS * rule applies to a pseudo-element. - * @param {Boolean} userAdded: Optional boolean to distinguish rules added by the user. + * @param {boolean} userAdded: Optional boolean to distinguish rules added by the user. * @return {StyleRuleActor} The newly created, or cached, StyleRuleActor for this item. */ _styleRef(item, pseudoElement, userAdded = false) { @@ -215,7 +215,7 @@ class PageStyleActor extends Actor { /** * Get the StyleRuleActor matching the given rule id or null if no match is found. * - * @param {String} ruleId + * @param {string} ruleId * Actor ID of the StyleRuleActor * @return {StyleRuleActor|null} */ @@ -236,14 +236,14 @@ class PageStyleActor extends Actor { * Get the computed style for a node. * * @param {NodeActor} node - * @param {Object} options - * @param {String} options.filter: A string filter that affects the "matched" handling. - * @param {Array<String>} options.filterProperties: An array of properties names that + * @param {object} options + * @param {string} options.filter: A string filter that affects the "matched" handling. + * @param {Array<string>} options.filterProperties: An array of properties names that * you would like returned. - * @param {Boolean} options.markMatched: true if you want the 'matched' property to be + * @param {boolean} options.markMatched: true if you want the 'matched' property to be * added when a computed property has been modified by a style included by `filter`. - * @param {Boolean} options.onlyMatched: true if unmatched properties shouldn't be included. - * @param {Boolean} options.clearCache: true if the cssLogic cache should be cleared. + * @param {boolean} options.onlyMatched: true if unmatched properties shouldn't be included. + * @param {boolean} options.clearCache: true if the cssLogic cache should be cleared. * * @returns a JSON blob with the following form: * { @@ -778,10 +778,10 @@ class PageStyleActor extends Actor { /** * @param {DOMNode} rawNode * @param {StyleRuleActor} styleRuleActor - * @param {Object} params - * @param {Boolean} params.inherited - * @param {Boolean} params.isSystem - * @param {String|null} params.pseudoElement + * @param {object} params + * @param {boolean} params.inherited + * @param {boolean} params.isSystem + * @param {string | null} params.pseudoElement * @returns Object */ _getRuleItem(rule, rawNode, { inherited, isSystem, pseudoElement }) { @@ -983,7 +983,7 @@ class PageStyleActor extends Actor { * * @param {NodeActor} nodeActor the node * @param {CSSStyleRule} matchingRule the rule to find the entry for - * @return {Object|null} An entry as returned by _getAllElementRules, or null if no entry + * @return {object | null} An entry as returned by _getAllElementRules, or null if no entry * matching the passed rule was find */ findEntryMatchingRule(nodeActor, matchingRule) { @@ -1125,13 +1125,13 @@ class PageStyleActor extends Actor { * as information about the type of box, its position, z-index, etc... * * @param {NodeActor} node - * @param {Object} options The only available option is autoMargins. + * @param {object} options The only available option is autoMargins. * If set to true, the element's margins will receive an extra check to see * whether they are set to "auto" (knowing that the computed-style in this * case would return "0px"). * The returned object will contain an extra property (autoMargins) listing * all margins that are set to auto, e.g. {top: "auto", left: "auto"}. - * @return {Object} + * @return {object} */ getLayout(node, options) { this.cssLogic.highlight(node.rawNode); @@ -1251,7 +1251,7 @@ class PageStyleActor extends Actor { * Adds a new rule, and returns the new StyleRuleActor. * * @param {NodeActor} node - * @param {String} pseudoClasses The list of pseudo classes to append to the + * @param {string} pseudoClasses The list of pseudo classes to append to the * new selector. * @returns {StyleRuleActor} the new rule */ @@ -1334,11 +1334,11 @@ class PageStyleActor extends Actor { /** * Get an array of existing attribute values in a node document. * - * @param {String} search: A string to filter attribute value on. - * @param {String} attributeType: The type of attribute we want to retrieve the values. + * @param {string} search: A string to filter attribute value on. + * @param {string} attributeType: The type of attribute we want to retrieve the values. * @param {Element} node: The element we want to get possible attributes for. This will * be used to get the document where the search is happening. - * @returns {Array<String>} An array of strings + * @returns {Array<string>} An array of strings */ getAttributesInOwnerDocument(search, attributeType, node) { if (!search) { @@ -1376,9 +1376,9 @@ class PageStyleActor extends Actor { * Collect attribute values from the document DOM tree, matching the passed filter and * type, to the result Set. * - * @param {Set<String>} result: A Set to which the results will be added. - * @param {String} search: A string to filter attribute value on. - * @param {String} attributeType: The type of attribute we want to retrieve the values. + * @param {Set<string>} result: A Set to which the results will be added. + * @param {string} search: A string to filter attribute value on. + * @param {string} attributeType: The type of attribute we want to retrieve the values. * @param {Document} targetDocument: The document the search occurs in. * @param {Node} currentNode: The current element rawNode */ @@ -1425,9 +1425,9 @@ class PageStyleActor extends Actor { * Collect attribute values from the document stylesheets, matching the passed filter * and type, to the result Set. * - * @param {Set<String>} result: A Set to which the results will be added. - * @param {String} search: A string to filter attribute value on. - * @param {String} attributeType: The type of attribute we want to retrieve the values. + * @param {Set<string>} result: A Set to which the results will be added. + * @param {string} search: A string to filter attribute value on. + * @param {string} attributeType: The type of attribute we want to retrieve the values. * It only supports "class" and "id" at the moment. * @param {Document} targetDocument: The document the search occurs in. */ @@ -1460,10 +1460,10 @@ class PageStyleActor extends Actor { * Collect attribute values from the rule, matching the passed filter and type, to the * result Set. * - * @param {Set<String>} result: A Set to which the results will be added. + * @param {Set<string>} result: A Set to which the results will be added. * @param {Rule} rule: The rule the search occurs in. - * @param {String} search: A string to filter attribute value on. - * @param {String} attributeType: The type of attribute we want to retrieve the values. + * @param {string} search: A string to filter attribute value on. + * @param {string} attributeType: The type of attribute we want to retrieve the values. * It only supports "class" and "id" at the moment. */ _collectAttributesFromRule(result, rule, search, attributeType) { diff --git a/devtools/server/actors/reflow.js b/devtools/server/actors/reflow.js @@ -190,7 +190,7 @@ class Observable { * make sure all reflows which occurred before switching the mode on or off are * either observed or ignored depending on the current mode. * - * @param {Boolean} ignore + * @param {boolean} ignore * @param {DOMNode} syncReflowNode The node to use to force a sync reflow */ var gIgnoreLayoutChanges = false; @@ -343,9 +343,9 @@ class LayoutChangesObserver extends EventEmitter { * reflows array. * The EVENT_BATCHING_DELAY loop will take care of it later. * - * @param {Number} start When the reflow started - * @param {Number} end When the reflow ended - * @param {Boolean} isInterruptible + * @param {number} start When the reflow started + * @param {number} end When the reflow ended + * @param {boolean} isInterruptible */ _onReflow(start, end, isInterruptible) { if (gIgnoreLayoutChanges) { diff --git a/devtools/server/actors/resources/console-messages.js b/devtools/server/actors/resources/console-messages.js @@ -163,8 +163,8 @@ module.exports = ConsoleMessageWatcher; * sub-properties we might need. * * @param {TargetActor} targetActor: The Target Actor from which this object originates. - * @param {Object} result: The console.table message. - * @returns {Object} An object containing the properties of the first argument of the + * @param {object} result: The console.table message. + * @returns {object} An object containing the properties of the first argument of the * console.table call. */ function getConsoleTableMessageItems(targetActor, result) { diff --git a/devtools/server/actors/resources/css-registered-properties.js b/devtools/server/actors/resources/css-registered-properties.js @@ -212,7 +212,7 @@ class CSSRegisteredPropertiesWatcher { }; /** - * @param {Array<Object>} updates: Array of update object, which have the following properties: + * @param {Array<object>} updates: Array of update object, which have the following properties: * - {InspectorCSSPropertyDefinition} registeredProperty: The property definition * of the updated property * - {Object} resourceUpdates: An object containing all the fields that are diff --git a/devtools/server/actors/resources/jstracer-state.js b/devtools/server/actors/resources/jstracer-state.js @@ -58,9 +58,9 @@ class TracingStateWatcher { * in case it stops by itself, instead of being stopped when the Actor's stopTracing * method is called by the user. * - * @param {Boolean} enabled + * @param {boolean} enabled * True if the tracer starts tracing, false it it stops. - * @param {String} reason + * @param {string} reason * Optional string to justify why the tracer stopped. */ async onTracingToggled(enabled, reason) { diff --git a/devtools/server/actors/resources/network-events.js b/devtools/server/actors/resources/network-events.js @@ -115,7 +115,7 @@ class NetworkEventWatcher { * If persist is enabled, we will keep all informations for all documents, leading * to lots of allocations! * - * @param {Boolean} enabled + * @param {boolean} enabled */ setPersist(enabled) { this.persist = enabled; @@ -142,7 +142,7 @@ class NetworkEventWatcher { /** * Instruct to save or ignore request and response bodies * - * @param {Boolean} save + * @param {boolean} save */ setSaveRequestAndResponseBodies(save) { this.listener.setSaveRequestAndResponseBodies(save); @@ -151,7 +151,7 @@ class NetworkEventWatcher { /** * Block requests based on the filters * - * @param {Object} filters + * @param {object} filters */ blockRequest(filters) { this.listener.blockRequest(filters); @@ -160,7 +160,7 @@ class NetworkEventWatcher { /** * Unblock requests based on the fitlers * - * @param {Object} filters + * @param {object} filters */ unblockRequest(filters) { this.listener.unblockRequest(filters); diff --git a/devtools/server/actors/resources/storage/cookies.js b/devtools/server/actors/resources/storage/cookies.js @@ -379,9 +379,9 @@ class CookiesStorageActor extends BaseStorageActor { /** * Pass the editItem command from the content to the chrome process. * - * @param {Object} data + * @param {object} data * See editCookie() for format details. - * @returns {Object} An object with an "errorString" property. + * @returns {object} An object with an "errorString" property. */ async editItem(data) { const potentialErrorMessage = this.editCookie(data); @@ -391,9 +391,9 @@ class CookiesStorageActor extends BaseStorageActor { /** * Add a cookie on given host * - * @param {String} guid - * @param {String} host - * @returns {Object} An object with an "errorString" property. + * @param {string} guid + * @param {string} host + * @returns {object} An object with an "errorString" property. */ async addItem(guid, host) { const window = this.storageActor.getWindowFromHost(host); @@ -420,9 +420,9 @@ class CookiesStorageActor extends BaseStorageActor { /** * Add a cookie on given principal * - * @param {String} guid + * @param {string} guid * @param {Principal} principal - * @returns {String|null} If the cookie couldn't be added (e.g. it's invalid), + * @returns {string | null} If the cookie couldn't be added (e.g. it's invalid), * an error string will be returned. */ addCookie(guid, principal) { @@ -464,7 +464,7 @@ class CookiesStorageActor extends BaseStorageActor { /** * Apply the results of a cookie edit. * - * @param {Object} data + * @param {object} data * An object in the following format: * { * host: "http://www.mozilla.org", @@ -486,7 +486,7 @@ class CookiesStorageActor extends BaseStorageActor { * isHttpOnly: "false" * } * } - * @returns {(String|null)} If cookie couldn't be updated (e.g. it's invalid), an error string + * @returns {(string | null)} If cookie couldn't be updated (e.g. it's invalid), an error string * will be returned. */ // eslint-disable-next-line complexity diff --git a/devtools/server/actors/resources/storage/extension-storage.js b/devtools/server/actors/resources/storage/extension-storage.js @@ -131,7 +131,7 @@ class ExtensionStorageActor extends BaseStorageActor { * This method asynchronously reads the storage data for the target extension * and caches this data into this.hostVsStores. * - * @param {String} host - the hostname for the extension + * @param {string} host - the hostname for the extension */ async populateStoresForHost(host) { if (host !== this.extensionHostURL) { @@ -246,8 +246,8 @@ class ExtensionStorageActor extends BaseStorageActor { * except where it would throw an unhandled error (i.e. for a `BigInt` or `undefined` * `item.value`). * - * @param {Object} item - The storage item to convert - * @param {String} item.name - The storage item key + * @param {object} item - The storage item to convert + * @param {string} item.name - The storage item key * @param {*} item.value - The storage item value * @return {extensionobject} */ diff --git a/devtools/server/actors/resources/storage/index.js b/devtools/server/actors/resources/storage/index.js @@ -207,8 +207,8 @@ class BaseStorageActor extends Actor { * * @param {window} window * The window which was removed. - * @param {Object} options - * @param {Boolean} options.dontCheckHost + * @param {object} options + * @param {boolean} options.dontCheckHost * If set to true, the function won't check if the host still is in this.hosts. * This is helpful in the case of the StorageActorMock, as the `hosts` getter * uses its `windows` getter, and at this point in time the window which is diff --git a/devtools/server/actors/resources/storage/indexed-db.js b/devtools/server/actors/resources/storage/indexed-db.js @@ -146,7 +146,7 @@ ObjectStoreMetadata.prototype = { * The host associated with this indexed db. * @param {IDBDatabase} db * The particular indexed db. - * @param {String} storage + * @param {string} storage * Storage type, either "temporary", "default" or "persistent". */ function DatabaseMetadata(origin, db, storage) { @@ -878,9 +878,9 @@ class IndexedDBStorageActor extends BaseStorageActor { * The principal of the given document. * @param {string} dbName * The name of the indexed db from the above host. - * @param {String} storage + * @param {string} storage * Storage type, either "temporary", "default" or "persistent". - * @param {Object} requestOptions + * @param {object} requestOptions * An object in the following format: * { * objectStore: The name of the object store from the above db, diff --git a/devtools/server/actors/resources/storage/local-and-session-storage.js b/devtools/server/actors/resources/storage/local-and-session-storage.js @@ -102,7 +102,7 @@ class LocalOrSessionStorageActor extends BaseStorageActor { /** * Edit localStorage or sessionStorage fields. * - * @param {Object} data + * @param {object} data * See editCookie() for format details. */ async editItem({ host, field, oldValue, items }) { diff --git a/devtools/server/actors/resources/utils/nsi-console-listener-watcher.js b/devtools/server/actors/resources/utils/nsi-console-listener-watcher.js @@ -77,7 +77,7 @@ class nsIConsoleListenerWatcher { * Return false if the watcher shouldn't be created. * * @param {TargetActor} targetActor - * @return {Boolean} + * @return {boolean} */ shouldHandleTarget() { return true; @@ -89,7 +89,7 @@ class nsIConsoleListenerWatcher { * * @param {TargetActor} targetActor * @param {nsIScriptError|nsIConsoleMessage} message - * @return {Boolean} + * @return {boolean} */ shouldHandleMessage() { throw new Error( diff --git a/devtools/server/actors/resources/utils/parent-process-storage.js b/devtools/server/actors/resources/utils/parent-process-storage.js @@ -201,7 +201,7 @@ class ParentProcessStorage { * - <bf-cache-navigation-pageshow> (to cover history navications) * * @param {WindowGlobal} windowGlobal - * @param {Boolean} isBfCacheNavigation + * @param {boolean} isBfCacheNavigation */ async _onNewWindowGlobal(windowGlobal, isBfCacheNavigation) { // We instantiate only one instance of parent process storage actors per toolbox @@ -405,7 +405,7 @@ class StorageActorMock extends EventEmitter { /** * Get the browsing contexts matching the given host. * - * @param {String} host: The host for which we want the browsing contexts + * @param {string} host: The host for which we want the browsing contexts * @returns Array<BrowsingContext> */ getBrowsingContextsFromHost(host) { diff --git a/devtools/server/actors/root.js b/devtools/server/actors/root.js @@ -347,7 +347,7 @@ class RootActor extends Actor { /** * This function can receive the following option from devtools client. * - * @param {Object} option + * @param {object} option * - iconDataURL: {boolean} * When true, make data url from the icon of addon, then make possible to * access by iconDataURL in the actor. The iconDataURL is useful when diff --git a/devtools/server/actors/screenshot-content.js b/devtools/server/actors/screenshot-content.js @@ -35,14 +35,14 @@ exports.ScreenshotContentActor = class ScreenshotContentActor extends Actor { * Retrieve some window-related information that will be passed to the parent process * to actually generate the screenshot. * - * @param {Object} args - * @param {Boolean} args.fullpage: Should the screenshot be the height of the whole page - * @param {String} args.selector: A CSS selector for the element we should take the + * @param {object} args + * @param {boolean} args.fullpage: Should the screenshot be the height of the whole page + * @param {string} args.selector: A CSS selector for the element we should take the * screenshot of. The function will return true for the `error` property * if the screenshot does not match any element. - * @param {String} args.nodeActorID: The actorID of the node actor matching the element + * @param {string} args.nodeActorID: The actorID of the node actor matching the element * we should take the screenshot of. - * @returns {Object} An object with the following properties: + * @returns {object} An object with the following properties: * - error {Boolean}: Set to true if an issue was encountered that prevents * taking the screenshot * - messages {Array<Object{text, level}>}: An array of objects representing diff --git a/devtools/server/actors/style-rule.js b/devtools/server/actors/style-rule.js @@ -82,11 +82,11 @@ const XHTML_NS = "http://www.w3.org/1999/xhtml"; class StyleRuleActor extends Actor { /** * - * @param {Object} options + * @param {object} options * @param {PageStyleActor} options.pageStyle * @param {CSSStyleRule|Element} options.item - * @param {Boolean} options.userAdded: Optional boolean to distinguish rules added by the user. - * @param {String} options.pseudoElement An optional pseudo-element type in cases when + * @param {boolean} options.userAdded: Optional boolean to distinguish rules added by the user. + * @param {string} options.pseudoElement An optional pseudo-element type in cases when * the CSS rule applies to a pseudo-element. */ constructor({ pageStyle, item, userAdded = false, pseudoElement = null }) { @@ -213,7 +213,7 @@ class StyleRuleActor extends Actor { * - the rule's ancestor rules (@media, @supports, @keyframes), if any * - the rule's position within its ancestor tree, if any * - * @return {Object} + * @return {object} */ get metadata() { const data = {}; @@ -636,7 +636,7 @@ class StyleRuleActor extends Actor { /** * Return the rule cssText if applicable, null otherwise * - * @returns {String|null} + * @returns {string | null} */ _getCssText() { switch (this.ruleClassName) { @@ -655,8 +655,8 @@ class StyleRuleActor extends Actor { /** * Parse the rule declarations from its text. * - * @param {Object} options - * @param {Boolean} options.parseComments + * @param {object} options + * @param {boolean} options.parseComments * @returns {Array} @see parseNamedDeclarations */ parseRuleDeclarations({ parseComments }) { @@ -677,7 +677,7 @@ class StyleRuleActor extends Actor { /** * - * @returns {Array<Object>} ancestorData: An array of ancestor item data + * @returns {Array<object>} ancestorData: An array of ancestor item data */ _getAncestorDataForForm() { const ancestorData = []; @@ -792,8 +792,8 @@ class StyleRuleActor extends Actor { * Send an event notifying that the location of the rule has * changed. * - * @param {Number} line the new line number - * @param {Number} column the new column number + * @param {number} line the new line number + * @param {number} column the new column number */ _notifyLocationChanged(line, column) { this.emit("location-changed", line, column); @@ -893,7 +893,7 @@ class StyleRuleActor extends Actor { * The authored text will include invalid and otherwise ignored * properties. * - * @param {Boolean} skipCache + * @param {boolean} skipCache * If a value for authoredText was previously found and cached, * ignore it and parse the stylehseet again. The authoredText * may be outdated if a descendant of this rule has changed. @@ -945,7 +945,7 @@ class StyleRuleActor extends Actor { * selector that uniquely identifies the element and with the rule body consisting of * the element's style attribute. * - * @return {String} + * @return {string} */ async getRuleText() { // Bail out if the rule is not supported or not an element inline style. @@ -988,7 +988,7 @@ class StyleRuleActor extends Actor { * Set the contents of the rule. This rewrites the rule in the * stylesheet and causes it to be re-evaluated. * - * @param {String} newText + * @param {string} newText * The new text of the rule * @param {Array} modifications * Array with modifications applied to the rule. Contains objects like: @@ -1136,9 +1136,9 @@ class StyleRuleActor extends Actor { * current rule. Returns the newly inserted css rule or null if the rule is * unsuccessfully inserted to the parent style sheet. * - * @param {String} value + * @param {string} value * The new selector value - * @param {Boolean} editAuthored + * @param {boolean} editAuthored * True if the selector should be updated by editing the * authored text; false if the selector should be updated via * CSSOM. @@ -1218,11 +1218,11 @@ class StyleRuleActor extends Actor { * Take an object with instructions to modify a CSS declaration and log an object with * normalized metadata which describes the change in the context of this rule. * - * @param {Object} change + * @param {object} change * Data about a modification to a declaration. @see |modifyProperties()| - * @param {Object} newDeclarations + * @param {object} newDeclarations * The current declarations array to get the latest values, names... - * @param {Object} oldDeclarations + * @param {object} oldDeclarations * The previous declarations array to use to fetch old values, names... */ logDeclarationChange(change, newDeclarations, oldDeclarations) { @@ -1309,9 +1309,9 @@ class StyleRuleActor extends Actor { * Helper method for tracking CSS changes. Logs the change of this rule's selector as * two operations: a removal using the old selector and an addition using the new one. * - * @param {String} oldSelector + * @param {string} oldSelector * This rule's previous selector. - * @param {String} newSelector + * @param {string} newSelector * This rule's new selector. */ logSelectorChange(oldSelector, newSelector) { @@ -1343,13 +1343,13 @@ class StyleRuleActor extends Actor { * * @param {DOMNode} node * The current selected element - * @param {String} value + * @param {string} value * The new selector value - * @param {Boolean} editAuthored + * @param {boolean} editAuthored * True if the selector should be updated by editing the * authored text; false if the selector should be updated via * CSSOM. - * @returns {Promise<Object>} + * @returns {Promise<object>} * Returns an object that contains the applied style properties of the * new rule and a boolean indicating whether or not the new selector * matches the current selected element @@ -1399,9 +1399,9 @@ class StyleRuleActor extends Actor { /** * Get the eligible query container for a given @container rule and a given node * - * @param {Number} ancestorRuleIndex: The index of the @container rule in this.ancestorRules + * @param {number} ancestorRuleIndex: The index of the @container rule in this.ancestorRules * @param {NodeActor} nodeActor: The nodeActor for which we want to retrieve the query container - * @returns {Object} An object with the following properties: + * @returns {object} An object with the following properties: * - node: {NodeActor|null} The nodeActor representing the query container, * null if none were found * - containerType: {string} The computed `containerType` value of the query container @@ -1444,7 +1444,7 @@ class StyleRuleActor extends Actor { * If any have changed their used/unused state, potentially as a result of changes in * another rule, fire a "rule-updated" event with this rule actor in its latest state. * - * @param {Boolean} forceRefresh: Set to true to emit "rule-updated", even if the state + * @param {boolean} forceRefresh: Set to true to emit "rule-updated", even if the state * of the declarations didn't change. */ maybeRefresh(forceRefresh) { @@ -1491,10 +1491,10 @@ exports.StyleRuleActor = StyleRuleActor; * Compute the start and end offsets of a rule's selector text, given * the CSS text and the line and column at which the rule begins. * - * @param {String} initialText - * @param {Number} line (1-indexed) - * @param {Number} column (1-indexed) - * @return {array} An array with two elements: [startOffset, endOffset]. + * @param {string} initialText + * @param {number} line (1-indexed) + * @param {number} column (1-indexed) + * @return {Array} An array with two elements: [startOffset, endOffset]. * The elements mark the bounds in |initialText| of * the CSS rule's selector. */ diff --git a/devtools/server/actors/target-configuration.js b/devtools/server/actors/target-configuration.js @@ -127,7 +127,7 @@ class TargetConfigurationActor extends Actor { * Returns whether or not this actor should handle the flag that should be set on the * BrowsingContext in the parent process. * - * @returns {Boolean} + * @returns {boolean} */ _shouldHandleConfigurationInParentProcess() { // Only handle parent process configuration if the watcherActor is tied to a @@ -217,7 +217,7 @@ class TargetConfigurationActor extends Actor { /** * - * @param {Object} configuration + * @param {object} configuration * @returns Promise<Object> Applied configuration object */ async updateConfiguration(configuration) { @@ -242,7 +242,7 @@ class TargetConfigurationActor extends Actor { /** * - * @param {Object} configuration: See `updateConfiguration` + * @param {object} configuration: See `updateConfiguration` */ _updateParentProcessConfiguration(configuration) { // Process "tracerOptions" for all session types, as this isn't specific to tab debugging @@ -384,9 +384,9 @@ class TargetConfigurationActor extends Actor { /** * Set a custom user agent on the page * - * @param {String} userAgent: The user agent to set on the page. If null, will reset the + * @param {string} userAgent: The user agent to set on the page. If null, will reset the * user agent to its original value. - * @returns {Boolean} Whether the user agent was changed or not. + * @returns {boolean} Whether the user agent was changed or not. */ _setCustomUserAgent(userAgent = "") { if (this._browsingContext.customUserAgent === userAgent) { @@ -433,7 +433,7 @@ class TargetConfigurationActor extends Actor { /** * Set the touchEventsOverride on the browsing context. * - * @param {String} flag: See BrowsingContext.webidl `TouchEventsOverride` enum for values. + * @param {string} flag: See BrowsingContext.webidl `TouchEventsOverride` enum for values. */ _setTouchEventsOverride(flag) { if (this._browsingContext.touchEventsOverride === flag) { @@ -470,9 +470,9 @@ class TargetConfigurationActor extends Actor { * Set an orientation and an angle on the browsing context. This will be applied only * if Responsive Design Mode is enabled. * - * @param {Object} options - * @param {String} options.type: The orientation type of the rotated device. - * @param {Number} options.angle: The rotated angle of the device. + * @param {object} options + * @param {string} options.type: The orientation type of the rotated device. + * @param {number} options.angle: The rotated angle of the device. */ _setRDMPaneOrientation({ type, angle }) { if (this._browsingContext.inRDMPane) { @@ -483,7 +483,7 @@ class TargetConfigurationActor extends Actor { /** * Disable or enable the cache via the browsing context. * - * @param {Boolean} disabled: The state the cache should be changed to + * @param {boolean} disabled: The state the cache should be changed to */ _setCacheDisabled(disabled) { const value = disabled @@ -498,7 +498,7 @@ class TargetConfigurationActor extends Actor { /** * Set the browsing context to offline. * - * @param {Boolean} offline: Whether the network throttling is set to offline + * @param {boolean} offline: Whether the network throttling is set to offline */ _setTabOffline(offline) { if (!this._browsingContext.isDiscarded) { @@ -527,7 +527,7 @@ class TargetConfigurationActor extends Actor { * Note that when `options` is defined, it is meant to be enabled. * It may not actually be tracing yet depending on the passed options. * - * @param {Object} options + * @param {object} options */ _setTracerOptions(options) { if (!options) { diff --git a/devtools/server/actors/targets/base-target-actor.js b/devtools/server/actors/targets/base-target-actor.js @@ -189,7 +189,7 @@ class BaseTargetActor extends Actor { * They are lazily instantiated and so will only be available * if the client called at least one of their method. * - * @param {String} prefix + * @param {string} prefix * Prefix for the actor we would like to retrieve. * Defined in devtools/server/actors/utils/actor-registry.js */ @@ -206,7 +206,7 @@ class BaseTargetActor extends Actor { * Returns true, if the related target scoped actor has already been queried * and instantiated via `getTargetScopedActor` method. * - * @param {String} prefix + * @param {string} prefix * See getTargetScopedActor definition * @return Boolean * True, if the actor has already been instantiated. @@ -232,7 +232,7 @@ class BaseTargetActor extends Actor { * @param {JSON} options * Configuration object provided by the client. * See target-configuration actor. - * @param {Boolean} calledFromDocumentCreate + * @param {boolean} calledFromDocumentCreate * True, when this is called with initial configuration when the related target * actor is instantiated. */ diff --git a/devtools/server/actors/targets/parent-process.js b/devtools/server/actors/targets/parent-process.js @@ -35,10 +35,10 @@ class ParentProcessTargetActor extends WindowGlobalTargetActor { * * @param {DevToolsServerConnection} conn * The connection to the client. - * @param {Boolean} options.isTopLevelTarget + * @param {boolean} options.isTopLevelTarget * flag to indicate if this is the top * level target of the DevTools session - * @param {Object} options.sessionContext + * @param {object} options.sessionContext * The Session Context to help know what is debugged. * See devtools/server/actors/watcher/session-context.js */ diff --git a/devtools/server/actors/targets/target-actor-registry.sys.mjs b/devtools/server/actors/targets/target-actor-registry.sys.mjs @@ -38,9 +38,9 @@ export var TargetActorRegistry = { * In some scenarios, the registry can have multiple target actors for a given * browserId (e.g. the regular DevTools content toolbox + DevTools WebExtensions targets). * - * @param {Object} sessionContext: The Session Context to help know what is debugged. + * @param {object} sessionContext: The Session Context to help know what is debugged. * See devtools/server/actors/watcher/session-context.js - * @param {String} connectionPrefix: DevToolsServerConnection's prefix, in order to select only actor + * @param {string} connectionPrefix: DevToolsServerConnection's prefix, in order to select only actor * related to the same connection. i.e. the same client. * @returns {Array<TargetActor>} */ @@ -66,9 +66,9 @@ export var TargetActorRegistry = { * Helper for tests to help track the number of targets created for a given tab. * (Used by browser_ext_devtools_inspectedWindow.js) * - * @param {Number} browserId: ID for the tab + * @param {number} browserId: ID for the tab * - * @returns {Number} Number of targets for this tab. + * @returns {number} Number of targets for this tab. */ getTargetActorsCountForBrowserElement(browserId) { diff --git a/devtools/server/actors/targets/window-global.js b/devtools/server/actors/targets/window-global.js @@ -761,10 +761,10 @@ class WindowGlobalTargetActor extends BaseTargetActor { /** * Called when the actor is removed from the connection. * - * @params {Object} options - * @params {Boolean} options.isTargetSwitching: Set to true when this is called during + * @params {object} options + * @params {boolean} options.isTargetSwitching: Set to true when this is called during * a target switch. - * @params {Boolean} options.isModeSwitching: Set to true true when this is called as the + * @params {boolean} options.isModeSwitching: Set to true true when this is called as the * result of a change to the devtools.browsertoolbox.scope pref. */ destroy({ isTargetSwitching = false, isModeSwitching = false } = {}) { diff --git a/devtools/server/actors/targets/worker.js b/devtools/server/actors/targets/worker.js @@ -34,15 +34,15 @@ class WorkerTargetActor extends BaseTargetActor { * * @param {DevToolsServerConnection} conn: The connection to the client. * @param {WorkerGlobalScope} workerGlobal: The worker global. - * @param {Object} workerDebuggerData: The worker debugger information - * @param {String} workerDebuggerData.id: The worker debugger id - * @param {String} workerDebuggerData.url: The worker debugger url - * @param {String} workerDebuggerData.type: The worker debugger type - * @param {Number?} workerDebuggerData.relatedDocumentInnerWindowId: (optional) + * @param {object} workerDebuggerData: The worker debugger information + * @param {string} workerDebuggerData.id: The worker debugger id + * @param {string} workerDebuggerData.url: The worker debugger url + * @param {string} workerDebuggerData.type: The worker debugger type + * @param {number?} workerDebuggerData.relatedDocumentInnerWindowId: (optional) * If the worker is spawned from a document, the innerWindowId of it. - * @param {Boolean} workerDebuggerData.workerConsoleApiMessagesDispatchedToMainThread: + * @param {boolean} workerDebuggerData.workerConsoleApiMessagesDispatchedToMainThread: * Value of the dom.worker.console.dispatch_events_to_main_thread pref - * @param {Object} sessionContext: The Session Context to help know what is debugged. + * @param {object} sessionContext: The Session Context to help know what is debugged. * See devtools/server/actors/watcher/session-context.js */ constructor(conn, workerGlobal, workerDebuggerData, sessionContext) { diff --git a/devtools/server/actors/thread.js b/devtools/server/actors/thread.js @@ -611,7 +611,7 @@ class ThreadActor extends Actor { /** * Add event breakpoints to the list of active event breakpoints * - * @param {Array<String>} ids: events to add (e.g. ["event.mouse.click","event.mouse.mousedown"]) + * @param {Array<string>} ids: events to add (e.g. ["event.mouse.click","event.mouse.mousedown"]) */ addEventBreakpoints(ids) { this.setActiveEventBreakpoints( @@ -622,7 +622,7 @@ class ThreadActor extends Actor { /** * Remove event breakpoints from the list of active event breakpoints * - * @param {Array<String>} ids: events to remove (e.g. ["event.mouse.click","event.mouse.mousedown"]) + * @param {Array<string>} ids: events to remove (e.g. ["event.mouse.click","event.mouse.mousedown"]) */ removeEventBreakpoints(ids) { this.setActiveEventBreakpoints( @@ -633,7 +633,7 @@ class ThreadActor extends Actor { /** * Set the the list of active event breakpoints * - * @param {Array<String>} ids: events to add breakpoint for (e.g. ["event.mouse.click","event.mouse.mousedown"]) + * @param {Array<string>} ids: events to add breakpoint for (e.g. ["event.mouse.click","event.mouse.mousedown"]) */ setActiveEventBreakpoints(ids) { this._activeEventBreakpoints = new Set(ids); @@ -1371,7 +1371,7 @@ class ThreadActor extends Actor { * * Note that this is also called when evaluating conditional breakpoints. * - * @param {Boolean} doPause + * @param {boolean} doPause * Should watch for pause or not. `_onExceptionUnwind` function will * then be notified about new caught or uncaught exception being fired. */ @@ -1389,7 +1389,7 @@ class ThreadActor extends Actor { * Note that the thread actor will pause on exception by default. * This method has to be called with a falsy value to disable it. * - * @param {Boolean} doPause + * @param {boolean} doPause * Controls whether we should or should not pause on debugger statement. */ setPauseOnDebuggerStatement(doPause) { @@ -2386,7 +2386,7 @@ PauseActor.prototype = { * @param Debugger.Object wrappedGlobal * The |Debugger.Object| which wraps a global. * - * @returns {Object|undefined} + * @returns {object | undefined} * Returns the unwrapped global object or |undefined| if unwrapping * failed. */ diff --git a/devtools/server/actors/tracer.js b/devtools/server/actors/tracer.js @@ -107,10 +107,10 @@ class TracerActor extends Actor { * Meant for the WebConsole command in order to pass advanced * configuration directly to JavaScriptTracer class. * - * @param {Object} options + * @param {object} options * Options used to configure JavaScriptTracer. * See `JavaScriptTracer.startTracing`. - * @return {Boolean} + * @return {boolean} * True if the tracer starts, or false if it was stopped. */ toggleTracing(options) { @@ -125,7 +125,7 @@ class TracerActor extends Actor { /** * Start tracing. * - * @param {Object} options + * @param {object} options * Options used to configure JavaScriptTracer. * See `JavaScriptTracer.startTracing`. */ @@ -250,7 +250,7 @@ class TracerActor extends Actor { * Queried by THREAD_STATE watcher to send the gecko profiler data * as part of THREAD STATE "stop" resource. * - * @return {Object} Gecko profiler profile object. + * @return {object} Gecko profiler profile object. */ async getProfile() { // #stopResult is a promise diff --git a/devtools/server/actors/tracer/profiler.js b/devtools/server/actors/tracer/profiler.js @@ -17,10 +17,10 @@ class ProfilerTracingListener { /** * Stop the record and return the gecko profiler data. * - * @param {Object} nativeTrace + * @param {object} nativeTrace * If we're using native tracing, this contains a table of what the * native tracer has collected. - * @return {Object} + * @return {object} * The Gecko profile object. */ async stop(nativeTrace) { @@ -56,9 +56,9 @@ class ProfilerTracingListener { * in case it stops by itself, instead of being stopped when the Actor's stopTracing * method is called by the user. * - * @param {Boolean} enabled + * @param {boolean} enabled * True if the tracer starts tracing, false it it stops. - * @return {Boolean} + * @return {boolean} * Return true, if the JavaScriptTracer should log a message to stdout. */ onTracingToggled(enabled) { @@ -90,21 +90,21 @@ class ProfilerTracingListener { /** * Called by JavaScriptTracer class when a new mutation happened on any DOM Element. * - * @param {Object} options - * @param {Number} options.depth + * @param {object} options + * @param {number} options.depth * Represents the depth of the frame in the call stack. - * @param {String} options.prefix + * @param {string} options.prefix * A string to be displayed as a prefix of any logged frame. * @param {nsIStackFrame} options.caller * The JS Callsite which caused this mutation. - * @param {String} options.type + * @param {string} options.type * Type of DOM Mutation: * - "add": Node being added, * - "attributes": Node whose attributes changed, * - "remove": Node being removed, * @param {DOMNode} options.element * The DOM Node related to the current mutation. - * @return {Boolean} + * @return {boolean} * Return true, if the JavaScriptTracer should log a message to stdout. */ onTracingDOMMutation({ depth, prefix, type, caller, element }) { diff --git a/devtools/server/actors/tracer/resources.js b/devtools/server/actors/tracer/resources.js @@ -86,9 +86,9 @@ class ResourcesTracingListener { * in case it stops by itself, instead of being stopped when the Actor's stopTracing * method is called by the user. * - * @param {Boolean} enabled + * @param {boolean} enabled * True if the tracer starts tracing, false it it stops. - * @return {Boolean} + * @return {boolean} * Return true, if the JavaScriptTracer should log a message to stdout. */ onTracingToggled(enabled) { @@ -124,21 +124,21 @@ class ResourcesTracingListener { /** * Called by JavaScriptTracer class when a new mutation happened on any DOM Element. * - * @param {Object} options - * @param {Number} options.depth + * @param {object} options + * @param {number} options.depth * Represents the depth of the frame in the call stack. - * @param {String} options.prefix + * @param {string} options.prefix * A string to be displayed as a prefix of any logged frame. * @param {nsIStackFrame} options.caller * The JS Callsite which caused this mutation. - * @param {String} options.type + * @param {string} options.type * Type of DOM Mutation: * - "add": Node being added, * - "attributes": Node whose attributes changed, * - "remove": Node being removed, * @param {DOMNode} options.element * The DOM Node related to the current mutation. - * @return {Boolean} + * @return {boolean} * Return true, if the JavaScriptTracer should log a message to stdout. */ onTracingDOMMutation({ depth, prefix, type, caller, element }) { @@ -169,14 +169,14 @@ class ResourcesTracingListener { /** * Called by JavaScriptTracer class on each step of a function call. * - * @param {Object} options + * @param {object} options * @param {Debugger.Frame} options.frame * A descriptor object for the JavaScript frame. - * @param {Number} options.depth + * @param {number} options.depth * Represents the depth of the frame in the call stack. - * @param {String} options.prefix + * @param {string} options.prefix * A string to be displayed as a prefix of any logged frame. - * @return {Boolean} + * @return {boolean} * Return true, if the JavaScriptTracer should log the step to stdout. */ onTracingFrameStep({ frame, depth, prefix }) { @@ -255,17 +255,17 @@ class ResourcesTracingListener { * * @param {Debugger.Frame} frame * A descriptor object for the JavaScript frame. - * @param {Number} depth + * @param {number} depth * Represents the depth of the frame in the call stack. - * @param {String} formatedDisplayName + * @param {string} formatedDisplayName * A human readable name for the current frame. - * @param {String} prefix + * @param {string} prefix * A string to be displayed as a prefix of any logged frame. - * @param {String} currentDOMEvent + * @param {string} currentDOMEvent * If this is a top level frame (depth==0), and we are currently processing * a DOM Event, this will refer to the name of that DOM Event. * Note that it may also refer to setTimeout and setTimeout callback calls. - * @return {Boolean} + * @return {boolean} * Return true, if the JavaScriptTracer should log the frame to stdout. */ onTracingFrame({ @@ -356,25 +356,25 @@ class ResourcesTracingListener { /** * Called by JavaScriptTracer class when a JavaScript frame exits (i.e. a function returns or throw). * - * @param {Object} options - * @param {Number} options.frameId + * @param {object} options + * @param {number} options.frameId * Unique identifier for the current frame. * This should match a frame notified via onTracingFrame. * @param {Debugger.Frame} options.frame * A descriptor object for the JavaScript frame. - * @param {Number} options.depth + * @param {number} options.depth * Represents the depth of the frame in the call stack. - * @param {String} options.formatedDisplayName + * @param {string} options.formatedDisplayName * A human readable name for the current frame. - * @param {String} options.prefix + * @param {string} options.prefix * A string to be displayed as a prefix of any logged frame. - * @param {String} options.why + * @param {string} options.why * A string to explain why the function stopped. * See tracer.sys.mjs's FRAME_EXIT_REASONS. * @param {Debugger.Object|primitive} options.rv * The returned value. It can be the returned value, or the thrown exception. * It is either a primitive object, otherwise it is a Debugger.Object for any other JS Object type. - * @return {Boolean} + * @return {boolean} * Return true, if the JavaScriptTracer should log the frame to stdout. */ onTracingFrameExit({ diff --git a/devtools/server/actors/tracer/stdout.js b/devtools/server/actors/tracer/stdout.js @@ -28,9 +28,9 @@ class StdoutTracingListener { * in case it stops by itself, instead of being stopped when the Actor's stopTracing * method is called by the user. * - * @param {Boolean} enabled + * @param {boolean} enabled * True if the tracer starts tracing, false it it stops. - * @return {Boolean} + * @return {boolean} * Return true, if the JavaScriptTracer should log a message to stdout. */ onTracingToggled(enabled) { @@ -53,21 +53,21 @@ class StdoutTracingListener { /** * Called by JavaScriptTracer class when a new mutation happened on any DOM Element. * - * @param {Object} options - * @param {Number} options.depth + * @param {object} options + * @param {number} options.depth * Represents the depth of the frame in the call stack. - * @param {String} options.prefix + * @param {string} options.prefix * A string to be displayed as a prefix of any logged frame. * @param {nsIStackFrame} options.caller * The JS Callsite which caused this mutation. - * @param {String} options.type + * @param {string} options.type * Type of DOM Mutation: * - "add": Node being added, * - "attributes": Node whose attributes changed, * - "remove": Node being removed, * @param {DOMNode} options.element * The DOM Node related to the current mutation. - * @return {Boolean} + * @return {boolean} * Return true, if the JavaScriptTracer should log a message to stdout. */ onTracingDOMMutation({ depth, prefix, type, caller, element }) { @@ -78,14 +78,14 @@ class StdoutTracingListener { /** * Called by JavaScriptTracer class on each step of a function call. * - * @param {Object} options + * @param {object} options * @param {Debugger.Frame} options.frame * A descriptor object for the JavaScript frame. - * @param {Number} options.depth + * @param {number} options.depth * Represents the depth of the frame in the call stack. - * @param {String} options.prefix + * @param {string} options.prefix * A string to be displayed as a prefix of any logged frame. - * @return {Boolean} + * @return {boolean} * Return true, if the JavaScriptTracer should log the step to stdout. */ onTracingFrameStep({ frame, depth, prefix }) { @@ -114,17 +114,17 @@ class StdoutTracingListener { * * @param {Debugger.Frame} frame * A descriptor object for the JavaScript frame. - * @param {Number} depth + * @param {number} depth * Represents the depth of the frame in the call stack. - * @param {String} formatedDisplayName + * @param {string} formatedDisplayName * A human readable name for the current frame. - * @param {String} prefix + * @param {string} prefix * A string to be displayed as a prefix of any logged frame. - * @param {String} currentDOMEvent + * @param {string} currentDOMEvent * If this is a top level frame (depth==0), and we are currently processing * a DOM Event, this will refer to the name of that DOM Event. * Note that it may also refer to setTimeout and setTimeout callback calls. - * @return {Boolean} + * @return {boolean} * Return true, if the JavaScriptTracer should log the frame to stdout. */ onTracingFrame({ @@ -157,25 +157,25 @@ class StdoutTracingListener { /** * Called by JavaScriptTracer class when a JavaScript frame exits (i.e. a function returns or throw). * - * @param {Object} options - * @param {Number} options.frameId + * @param {object} options + * @param {number} options.frameId * Unique identifier for the current frame. * This should match a frame notified via onTracingFrame. * @param {Debugger.Frame} options.frame * A descriptor object for the JavaScript frame. - * @param {Number} options.depth + * @param {number} options.depth * Represents the depth of the frame in the call stack. - * @param {String} options.formatedDisplayName + * @param {string} options.formatedDisplayName * A human readable name for the current frame. - * @param {String} options.prefix + * @param {string} options.prefix * A string to be displayed as a prefix of any logged frame. - * @param {String} options.why + * @param {string} options.why * A string to explain why the function stopped. * See tracer.sys.mjs's FRAME_EXIT_REASONS. * @param {Debugger.Object|primitive} options.rv * The returned value. It can be the returned value, or the thrown exception. * It is either a primitive object, otherwise it is a Debugger.Object for any other JS Object type. - * @return {Boolean} + * @return {boolean} * Return true, if the JavaScriptTracer should log the frame to stdout. */ onTracingFrameExit({ diff --git a/devtools/server/actors/utils/accessibility.js b/devtools/server/actors/utils/accessibility.js @@ -28,7 +28,7 @@ const HIGHLIGHTER_STYLES_SHEET = `data:text/css;charset=utf-8, * * @param {nsIAccessible} accessible * object to be tested. - * @return {Boolean} + * @return {boolean} * True if accessible object is defunct, false otherwise. */ function isDefunct(accessible) { @@ -82,7 +82,7 @@ function removeSheetForBackgroundCalculation(win) { * @param {nsIAccessible} accessible * Accessible for which to determine its role attribute value. * - * @returns {null|String} + * @returns {null | string} * Role attribute value if specified. */ function getAriaRoles(accessible) { diff --git a/devtools/server/actors/utils/capture-screenshot.js b/devtools/server/actors/utils/capture-screenshot.js @@ -55,22 +55,22 @@ function simulateCameraFlash(browsingContext) { /** * Take a screenshot of a browser element given its browsingContext. * - * @param {Object} args - * @param {Number} args.delay: Number of seconds to wait before taking the screenshot - * @param {Object|null} args.rect: Object with left, top, width and height properties + * @param {object} args + * @param {number} args.delay: Number of seconds to wait before taking the screenshot + * @param {object | null} args.rect: Object with left, top, width and height properties * representing the rect **inside the browser element** that should * be rendered. If null, the current viewport of the element will be rendered. - * @param {Boolean} args.fullpage: Should the screenshot be the height of the whole page - * @param {String} args.filename: Expected filename for the screenshot - * @param {Number} args.snapshotScale: Scale that will be used by `drawSnapshot` to take the screenshot. + * @param {boolean} args.fullpage: Should the screenshot be the height of the whole page + * @param {string} args.filename: Expected filename for the screenshot + * @param {number} args.snapshotScale: Scale that will be used by `drawSnapshot` to take the screenshot. * ⚠️ Note that the scale might be decreased if the resulting image would * be too big to draw safely. A warning message will be returned if that's * the case. - * @param {Number} args.fileScale: Scale of the exported file. Defaults to args.snapshotScale. - * @param {Boolean} args.disableFlash: Set to true to disable the flash animation when the + * @param {number} args.fileScale: Scale of the exported file. Defaults to args.snapshotScale. + * @param {boolean} args.disableFlash: Set to true to disable the flash animation when the * screenshot is taken. * @param {BrowsingContext} browsingContext - * @returns {Object} object with the following properties: + * @returns {object} object with the following properties: * - data {String}: The dataURL representing the screenshot * - height {Number}: Height of the resulting screenshot * - width {Number}: Width of the resulting screenshot diff --git a/devtools/server/actors/utils/css-grid-utils.js b/devtools/server/actors/utils/css-grid-utils.js @@ -7,7 +7,7 @@ /** * Returns the grid fragment array with all the grid fragment data stringifiable. * - * @param {Object} fragments + * @param {object} fragments * Grid fragment object. * @return {Array} representation with the grid fragment data stringifiable. */ diff --git a/devtools/server/actors/utils/custom-formatters.js b/devtools/server/actors/utils/custom-formatters.js @@ -44,7 +44,7 @@ class FormatterError extends Error { * * @param {ObjectActor} objectActor * - * @returns {Object} Data related to the custom formatter header: + * @returns {object} Data related to the custom formatter header: * - {boolean} useCustomFormatter, indicating if a custom formatter is used. * - {Array} header JsonML of the output header. * - {boolean} hasBody True in case the custom formatter has a body. @@ -124,19 +124,19 @@ exports.customFormatterHeader = customFormatterHeader; * Handle one precise custom formatter. * i.e. one element of the window.customFormatters Array. * - * @param {Object} options + * @param {object} options * @param {Debugger.Object} options.configDbgObj * The Debugger.Object of the config object. - * @param {Number} options.customFormatterObjectTagDepth + * @param {number} options.customFormatterObjectTagDepth * See buildJsonMlFromCustomFormatterHookResult JSDoc. - * @param {Object} options.formatter + * @param {object} options.formatter * The raw formatter object (coming from "customFormatter" array). * @param {BrowsingContextTargetActor} options.targetActor * See buildJsonMlFromCustomFormatterHookResult JSDoc. * @param {Debugger.Object} options.valueDbgObj * The Debugger.Object of rawObj. * - * @returns {Object} See customFormatterHeader jsdoc, it returns the same object. + * @returns {object} See customFormatterHeader jsdoc, it returns the same object. */ // eslint-disable-next-line complexity function processFormatterForHeader({ @@ -241,10 +241,10 @@ function processFormatterForHeader({ * Handle a protocol request to get the custom formatter body for an object * * @param {ObjectActor} objectActor - * @param {Object} formatter: The global.devtoolsFormatters entry that was used in customFormatterHeader + * @param {object} formatter: The global.devtoolsFormatters entry that was used in customFormatterHeader * for this object. * - * @returns {Object} Data related to the custom formatter body: + * @returns {object} Data related to the custom formatter body: * - {*} customFormatterBody Data of the custom formatter body. */ async function customFormatterBody(objectActor, formatter) { @@ -378,7 +378,7 @@ function logCustomFormatterError(window, errorMsg, script) { * * @param {DebuggerObject} jsonMlDbgObj: The debugger object representing a jsonMl object returned * by a custom formatter hook. - * @param {Number} customFormatterObjectTagDepth: See `processObjectTag`. + * @param {number} customFormatterObjectTagDepth: See `processObjectTag`. * @param {BrowsingContextTargetActor} targetActor: The actor that will be managing any * created ObjectActor. * @returns {Array|null} Returns null if the passed object is a not DebuggerObject representing an Array @@ -465,12 +465,12 @@ function buildJsonMlFromCustomFormatterHookResult( * * @param {DebuggerObject} attributesDbgObj: The debugger object representing the "attributes" * of a jsonMl item (e.g. the second item in the array). - * @param {Number} customFormatterObjectTagDepth: As "object" tag can reference custom + * @param {number} customFormatterObjectTagDepth: As "object" tag can reference custom * formatted data, we track the number of time we go through this function * from the "root" object so we don't have an infinite loop. * @param {BrowsingContextTargetActor} targetActor: The actor that will be managin any * created ObjectActor. - * @returns {Object} Returns a grip representing the underlying object + * @returns {object} Returns a grip representing the underlying object */ function processObjectTag( attributesDbgObj, diff --git a/devtools/server/actors/utils/event-breakpoints.js b/devtools/server/actors/utils/event-breakpoints.js @@ -6,12 +6,12 @@ /** * - * @param {String} groupID - * @param {String} eventType + * @param {string} groupID + * @param {string} eventType * @param {Function} condition: Optional function that takes a Window as parameter. When * passed, the event will only be included if the result of the function * call is `true` (See `getAvailableEventBreakpoints`). - * @returns {Object} + * @returns {object} */ function generalEvent(groupID, eventType, condition) { return { @@ -495,7 +495,7 @@ exports.getAvailableEventBreakpoints = getAvailableEventBreakpoints; * Get all available event breakpoints * * @param {Window|WorkerGlobalScope} global - * @returns {Array<Object>} An array containing object with a few properties : + * @returns {Array<object>} An array containing object with a few properties : * - {String} id: unique identifier * - {String} name: Description for the event to be displayed in UI (no translated) * - {String} type: Either "simple" or "event" diff --git a/devtools/server/actors/utils/inactive-property-helper.js b/devtools/server/actors/utils/inactive-property-helper.js @@ -807,22 +807,22 @@ class InactivePropertyHelper { * The computed style for this DOMNode. * @param {DOMRule} cssRule * The CSS rule the property is defined in. - * @param {String} property + * @param {string} property * The CSS property name. * - * @return {Object|null} object + * @return {object | null} object * if the property is active, this will return null - * @return {String} object.display + * @return {string} object.display * The element computed display value. - * @return {String} object.fixId + * @return {string} object.fixId * A Fluent id containing a suggested solution to the problem that is * causing a property to be inactive. - * @return {String} object.msgId + * @return {string} object.msgId * A Fluent id containing an error message explaining why a property * is inactive in this situation. - * @return {String} object.property + * @return {string} object.property * The inactive property name. - * @return {String} object.learnMoreURL + * @return {string} object.learnMoreURL * An optional link if we need to open an other link than * the default MDN property one. */ @@ -955,7 +955,7 @@ class InactivePropertyHelper { * Check if the current node's propName is set to one of the values passed in * the values array. * - * @param {String} propName + * @param {string} propName * Property name to check. * @param {Array} values * Values to compare against. @@ -971,7 +971,7 @@ class InactivePropertyHelper { * Check if a rule's propName is set to one of the values passed in the values * array. * - * @param {String} propName + * @param {string} propName * Property name to check. * @param {Array} values * Values to compare against. @@ -1355,7 +1355,7 @@ class InactivePropertyHelper { /** * Return the current node's localName. * - * @returns {String} + * @returns {string} */ get localName() { return this.node.localName; @@ -1379,7 +1379,7 @@ class InactivePropertyHelper { * Check if the current node is an absolutely-positioned grid element. * See: https://drafts.csswg.org/css-grid/#abspos-items * - * @return {Boolean} whether or not the current node is absolutely-positioned by a + * @return {boolean} whether or not the current node is absolutely-positioned by a * grid container. */ isAbsPosGridElement() { @@ -1588,7 +1588,7 @@ class InactivePropertyHelper { * This is either going to be the table element if there is one, or the parent element. * If the current element is not a table track, this returns the current element. * - * @param {Boolean} isGroup + * @param {boolean} isGroup * Whether the element is a table track group, instead of a table track. * @return {DOMNode} * The parent table, the parent element, or the element itself. @@ -1640,7 +1640,7 @@ class InactivePropertyHelper { * Assuming the current element is an internal table element, * check wether its parent table element has `border-collapse` set to `collapse`. * - * @returns {Boolean} + * @returns {boolean} */ checkTableParentHasBorderCollapsed() { const parent = this.getTableParent(); @@ -1678,7 +1678,7 @@ function allCssPropertiesExcept(propertiesToIgnore) { * The node to get the styles for. * @param {Window} window * Optional window object. If omitted, will get the node's window. - * @return {Object} + * @return {object} */ function computedStyle(node, window = node.ownerGlobal) { return window.getComputedStyle(node); diff --git a/devtools/server/actors/utils/shapes-utils.js b/devtools/server/actors/utils/shapes-utils.js @@ -7,11 +7,11 @@ /** * Get the distance between two points on a plane. * - * @param {Number} x1 the x coord of the first point - * @param {Number} y1 the y coord of the first point - * @param {Number} x2 the x coord of the second point - * @param {Number} y2 the y coord of the second point - * @returns {Number} the distance between the two points + * @param {number} x1 the x coord of the first point + * @param {number} y1 the y coord of the first point + * @param {number} x2 the x coord of the second point + * @param {number} y2 the y coord of the second point + * @returns {number} the distance between the two points */ const getDistance = (x1, y1, x2, y2) => { return Math.round(Math.hypot(x2 - x1, y2 - y1)); @@ -21,17 +21,17 @@ const getDistance = (x1, y1, x2, y2) => { * Determine if the given x/y coords are along the edge of the given ellipse. * We allow for a small area around the edge that still counts as being on the edge. * - * @param {Number} x the x coordinate of the click - * @param {Number} y the y coordinate of the click - * @param {Number} cx the x coordinate of the center of the ellipse - * @param {Number} cy the y coordinate of the center of the ellipse - * @param {Number} rx the x radius of the ellipse - * @param {Number} ry the y radius of the ellipse - * @param {Number} clickWidthX the width of the area that counts as being on the edge + * @param {number} x the x coordinate of the click + * @param {number} y the y coordinate of the click + * @param {number} cx the x coordinate of the center of the ellipse + * @param {number} cy the y coordinate of the center of the ellipse + * @param {number} rx the x radius of the ellipse + * @param {number} ry the y radius of the ellipse + * @param {number} clickWidthX the width of the area that counts as being on the edge * along the x radius. - * @param {Number} clickWidthY the width of the area that counts as being on the edge + * @param {number} clickWidthY the width of the area that counts as being on the edge * along the y radius. - * @returns {Boolean} whether the click counts as being on the edge of the ellipse. + * @returns {boolean} whether the click counts as being on the edge of the ellipse. */ const clickedOnEllipseEdge = ( x, @@ -60,13 +60,13 @@ const clickedOnEllipseEdge = ( /** * Get the distance between a point and a line defined by two other points. * - * @param {Number} x1 the x coordinate of the first point in the line - * @param {Number} y1 the y coordinate of the first point in the line - * @param {Number} x2 the x coordinate of the second point in the line - * @param {Number} y2 the y coordinate of the second point in the line - * @param {Number} x3 the x coordinate of the point for which the distance is found - * @param {Number} y3 the y coordinate of the point for which the distance is found - * @returns {Number} the distance between (x3,y3) and the line defined by + * @param {number} x1 the x coordinate of the first point in the line + * @param {number} y1 the y coordinate of the first point in the line + * @param {number} x2 the x coordinate of the second point in the line + * @param {number} y2 the y coordinate of the second point in the line + * @param {number} x3 the x coordinate of the point for which the distance is found + * @param {number} y3 the y coordinate of the point for which the distance is found + * @returns {number} the distance between (x3,y3) and the line defined by * (x1,y1) and (y1,y2) */ const distanceToLine = (x1, y1, x2, y2, x3, y3) => { @@ -79,12 +79,12 @@ const distanceToLine = (x1, y1, x2, y2, x3, y3) => { /** * Get the point on the line defined by points a,b that is closest to point c * - * @param {Number} ax the x coordinate of point a - * @param {Number} ay the y coordinate of point a - * @param {Number} bx the x coordinate of point b - * @param {Number} by the y coordinate of point b - * @param {Number} cx the x coordinate of point c - * @param {Number} cy the y coordinate of point c + * @param {number} ax the x coordinate of point a + * @param {number} ay the y coordinate of point a + * @param {number} bx the x coordinate of point b + * @param {number} by the y coordinate of point b + * @param {number} cx the x coordinate of point c + * @param {number} cy the y coordinate of point c * @returns {Array} a 2 element array that contains the x/y coords of the projected point */ const projection = (ax, ay, bx, by, cx, cy) => { @@ -100,7 +100,7 @@ const projection = (ax, ay, bx, by, cx, cy) => { * * @param {Array} a the first vector * @param {Array} b the second vector - * @returns {Number} the dot product of a and b + * @returns {number} the dot product of a and b */ const dotProduct = (a, b) => { return a.reduce((prev, curr, i) => { @@ -111,13 +111,13 @@ const dotProduct = (a, b) => { /** * Determine if the given x/y coords are above the given point. * - * @param {Number} x the x coordinate of the click - * @param {Number} y the y coordinate of the click - * @param {Number} pointX the x coordinate of the center of the point - * @param {Number} pointY the y coordinate of the center of the point - * @param {Number} radiusX the x radius of the point - * @param {Number} radiusY the y radius of the point - * @returns {Boolean} whether the click was on the point + * @param {number} x the x coordinate of the click + * @param {number} y the y coordinate of the click + * @param {number} pointX the x coordinate of the center of the point + * @param {number} pointY the y coordinate of the center of the point + * @param {number} radiusX the x radius of the point + * @param {number} radiusY the y radius of the point + * @returns {boolean} whether the click was on the point */ const clickedOnPoint = (x, y, pointX, pointY, radiusX, radiusY) => { return ( diff --git a/devtools/server/actors/utils/style-utils.js b/devtools/server/actors/utils/style-utils.js @@ -25,7 +25,7 @@ const FONT_NEED_WRAPPING_QUOTES_REGEX = /^[^'"].* /; * @param options {object} * Object with options 'previewText' and 'previewFontSize' * - * @return {Object} An object with the following properties: + * @return {object} An object with the following properties: * - dataUrl {string}: The data URI of the font preview image * - size {Number}: The optimal width of preview image * - ctx {CanvasRenderingContext2D}: The canvas context (returned for tests) @@ -152,9 +152,9 @@ exports.getFontPreviewData = getFontPreviewData; * Calling the function with the whole text above and `line=4` and `column=1` would * return `line-height: 2em; color: blue;` * - * @param {String} initialText - * @param {Number} line (1-indexed) - * @param {Number} column (1-indexed) + * @param {string} initialText + * @param {number} line (1-indexed) + * @param {number} column (1-indexed) * @return {object} An object of the form {offset: number, text: string} * The offset is the index into the input string where * the rule text started. The text is the content of @@ -179,9 +179,9 @@ exports.getRuleText = getRuleText; * Return the offset and substring of |text| that starts at the given * line and column. * - * @param {String} text - * @param {Number} line (1-indexed) - * @param {Number} column (1-indexed) + * @param {string} text + * @param {number} line (1-indexed) + * @param {number} column (1-indexed) * @return {object} An object of the form {offset: number, text: string}, * where the offset is the offset into the input string * where the text starts, and where text is the text. diff --git a/devtools/server/actors/utils/stylesheet-utils.js b/devtools/server/actors/utils/stylesheet-utils.js @@ -70,7 +70,7 @@ exports.getStyleSheetText = getStyleSheetText; * Retrieve the content of a given stylesheet * * @param {StyleSheet} styleSheet - * @returns {String} + * @returns {string} */ async function fetchStyleSheetText(styleSheet) { const href = styleSheet.href; @@ -133,7 +133,7 @@ async function fetchStyleSheetText(styleSheet) { * Get charset of a given stylesheet * * @param {StyleSheet} styleSheet - * @returns {String} + * @returns {string} */ function getCSSCharset(styleSheet) { if (styleSheet) { diff --git a/devtools/server/actors/utils/stylesheets-manager.js b/devtools/server/actors/utils/stylesheets-manager.js @@ -126,7 +126,7 @@ class StyleSheetsManager extends EventEmitter { * to watch for stylesheet additions and modifications. * This resolves once it notified about existing stylesheets. * - * @param {Object} options + * @param {object} options * @param {Function} onAvailable: Function that will be called when a stylesheet is * registered, but also with already registered stylesheets * if ignoreExisting is not set to true. @@ -134,7 +134,7 @@ class StyleSheetsManager extends EventEmitter { * - {String} resourceId: The id that was assigned to the stylesheet * - {StyleSheet} styleSheet: The actual stylesheet object * - {Object} creationData: An object with: - * - {Boolean} isCreatedByDevTools: Was the stylesheet created + * - {boolean} isCreatedByDevTools: Was the stylesheet created * by DevTools (e.g. by the user clicking the new stylesheet * button in the styleeditor) * - {String} fileName @@ -147,7 +147,7 @@ class StyleSheetsManager extends EventEmitter { * @param {Function} onDestroyed: Function that will be called when a stylesheet is removed * This is called with a single object parameter with the following properties: * - {String} resourceId: The id that was assigned to the stylesheet - * @param {Boolean} ignoreExisting: Pass to true to avoid onAvailable to be called with + * @param {boolean} ignoreExisting: Pass to true to avoid onAvailable to be called with * already registered stylesheets. */ async watch({ onAvailable, onUpdated, onDestroyed, ignoreExisting = false }) { @@ -214,7 +214,7 @@ class StyleSheetsManager extends EventEmitter { /** * Remove the passed listeners * - * @param {Object} options: See this.watch + * @param {object} options: See this.watch */ unwatch({ onAvailable, onUpdated, onDestroyed }) { if (!this.#watchListeners) { @@ -316,7 +316,7 @@ class StyleSheetsManager extends EventEmitter { * registered yet. * * @params {StyleSheet} styleSheet - * @returns {String} resourceId + * @returns {string} resourceId */ getStyleSheetResourceId(styleSheet) { const existingResourceId = this.#findStyleSheetResourceId(styleSheet); @@ -335,7 +335,7 @@ class StyleSheetsManager extends EventEmitter { * stylesheet wasn't registered yet. * * @params {StyleSheet} styleSheet - * @returns {String} resourceId + * @returns {string} resourceId */ #findStyleSheetResourceId(styleSheet) { for (const [ @@ -353,7 +353,7 @@ class StyleSheetsManager extends EventEmitter { /** * Return owner node of the style sheet of the given resource id. * - * @params {String} resourceId + * @params {string} resourceId * The id associated with the stylesheet * @returns {Element|null} */ @@ -365,9 +365,9 @@ class StyleSheetsManager extends EventEmitter { /** * Return the index of given stylesheet of the given resource id. * - * @params {String} resourceId + * @params {string} resourceId * The id associated with the stylesheet - * @returns {Number} + * @returns {number} */ getStyleSheetIndex(resourceId) { const styleSheet = this.#styleSheetMap.get(resourceId); @@ -392,9 +392,9 @@ class StyleSheetsManager extends EventEmitter { /** * Get the text of a stylesheet given its resourceId. * - * @params {String} resourceId + * @params {string} resourceId * The id associated with the stylesheet - * @returns {String} + * @returns {string} */ async getText(resourceId) { const styleSheet = this.#styleSheetMap.get(resourceId); @@ -413,9 +413,9 @@ class StyleSheetsManager extends EventEmitter { /** * Toggle the disabled property of the stylesheet * - * @params {String} resourceId + * @params {string} resourceId * The id associated with the stylesheet - * @return {Boolean} the disabled state after toggling. + * @return {boolean} the disabled state after toggling. */ toggleDisabled(resourceId) { const styleSheet = this.#styleSheetMap.get(resourceId); @@ -429,15 +429,15 @@ class StyleSheetsManager extends EventEmitter { /** * Update the style sheet in place with new text. * - * @param {String} resourceId - * @param {String} text + * @param {string} resourceId + * @param {string} text * New text. - * @param {Object} options - * @param {Boolean} options.transition + * @param {object} options + * @param {boolean} options.transition * Whether to do CSS transition for change. Defaults to false. - * @param {Number} options.kind + * @param {number} options.kind * Either UPDATE_PRESERVING_RULES or UPDATE_GENERAL. Defaults to UPDATE_GENERAL. - * @param {String} options.cause + * @param {string} options.cause * Indicates the cause of this update (e.g. "styleeditor") if this was called * from the stylesheet to be edited by the user from the StyleEditor. */ @@ -486,11 +486,11 @@ class StyleSheetsManager extends EventEmitter { * Applies a transition to the stylesheet document so any change made by the user in the * client will be animated so it's more visible. * - * @param {String} resourceId + * @param {string} resourceId * The id associated with the stylesheet - * @param {Number} kind + * @param {number} kind * Either UPDATE_PRESERVING_RULES or UPDATE_GENERAL - * @param {String} cause + * @param {string} cause * Indicates the cause of this update (e.g. "styleeditor") if this was called * from the stylesheet to be edited by the user from the StyleEditor. */ @@ -519,11 +519,11 @@ class StyleSheetsManager extends EventEmitter { } /** - * @param {String} resourceId + * @param {string} resourceId * The id associated with the stylesheet - * @param {Number} kind + * @param {number} kind * Either UPDATE_PRESERVING_RULES or UPDATE_GENERAL - * @param {String} cause + * @param {string} cause * Indicates the cause of this update (e.g. "styleeditor") if this was called * from the stylesheet to be edited by the user from the StyleEditor. */ @@ -617,7 +617,7 @@ class StyleSheetsManager extends EventEmitter { * all the at-rules of a given stylesheet. * * @param {StyleSheet} styleSheet - * @returns {Object} An object of the following shape: + * @returns {object} An object of the following shape: * - {Integer} ruleCount: The total number of rules in the stylesheet * - {Array<Object>} atRules: An array of object of the following shape: * - type {String} @@ -732,9 +732,9 @@ class StyleSheetsManager extends EventEmitter { * Called when the status of a media query support changes (i.e. it now matches, or it * was matching but isn't anymore) * - * @param {String} resourceId + * @param {string} resourceId * The id associated with the stylesheet - * @param {Number} index + * @param {number} index * The index of the media rule relatively to all the other at-rules of the stylesheet * @param {MediaQueryList} mql * The result of matchMedia for the given media rule @@ -758,7 +758,7 @@ class StyleSheetsManager extends EventEmitter { * Get the node href of a given stylesheet * * @param {StyleSheet} styleSheet - * @returns {String} + * @returns {string} */ getNodeHref(styleSheet) { const { ownerNode } = styleSheet; @@ -781,7 +781,7 @@ class StyleSheetsManager extends EventEmitter { * Get the sourcemap base url of a given stylesheet * * @param {StyleSheet} styleSheet - * @returns {String} + * @returns {string} */ getSourcemapBaseURL(styleSheet) { // When the style is injected via nsIDOMWindowUtils.loadSheet, even @@ -838,7 +838,7 @@ class StyleSheetsManager extends EventEmitter { * Returns true if a given stylesheet has an ancestor with the same url it has * * @param {StyleSheet} styleSheet - * @returns {Boolean} + * @returns {boolean} */ #haveAncestorWithSameURL(styleSheet) { const href = styleSheet.href; @@ -854,11 +854,11 @@ class StyleSheetsManager extends EventEmitter { /** * Helper function called when a property changed in a given stylesheet * - * @param {String} resourceId + * @param {string} resourceId * The id of the stylesheet the change occured in - * @param {String} property + * @param {string} property * The property that was changed - * @param {String} value + * @param {string} value * The value of the property */ #notifyPropertyChanged(resourceId, property, value) { @@ -918,7 +918,7 @@ class StyleSheetsManager extends EventEmitter { * resourceId and call registered `onAvailable` listeners. * * @param {StyleSheet} styleSheet - * @returns {String} the associated resourceId + * @returns {string} the associated resourceId */ #registerStyleSheet(styleSheet) { const existingResourceId = this.#findStyleSheetResourceId(styleSheet); @@ -994,7 +994,7 @@ class StyleSheetsManager extends EventEmitter { * Returns true if the passed styleSheet should be handled. * * @param {StyleSheet} styleSheet - * @returns {Boolean} + * @returns {boolean} */ #shouldListSheet(styleSheet) { const href = styleSheet.href?.toLowerCase(); diff --git a/devtools/server/actors/utils/walker-search.js b/devtools/server/actors/utils/walker-search.js @@ -308,8 +308,8 @@ class WalkerSearch { /** * Search the document * - * @param {String} query What to search for - * @param {Object} options The following options are accepted: + * @param {string} query What to search for + * @param {object} options The following options are accepted: * - searchMethod {String} one of WalkerSearch.SEARCH_METHOD_* * defaults to WalkerSearch.SEARCH_METHOD_CONTAINS (does not apply to * selector and XPath search types) diff --git a/devtools/server/actors/watcher.js b/devtools/server/actors/watcher.js @@ -83,9 +83,9 @@ exports.WatcherActor = class WatcherActor extends Actor { * @param {object} sessionContext * The Session Context to help know what is debugged. * See devtools/server/actors/watcher/session-context.js - * @param {Number} sessionContext.browserId: If this is a "browser-element" context type, + * @param {number} sessionContext.browserId: If this is a "browser-element" context type, * the "browserId" of the <browser> element we would like to debug. - * @param {Boolean} sessionContext.isServerTargetSwitchingEnabled: Flag to to know if we should + * @param {boolean} sessionContext.isServerTargetSwitchingEnabled: Flag to to know if we should * spawn new top level targets for the debugged context. */ constructor(conn, sessionContext) { @@ -757,7 +757,7 @@ exports.WatcherActor = class WatcherActor extends Actor { /** * Returns the network actor. * - * @return {Object} actor + * @return {object} actor * The network actor. */ getNetworkParentActor() { @@ -771,7 +771,7 @@ exports.WatcherActor = class WatcherActor extends Actor { /** * Returns the blackboxing actor. * - * @return {Object} actor + * @return {object} actor * The blackboxing actor. */ getBlackboxingActor() { @@ -785,7 +785,7 @@ exports.WatcherActor = class WatcherActor extends Actor { /** * Returns the breakpoint list actor. * - * @return {Object} actor + * @return {object} actor * The breakpoint list actor. */ getBreakpointListActor() { @@ -799,7 +799,7 @@ exports.WatcherActor = class WatcherActor extends Actor { /** * Returns the target configuration actor. * - * @return {Object} actor + * @return {object} actor * The configuration actor. */ getTargetConfigurationActor() { @@ -812,7 +812,7 @@ exports.WatcherActor = class WatcherActor extends Actor { /** * Returns the thread configuration actor. * - * @return {Object} actor + * @return {object} actor * The configuration actor. */ getThreadConfigurationActor() { @@ -827,11 +827,11 @@ exports.WatcherActor = class WatcherActor extends Actor { * Used to agrement some new entries for a given data type (watchers target, resources, * breakpoints,...) * - * @param {String} type + * @param {string} type * Data type to contribute to. * @param {Array<*>} entries * List of values to add or set for this data type. - * @param {String} updateType + * @param {string} updateType * "add" will only add the new entries in the existing data set. * "set" will update the data set with the new entries. */ @@ -894,7 +894,7 @@ exports.WatcherActor = class WatcherActor extends Actor { * Used to remve some existing entries for a given data type (watchers target, resources, * breakpoints,...) * - * @param {String} type + * @param {string} type * Data type to modify. * @param {Array<*>} entries * List of values to remove from this data type. @@ -922,7 +922,7 @@ exports.WatcherActor = class WatcherActor extends Actor { /** * Retrieve the current watched data for the provided type. * - * @param {String} type + * @param {string} type * Data type to retrieve. */ getSessionDataForType(type) { @@ -934,7 +934,7 @@ exports.WatcherActor = class WatcherActor extends Actor { * This will notify the Service Worker JS Process Actors about the new top level page domain. * So that we start tracking that domain's workers. * - * @param {String} newTargetUrl + * @param {string} newTargetUrl */ async updateDomainSessionDataForServiceWorkers(newTargetUrl) { // If the url could not be parsed the host defaults to an empty string. diff --git a/devtools/server/actors/watcher/ParentProcessWatcherRegistry.sys.mjs b/devtools/server/actors/watcher/ParentProcessWatcherRegistry.sys.mjs @@ -132,7 +132,7 @@ export const ParentProcessWatcherRegistry = { /** * Return an array of the watcher actors that match the passed browserId * - * @param {Number} browserId + * @param {number} browserId * @returns {Array<WatcherActor>} An array of the matching watcher actors */ getWatchersForBrowserId(browserId) { diff --git a/devtools/server/actors/watcher/browsing-context-helpers.sys.mjs b/devtools/server/actors/watcher/browsing-context-helpers.sys.mjs @@ -15,7 +15,7 @@ export const WEBEXTENSION_FALLBACK_DOC_URL = * The WindowGlobal from which we want to extract the addonId. Either a * WindowGlobalParent or a WindowGlobalChild depending on where this * helper is used from. - * @return {String} Returns the addon id if any could found, null otherwise. + * @return {string} Returns the addon id if any could found, null otherwise. */ export function getAddonIdForWindowGlobal(windowGlobal) { const browsingContext = windowGlobal.browsingContext; @@ -58,21 +58,21 @@ export function getAddonIdForWindowGlobal(windowGlobal) { * * @param {BrowsingContext} browsingContext * The browsing context we want to check if it is part of debugged context - * @param {Object} sessionContext + * @param {object} sessionContext * The Session Context to help know what is debugged. * See devtools/server/actors/watcher/session-context.js - * @param {Object} options + * @param {object} options * Optional arguments passed via a dictionary. - * @param {Boolean} options.forceAcceptTopLevelTarget + * @param {boolean} options.forceAcceptTopLevelTarget * If true, we will accept top level browsing context even when server target switching * is disabled. In case of client side target switching, the top browsing context * is debugged via a target actor that is being instantiated manually by the frontend. * And this target actor isn't created, nor managed by the watcher actor. - * @param {Boolean} options.acceptInitialDocument + * @param {boolean} options.acceptInitialDocument * By default, we ignore initial about:blank documents/WindowGlobals. * But some code cares about all the WindowGlobals, this flag allows to also accept them. * (Used by _validateWindowGlobal) - * @param {Boolean} options.acceptNoWindowGlobal + * @param {boolean} options.acceptNoWindowGlobal * By default, we will reject BrowsingContext that don't have any WindowGlobal, * either retrieved via BrowsingContext.currentWindowGlobal in the parent process, * or via the options.windowGlobal argument. @@ -202,7 +202,7 @@ export function isBrowsingContextPartOfContext( * * @param {BrowsingContext} browsingContext * The browsing context we want to check if it is part of debugged context - * @param {Object} sessionContext + * @param {object} sessionContext * WatcherActor's session context. This helps know what is the overall debugged scope. * See watcher actor constructor for more info. */ @@ -230,10 +230,10 @@ function isPopupToDebug(browsingContext, sessionContext) { * * @param {WindowGlobalParent|WindowGlobalChild} windowGlobal * The WindowGlobal we want to check if it is part of debugged context - * @param {Object} sessionContext + * @param {object} sessionContext * The Session Context to help know what is debugged. * See devtools/server/actors/watcher/session-context.js - * @param {Object} options + * @param {object} options * Optional arguments passed via a dictionary. * See `isBrowsingContextPartOfContext` jsdoc. */ @@ -277,10 +277,10 @@ function _validateWindowGlobal( * * @param {WindowGlobalParent|WindowGlobalChild} windowGlobal * The WindowGlobal we want to check if it is part of debugged context - * @param {Object} sessionContext + * @param {object} sessionContext * The Session Context to help know what is debugged. * See devtools/server/actors/watcher/session-context.js - * @param {Object} options + * @param {object} options * Optional arguments passed via a dictionary. * See `isBrowsingContextPartOfContext` jsdoc. */ @@ -308,7 +308,7 @@ export function isWindowGlobalPartOfContext( * - For all chrome *and* content contexts (privileged windows, as well as <browser> elements and their inner content documents) * - For all nested browsing context. We fetch the contexts recursively. * - * @param {Object} sessionContext + * @param {object} sessionContext * The Session Context to help know what is debugged. * See devtools/server/actors/watcher/session-context.js */ diff --git a/devtools/server/actors/watcher/session-context.js b/devtools/server/actors/watcher/session-context.js @@ -54,7 +54,7 @@ const SESSION_TYPES = { * - all privileges: privileged/chrome and content/web, * - all components/targets: HTML documents, processes, workers, add-ons,... * - * @param {Object} config + * @param {object} config * An object with optional configuration. Only supports "enableWindowGlobalThreadActors" attribute. * See jsdoc in this file header for more info. */ @@ -80,7 +80,7 @@ function createBrowserSessionContext({ * * @param {BrowserElement} browserElement * The tab to debug. It should be a reference to a <browser> element. - * @param {Object} config + * @param {object} config * An object with optional configuration. Only supports "isServerTargetSwitchingEnabled" attribute. * See jsdoc in this file header for more info. */ @@ -103,11 +103,11 @@ function createBrowserElementSessionContext(browserElement, config) { /** * Create the SessionContext used by the web extension toolboxes. * - * @param {Object} addon + * @param {object} addon * First object argument to describe the add-on. - * @param {String} addon.addonId + * @param {string} addon.addonId * The web extension ID, to uniquely identify the debugged add-on. - * @param {Object} config + * @param {object} config * An object with optional configuration. Only supports "isServerTargetSwitchingEnabled" attribute. * See jsdoc in this file header for more info. */ @@ -151,8 +151,8 @@ function createWorkerSessionContext() { /** * Get the supported targets by the watcher given a session context type. * - * @param {String} type - * @returns {Object} + * @param {string} type + * @returns {object} */ function getWatcherSupportedTargets(type) { return { @@ -175,8 +175,8 @@ function getWatcherSupportedTargets(type) { /** * Get the supported resources by the watcher given a session context type. * - * @param {String} _type - * @returns {Object} + * @param {string} _type + * @returns {object} */ function getWatcherSupportedResources(_type) { return { diff --git a/devtools/server/actors/webbrowser.js b/devtools/server/actors/webbrowser.js @@ -331,7 +331,7 @@ BrowserTabList.prototype._getActorForBrowser = async function (browser) { * - for the tab matching a browserId if one is passed * - OR the currently selected tab if no browserId is passed. * - * @param {Number} browserId: use to match any tab + * @param {number} browserId: use to match any tab */ BrowserTabList.prototype.getTab = function ({ browserId }) { if (typeof browserId == "number") { diff --git a/devtools/server/actors/webconsole.js b/devtools/server/actors/webconsole.js @@ -1459,14 +1459,14 @@ class WebConsoleActor extends Actor { * Handler for the DocumentEventsListener. * * @see DocumentEventsListener - * @param {String} name + * @param {string} name * The document event name that either of followings. * - dom-loading * - dom-interactive * - dom-complete - * @param {Number} time + * @param {number} time * The time that the event is fired. - * @param {Boolean} hasNativeConsoleAPI + * @param {boolean} hasNativeConsoleAPI * Tells if the window.console object is native or overwritten by script in the page. * Only passed when `name` is "dom-complete" (see devtools/server/actors/webconsole/listeners/document-events.js). */ @@ -1583,8 +1583,8 @@ class WebConsoleActor extends Actor { * So here we need to retrieve the properties of the first parameter, and also all the * sub-properties we might need. * - * @param {Object} result: The console.table message. - * @returns {Object} An object containing the properties of the first argument of the + * @param {object} result: The console.table message. + * @returns {object} An object containing the properties of the first argument of the * console.table call. */ _getConsoleTableMessageItems(result) { diff --git a/devtools/server/actors/webconsole/commands/manager.js b/devtools/server/actors/webconsole/commands/manager.js @@ -58,10 +58,10 @@ const WebConsoleCommandsManager = { /** * Register a new command. * - * @param {Object} options + * @param {object} options * @param {string} options.name * The command name (exemple: "$", "screenshot",...)) - * @param {Boolean} isSideEffectFree + * @param {boolean} isSideEffectFree * Tells if the command is free of any side effect to know * if it can run in eager console evaluation. * @param {function|object} options.command @@ -124,7 +124,7 @@ const WebConsoleCommandsManager = { /** * Return the name of all registered commands. * - * @return {array} List of all command names. + * @return {Array} List of all command names. */ getAllCommandNames() { return [...this._registeredCommands.keys()]; diff --git a/devtools/server/actors/webconsole/eval-with-debugger.js b/devtools/server/actors/webconsole/eval-with-debugger.js @@ -251,19 +251,19 @@ exports.evalWithDebugger = evalWithDebugger; * This focuses on calling Debugger.Frame or Debugger.Object eval methods. * * @param {Debugger} dbg - * @param {String} string + * @param {string} string * The string to evaluate. - * @param {Object} evalOptions + * @param {object} evalOptions * Spidermonkey options to pass to eval methods. - * @param {Object} bindings + * @param {object} bindings * Dictionary object with symbols to override in the evaluation. * @param {Debugger.Frame} frame * If paused, the paused frame. * @param {Debugger.Object} dbgGlobal * The target's global. - * @param {Boolean} eager + * @param {boolean} eager * Is this an eager evaluation? - * @return {Object} + * @return {object} * The evaluation result object. * See `Debugger.Ojbect.executeInGlobalWithBindings` definition. */ @@ -342,7 +342,7 @@ function getEvalResult( * to undefined, making it possible for them to be redeclared. * * @param {DebuggerObject} dbgGlobal - * @param {String} string: The expression that was evaluated and threw + * @param {string} string: The expression that was evaluated and threw * @returns */ function forceLexicalInitForVariableDeclarationsInThrowingExpression( diff --git a/devtools/server/connectors/js-process-actor/ContentProcessWatcherRegistry.sys.mjs b/devtools/server/connectors/js-process-actor/ContentProcessWatcherRegistry.sys.mjs @@ -85,7 +85,7 @@ export const ContentProcessWatcherRegistry = { * Get all data objects for all currently active watcher actors. * If a specific target type is passed, this will only return objects of watcher actively watching for a given target type. * - * @param {String} targetType + * @param {string} targetType * Optional target type to filter only a subset of watchers. * @return {Array|Iterator} * List of data objects. (see createWatcherDataObject) @@ -116,8 +116,8 @@ export const ContentProcessWatcherRegistry = { /** * Get the watcher data object for a given watcher actor. * - * @param {String} watcherActorID - * @param {Boolean} onlyFromCache + * @param {string} watcherActorID + * @param {boolean} onlyFromCache * If set explicitly to true, will avoid falling back to shared data. * This is typically useful on destructor/removing/cleanup to avoid creating unexpected data. * It is also used to avoid the exception thrown when sharedData is cleared on toolbox destruction. @@ -158,11 +158,11 @@ export const ContentProcessWatcherRegistry = { * and the parent process, which will route RDP packets from/to the client by using * a unique "forwarding prefix". * - * @param {String} watcherActorID - * @param {Boolean} useDistinctLoader + * @param {string} watcherActorID + * @param {boolean} useDistinctLoader * To be set to true when debugging a privileged context running the shared system principal global. * This is a requirement for spidermonkey Debugger API used by the thread actor. - * @return {Object} + * @return {object} * Object with connection (DevToolsServerConnection) and loader (DevToolsLoader) attributes. */ getOrCreateConnectionForWatcher(watcherActorID, useDistinctLoader) { @@ -216,9 +216,9 @@ export const ContentProcessWatcherRegistry = { /** * Method to be called each time a new target actor is instantiated. * - * @param {Object} watcherDataObject + * @param {object} watcherDataObject * @param {Actor} targetActor - * @param {Boolean} isDocumentCreation + * @param {boolean} isDocumentCreation */ onNewTargetActor(watcherDataObject, targetActor, isDocumentCreation = false) { // There is no root actor in content processes and so @@ -279,7 +279,7 @@ export const ContentProcessWatcherRegistry = { /** * Method to be called each time a target actor is meant to be destroyed. * - * @param {Object} watcherDataObject + * @param {object} watcherDataObject * @param {Actor} targetActor * @param {object} options * @param {boolean} options.isModeSwitching @@ -322,8 +322,8 @@ export const ContentProcessWatcherRegistry = { /** * Method to know if a given Watcher Actor is still registered. * - * @param {String} watcherActorID - * @return {Boolean} + * @param {string} watcherActorID + * @return {boolean} */ has(watcherActorID) { return gAllWatcherData.has(watcherActorID); @@ -332,7 +332,7 @@ export const ContentProcessWatcherRegistry = { /** * Method to unregister a given Watcher Actor. * - * @param {Object} watcherDataObject + * @param {object} watcherDataObject */ remove(watcherDataObject) { // We do not need to destroy each actor individually as they @@ -359,7 +359,7 @@ export const ContentProcessWatcherRegistry = { /** * Method to know if there is no more Watcher registered. * - * @return {Boolean} + * @return {boolean} */ isEmpty() { return !gAllWatcherData || gAllWatcherData.size == 0; diff --git a/devtools/server/connectors/js-process-actor/DevToolsProcessChild.sys.mjs b/devtools/server/connectors/js-process-actor/DevToolsProcessChild.sys.mjs @@ -210,9 +210,9 @@ export class DevToolsProcessChild extends JSProcessActorChild { * Stop watching for all target types and destroy all existing targets actor * related to a given watcher actor. * - * @param {Object} watcherDataObject - * @param {String} targetType - * @param {Object} options + * @param {object} watcherDataObject + * @param {string} targetType + * @param {object} options */ #unwatchTargetsForWatcher(watcherDataObject, targetType, options) { const { watchingTargetTypes } = watcherDataObject; @@ -259,7 +259,7 @@ export class DevToolsProcessChild extends JSProcessActorChild { /** * Cleanup everything around a given watcher actor * - * @param {Object} watcherDataObject + * @param {object} watcherDataObject */ #destroyWatcher(watcherDataObject) { const { watchingTargetTypes } = watcherDataObject; @@ -273,7 +273,7 @@ export class DevToolsProcessChild extends JSProcessActorChild { * Used by DevTools Transport to send packets to the content process. * * @param {JSON} packet - * @param {String} prefix + * @param {string} prefix */ sendPacket(packet, prefix) { this.sendAsyncMessage("DevToolsProcessChild:packet", { packet, prefix }); @@ -356,13 +356,13 @@ export class DevToolsProcessChild extends JSProcessActorChild { /** * The parent process requested that some session data have been added or set. * - * @param {String} watcherActorID + * @param {string} watcherActorID * The Watcher Actor ID requesting to add new session data - * @param {String} type + * @param {string} type * The type of data to be added - * @param {Array<Object>} entries + * @param {Array<object>} entries * The values to be added to this type of data - * @param {String} updateType + * @param {string} updateType * "add" will only add the new entries in the existing data set. * "set" will update the data set with the new entries. */ @@ -454,11 +454,11 @@ export class DevToolsProcessChild extends JSProcessActorChild { /** * The parent process requested that some session data have been removed. * - * @param {String} watcherActorID + * @param {string} watcherActorID * The Watcher Actor ID requesting to remove session data - * @param {String}} type + * @param {string}} type * The type of data to be removed - * @param {Array<Object>} entries + * @param {Array<object>} entries * The values to be removed to this type of data */ #removeSessionDataEntry(watcherActorID, type, entries) { @@ -523,7 +523,7 @@ export class DevToolsProcessChild extends JSProcessActorChild { * @param {DOMWindow|Document} subject * A window for *-document-global-created * A document for *-page-{shown|hide} - * @param {String} topic + * @param {string} topic */ observe = (subject, topic) => { if (topic === "init-devtools-content-process-actor") { diff --git a/devtools/server/connectors/js-process-actor/target-watchers/content_script.sys.mjs b/devtools/server/connectors/js-process-actor/target-watchers/content_script.sys.mjs @@ -177,7 +177,7 @@ function destroyTargetsForWatcher(watcherDataObject, options) { * Instantiate a ContentScript target actor for a given content script sandbox * and a given watcher actor. * - * @param {Object} watcherDataObject + * @param {object} watcherDataObject * @param {Sandbox} sandbox */ function createContentScriptTargetActor(watcherDataObject, sandbox) { diff --git a/devtools/server/connectors/js-process-actor/target-watchers/process.sys.mjs b/devtools/server/connectors/js-process-actor/target-watchers/process.sys.mjs @@ -23,7 +23,7 @@ function createTargetsForWatcher(watcherDataObject) { * Instantiate a content process target actor for the current process * and for a given watcher actor. * - * @param {Object} watcherDataObject + * @param {object} watcherDataObject */ function createContentProcessTargetActor(watcherDataObject) { logDOMProcess( @@ -77,7 +77,7 @@ const DEBUG = false; * * @param {nsIDOMProcessChild} domProcessChild * The process for which we should log a message. - * @param {String} message + * @param {string} message * Message to log. */ function logDOMProcess(domProcessChild, message) { diff --git a/devtools/server/connectors/js-process-actor/target-watchers/service_worker.sys.mjs b/devtools/server/connectors/js-process-actor/target-watchers/service_worker.sys.mjs @@ -26,7 +26,7 @@ class ServiceWorkerTargetWatcherClass extends WorkerTargetWatcherClass { * This is used to maintain the list of active Service Worker targets * based on that host name. * - * @param {Object} watcherDataObject + * @param {object} watcherDataObject * See ContentProcessWatcherRegistry */ async updateBrowserElementHost(watcherDataObject) { diff --git a/devtools/server/connectors/js-process-actor/target-watchers/window-global.sys.mjs b/devtools/server/connectors/js-process-actor/target-watchers/window-global.sys.mjs @@ -214,12 +214,12 @@ function destroyTargetsForWatcher(watcherDataObject, options) { * - by a bfcache navigation (pageshow) * * @param {Window} window - * @param {Object} options - * @param {Boolean} options.isBFCache + * @param {object} options + * @param {boolean} options.isBFCache * True, if the request to instantiate a new target comes from a bfcache navigation. * i.e. when we receive a pageshow event with persisted=true. * This will be true regardless of bfcacheInParent being enabled or disabled. - * @param {Boolean} options.ignoreIfExisting + * @param {boolean} options.ignoreIfExisting * By default to false. If true is passed, we avoid instantiating a target actor * if one already exists for this windowGlobal. */ @@ -398,9 +398,9 @@ function onWindowGlobalDestroyed(innerWindowId) { * Instantiate a WindowGlobal target actor for a given browsing context * and for a given watcher actor. * - * @param {Object} watcherDataObject + * @param {object} watcherDataObject * @param {BrowsingContext} windowGlobalChild - * @param {Boolean} isDocumentCreation + * @param {boolean} isDocumentCreation */ function createWindowGlobalTargetActor( watcherDataObject, @@ -472,7 +472,7 @@ function createWindowGlobalTargetActor( * @param {DOMWindow|Document} subject * A window for *-document-global-created * A document for *-page-{shown|hide} - * @param {String} topic + * @param {string} topic */ function observe(subject, topic) { if ( @@ -520,9 +520,9 @@ function observe(subject, topic) { /** * DOM Event handler. * - * @param {String} type + * @param {string} type * DOM event name - * @param {Boolean} persisted + * @param {boolean} persisted * A flag set to true in cache of BFCache navigation * @param {Document} target * The navigating document @@ -581,9 +581,9 @@ function handleEvent({ type, persisted, target }) { * Return an existing Window Global target for given a WatcherActor * and against a given WindowGlobal. * - * @param {Object} options - * @param {String} options.watcherDataObject - * @param {Number} options.innerWindowId + * @param {object} options + * @param {string} options.watcherDataObject + * @param {number} options.innerWindowId * The WindowGlobal inner window ID. * * @returns {WindowGlobalTargetActor|null} diff --git a/devtools/server/connectors/js-process-actor/target-watchers/worker.sys.mjs b/devtools/server/connectors/js-process-actor/target-watchers/worker.sys.mjs @@ -166,7 +166,7 @@ export class WorkerTargetWatcherClass { * Instantiate a worker target actor related to a given WorkerDebugger object * and for a given watcher actor. * - * @param {Object} watcherDataObject + * @param {object} watcherDataObject * @param {WorkerDebugger} dbg */ async createWorkerTargetActor(watcherDataObject, dbg) { @@ -314,14 +314,14 @@ export class WorkerTargetWatcherClass { /** * Indicates whether or not we should handle the worker debugger * - * @param {Object} sessionData + * @param {object} sessionData * The session data for a given watcher, which includes metadata * about the debugged context. * @param {WorkerDebugger} dbg * The worker debugger we want to check. - * @param {String} targetType + * @param {string} targetType * The expected worker target type. - * @returns {Boolean} + * @returns {boolean} */ shouldHandleWorker(sessionData, dbg, targetType) { if (!isWorkerDebuggerAlive(dbg)) { @@ -409,12 +409,12 @@ export class WorkerTargetWatcherClass { * Communicate the type and entries to the Worker Target actor, via the WorkerDebugger. * * @param {WorkerDebugger} dbg - * @param {String} workerThreadServerForwardingPrefix - * @param {String} type + * @param {string} workerThreadServerForwardingPrefix + * @param {string} type * Session data type name * @param {Array} entries * Session data entries to add or set. - * @param {String} updateType + * @param {string} updateType * Either "add" or "set", to control if we should only add some items, * or replace the whole data set with the new entries. * @returns {Promise} Returns a Promise that resolves once the data entry were handled diff --git a/devtools/server/connectors/worker-connector.js b/devtools/server/connectors/worker-connector.js @@ -18,10 +18,10 @@ loader.lazyRequireGetter( * * @params {DevToolsConnection} connection * @params {WorkerDebugger} dbg: The WorkerDebugger we want to create a target actor for. - * @params {String} forwardingPrefix: The prefix that will be used to forward messages + * @params {string} forwardingPrefix: The prefix that will be used to forward messages * to the DevToolsServer on the worker thread. - * @params {Object} options: An option object that will be passed with the "connect" packet. - * @params {Object} options.sessionData: The sessionData object that will be passed to the + * @params {object} options: An option object that will be passed with the "connect" packet. + * @params {object} options.sessionData: The sessionData object that will be passed to the * worker target actor. */ function connectToWorker(connection, dbg, forwardingPrefix, options) { diff --git a/devtools/server/devtools-server-connection.js b/devtools/server/devtools-server-connection.js @@ -272,7 +272,7 @@ DevToolsServerConnection.prototype = { * This function returns whether the connection was accepted by passed SocketListener. * * @param {SocketListener} socketListener - * @return {Boolean} return true if this connection was accepted by socketListener, + * @return {boolean} return true if this connection was accepted by socketListener, * else returns false. */ isAcceptedBy(socketListener) { diff --git a/devtools/server/performance/memory.js b/devtools/server/performance/memory.js @@ -168,9 +168,9 @@ Memory.prototype = { * Save a heap snapshot scoped to the current debuggees' portion of the heap * graph. * - * @param {Object|null} boundaries + * @param {object | null} boundaries * - * @returns {String} The snapshot id. + * @returns {string} The snapshot id. */ saveHeapSnapshot: expectState( "attached", diff --git a/devtools/server/tests/browser/browser_accessibility_highlighter_infobar.js b/devtools/server/tests/browser/browser_accessibility_highlighter_infobar.js @@ -36,13 +36,13 @@ add_task(async function () { /** * A helper function for testing the accessible's displayed name and roles. * - * @param {Object} walker + * @param {object} walker * The DOM walker. - * @param {String} querySelector + * @param {string} querySelector * The selector for the node to retrieve accessible from. - * @param {Object} a11yWalker + * @param {object} a11yWalker * The accessibility walker. - * @param {String} expectedName + * @param {string} expectedName * Expected string content for displaying the accessible's name. * We are testing this in particular because name can be truncated. */ diff --git a/devtools/server/tests/browser/browser_accessibility_infobar_audit_keyboard.js b/devtools/server/tests/browser/browser_accessibility_infobar_audit_keyboard.js @@ -47,9 +47,9 @@ add_task(async function () { /** * Checks for updated content for an infobar. * - * @param {Object} infobar + * @param {object} infobar * Accessible highlighter's infobar component. - * @param {Object} audit + * @param {object} audit * Audit information that is passed on highlighter show. */ function checkKeyboard(infobar, audit) { diff --git a/devtools/server/tests/browser/browser_accessibility_infobar_audit_text_label.js b/devtools/server/tests/browser/browser_accessibility_infobar_audit_text_label.js @@ -48,9 +48,9 @@ add_task(async function () { /** * Checks for updated content for an infobar. * - * @param {Object} infobar + * @param {object} infobar * Accessible highlighter's infobar component. - * @param {Object} audit + * @param {object} audit * Audit information that is passed on highlighter show. */ function checkTextLabel(infobar, audit) { diff --git a/devtools/server/tests/browser/browser_accessibility_infobar_show.js b/devtools/server/tests/browser/browser_accessibility_infobar_show.js @@ -27,9 +27,9 @@ add_task(async function () { /** * Get whether or not infobar container is hidden. * - * @param {Object} infobar + * @param {object} infobar * Accessible highlighter's infobar component. - * @return {String|null} If the infobar container is hidden. + * @return {string | null} If the infobar container is hidden. */ function isContainerHidden(infobar) { return !!infobar @@ -40,9 +40,9 @@ add_task(async function () { /** * Get name of accessible object. * - * @param {Object} infobar + * @param {object} infobar * Accessible highlighter's infobar component. - * @return {String} The text content of the infobar-name element. + * @return {string} The text content of the infobar-name element. */ function getName(infobar) { return infobar.getTextContent("accessible-infobar-name"); @@ -51,9 +51,9 @@ add_task(async function () { /** * Get role of accessible object. * - * @param {Object} infobar + * @param {object} infobar * Accessible highlighter's infobar component. - * @return {String} The text content of the infobar-role element. + * @return {string} The text content of the infobar-role element. */ function getRole(infobar) { return infobar.getTextContent("accessible-infobar-role"); @@ -62,9 +62,9 @@ add_task(async function () { /** * Checks for updated content for an infobar with valid bounds. * - * @param {Object} infobar + * @param {object} infobar * Accessible highlighter's infobar component. - * @param {Object} options + * @param {object} options * Options to pass for the highlighter's show method. * Available options: * - {String} role @@ -98,7 +98,7 @@ add_task(async function () { * * @param {Element} node * Node to check infobar content on. - * @param {Object} highlighter + * @param {object} highlighter * Accessible highlighter. */ function testInfobar(node, highlighter) { diff --git a/devtools/server/tests/browser/head.js b/devtools/server/tests/browser/head.js @@ -125,10 +125,10 @@ function waitUntilClientConnected(client) { /** * Wait for eventName on target. * - * @param {Object} target An observable object that either supports on/off or + * @param {object} target An observable object that either supports on/off or * addEventListener/removeEventListener - * @param {String} eventName - * @param {Boolean} useCapture Optional, for addEventListener/removeEventListener + * @param {string} eventName + * @param {boolean} useCapture Optional, for addEventListener/removeEventListener * @return A promise that resolves when the event has been handled */ function once(target, eventName, useCapture = false) { @@ -254,7 +254,7 @@ function getCookieId(name, domain, path, partitionKey = "") { /** * Trigger DOM activity and wait for the corresponding accessibility event. * - * @param {Object} emitter Devtools event emitter, usually a front. + * @param {object} emitter Devtools event emitter, usually a front. * @param {Sting} name Accessibility event in question. * @param {Function} handler Accessibility event handler function with checks. * @param {Promise} task A promise that resolves when DOM activity is done. @@ -269,9 +269,9 @@ async function emitA11yEvent(emitter, name, handler, task) { * Check that accessibilty front is correct and its attributes are also * up-to-date. * - * @param {Object} front Accessibility front to be tested. - * @param {Object} expected A map of a11y front properties to be verified. - * @param {Object} expectedFront Expected accessibility front. + * @param {object} front Accessibility front to be tested. + * @param {object} expected A map of a11y front properties to be verified. + * @param {object} expectedFront Expected accessibility front. */ function checkA11yFront(front, expected, expectedFront) { ok(front, "The accessibility front is created"); diff --git a/devtools/server/tests/chrome/inactive-property-helper/border-image.mjs b/devtools/server/tests/chrome/inactive-property-helper/border-image.mjs @@ -80,7 +80,7 @@ export default [ ]; /** - * @param {Object} testParameters + * @param {object} testParameters * @param {bool} testParameters.useDivTagWithDisplayTableStyle use generic divs using display property instead of actual table/tr/td tags * @param {bool} testParameters.borderCollapse is `border-collapse` property set to `collapse` ( instead of `separate`) * @param {bool} testParameters.borderCollapsePropertyIsInherited should the border collapse property be inherited from the table parent (instead of directly set on the internal table element) diff --git a/devtools/server/tests/xpcshell/head_dbg.js b/devtools/server/tests/xpcshell/head_dbg.js @@ -408,8 +408,8 @@ async function getTestTab(client, title) { /** * Attach to the client's tab whose title is specified * - * @param {Object} client - * @param {Object} title + * @param {object} client + * @param {object} title * @returns commands */ async function attachTestTab(client, title) { @@ -429,9 +429,9 @@ async function attachTestTab(client, title) { * Attach to the client's tab whose title is specified, and then attach to * that tab's thread. * - * @param {Object} client - * @param {Object} title - * @returns {Object} + * @param {object} client + * @param {object} title + * @returns {object} * targetFront * threadFront * commands diff --git a/devtools/server/tests/xpcshell/webextension-helpers.js b/devtools/server/tests/xpcshell/webextension-helpers.js @@ -23,7 +23,7 @@ const { /** * Loads and starts up a test extension given the provided extension configuration. * - * @param {Object} extConfig - The extension configuration object + * @param {object} extConfig - The extension configuration object * @return {ExtensionWrapper} extension - Resolves with an extension object once the * extension has started up. */ @@ -40,8 +40,8 @@ exports.startupExtension = startupExtension; * Initializes the extensionStorage actor for a given extension. This is effectively * what happens when the addon storage panel is opened in the browser. * - * @param {String} - id, The addon id - * @return {Object} - Resolves with the DevTools "commands" objact and the extensionStorage + * @param {string} - id, The addon id + * @return {object} - Resolves with the DevTools "commands" objact and the extensionStorage * resource/front. */ async function openAddonStoragePanel(id) { @@ -69,13 +69,13 @@ exports.openAddonStoragePanel = openAddonStoragePanel; /** * Builds the extension configuration object passed into ExtensionTestUtils.loadExtension * - * @param {Object} options - Options, if any, to add to the configuration + * @param {object} options - Options, if any, to add to the configuration * @param {Function} options.background - A function comprising the test extension's * background script if provided - * @param {Object} options.files - An object whose keys correspond to file names and + * @param {object} options.files - An object whose keys correspond to file names and * values map to the file contents - * @param {Object} options.manifest - An object representing the extension's manifest - * @return {Object} - The extension configuration object + * @param {object} options.manifest - An object representing the extension's manifest + * @return {object} - The extension configuration object */ function getExtensionConfig(options = {}) { const { manifest, ...otherOptions } = options; @@ -165,8 +165,8 @@ exports.extensionScriptWithMessageListener = extensionScriptWithMessageListener; /** * Shutdown procedure common to all tasks. * - * @param {Object} extension - The test extension - * @param {Object} commands - The web extension commands used by the DevTools to interact with the backend + * @param {object} extension - The test extension + * @param {object} commands - The web extension commands used by the DevTools to interact with the backend */ async function shutdown(extension, commands) { if (commands) { diff --git a/devtools/server/tracer/tracer.sys.mjs b/devtools/server/tracer/tracer.sys.mjs @@ -105,19 +105,19 @@ const customLazy = { * Start tracing against a given JS global. * Only code run from that global will be logged. * - * @param {Object} options + * @param {object} options * Object with configurations: - * @param {Object} options.global + * @param {object} options.global * The tracer only log traces related to the code executed within this global. * When omitted, it will default to the options object's global. - * @param {Boolean} options.traceAllGlobals + * @param {boolean} options.traceAllGlobals * When set to true, this will trace all the globals running in the current thread. - * @param {String} options.prefix + * @param {string} options.prefix * Optional string logged as a prefix to all traces. - * @param {Boolean} options.loggingMethod + * @param {boolean} options.loggingMethod * Optional setting to use something else than `dump()` to log traces to stdout. * This is mostly used by tests. - * @param {Boolean} options.traceDOMEvents + * @param {boolean} options.traceDOMEvents * Optional setting to enable tracing all the DOM events being going through * dom/events/EventListenerManager.cpp's `EventListenerManager`. * @param {Array<string>} options.traceDOMMutations @@ -126,27 +126,27 @@ const customLazy = { * - "add": trace all new DOM Node being added, * - "attributes": trace all DOM attribute modifications, * - "delete": trace all DOM Node being removed. - * @param {Boolean} options.traceValues + * @param {boolean} options.traceValues * Optional setting to enable tracing all function call values as well, * as returned values (when we do log returned frames). - * @param {Boolean} options.traceOnNextInteraction + * @param {boolean} options.traceOnNextInteraction * Optional setting to enable when the tracing should only start when the * use starts interacting with the page. i.e. on next keydown or mousedown. - * @param {Boolean} options.traceSteps + * @param {boolean} options.traceSteps * Optional setting to enable tracing each frame within a function execution. * (i.e. not only function call and function returns [when traceFunctionReturn is true]) - * @param {Boolean} options.traceFunctionReturn + * @param {boolean} options.traceFunctionReturn * Optional setting to enable when the tracing should notify about frame exit. * i.e. when a function call returns or throws. - * @param {String} options.filterFrameSourceUrl + * @param {string} options.filterFrameSourceUrl * Optional setting to restrict all traces to only a given source URL. * This is a loose check, so any source whose URL includes the passed string will be traced. - * @param {Number} options.maxDepth + * @param {number} options.maxDepth * Optional setting to ignore frames when depth is greater than the passed number. - * @param {Number} options.maxRecords + * @param {number} options.maxRecords * Optional setting to stop the tracer after having recorded at least * the passed number of top level frames. - * @param {Number} options.pauseOnStep + * @param {number} options.pauseOnStep * Optional setting to delay each frame execution for a given amount of time in ms. */ class JavaScriptTracer { @@ -503,7 +503,7 @@ class JavaScriptTracer { /** * Stop observing execution. * - * @param {String} reason + * @param {string} reason * Optional string to justify why the tracer stopped. */ stopTracing(reason = "") { @@ -586,9 +586,9 @@ class JavaScriptTracer { * Notify DevTools and/or the user via stdout that tracing * has been enabled or disabled. * - * @param {Boolean} state + * @param {boolean} state * True if we just started tracing, false when it just stopped. - * @param {String} reason + * @param {string} reason * Optional string to justify why the tracer stopped. */ notifyToggle(state, reason) { @@ -809,7 +809,7 @@ class JavaScriptTracer { * Display to stdout one given frame execution, which represents a function call. * * @param {Debugger.Frame} frame - * @param {Number} depth + * @param {number} depth */ logFrameEnteredToStdout(frame, depth) { const padding = "—".repeat(depth + 1); @@ -861,7 +861,7 @@ class JavaScriptTracer { * Display to stdout one given frame execution, which represents a step within a function execution. * * @param {Debugger.Frame} frame - * @param {Number} depth + * @param {number} depth */ logFrameStepToStdout(frame, depth) { const padding = "—".repeat(depth + 1); @@ -875,8 +875,8 @@ class JavaScriptTracer { * Display to stdout the exit of a given frame execution, which represents a function return. * * @param {Debugger.Frame} frame - * @param {String} why - * @param {Number} depth + * @param {string} why + * @param {number} depth */ logFrameExitedToStdout(frame, depth, why, rv) { const padding = "—".repeat(depth + 1); @@ -910,7 +910,7 @@ class JavaScriptTracer { * Return a string description for any arbitrary JS value. * Used when logging to stdout. * - * @param {Object} obj + * @param {object} obj * Any JavaScript object to describe. * @return String * User meaningful descriptor for the object. @@ -979,7 +979,7 @@ let activeTracer = null; * Start tracing JavaScript. * i.e. log the name of any function being called in JS and its location in source code. * - * @params {Object} options (mandatory) + * @params {object} options (mandatory) * See JavaScriptTracer.startTracing jsdoc. */ function startTracing(options) { @@ -1022,7 +1022,7 @@ function stopTracing() { * - formatedDisplayName is a string and is a human readable name for the current frame * - prefix is a string to display as a prefix of any logged frame * - * @param {Object} listener + * @param {object} listener */ function addTracingListener(listener) { listeners.add(listener); @@ -1068,7 +1068,7 @@ function getFrameDepth(frame) { * * @param {Debugger.Frame} frame * The frame being traced. - * @return {String} + * @return {string} * The URL's magic string. */ function getTerminalHyperLink(frame) { @@ -1088,7 +1088,7 @@ function getTerminalHyperLink(frame) { * Helper function to synchronously pause the current frame execution * for a given duration in ms. * - * @param {Number} duration + * @param {number} duration */ function syncPause(duration) { let freeze = true; diff --git a/devtools/shared/DevToolsUtils.js b/devtools/shared/DevToolsUtils.js @@ -170,9 +170,9 @@ exports.defineLazyPrototypeGetter = function (object, key, callback) { * * @param {Debugger.Object} object * The Debugger.Object to get the value from. - * @param {String} key + * @param {string} key * The key to look for. - * @param {Boolean} invokeUnsafeGetter (defaults to false). + * @param {boolean} invokeUnsafeGetter (defaults to false). * Optional boolean to indicate if the function should execute unsafe getter * in order to retrieve its result's properties. * ⚠️ This should be set to true *ONLY* on user action as it may cause side-effects @@ -334,9 +334,9 @@ exports.hasSafeGetter = function (desc) { * * @param {Debugger.Object} object * The Debugger.Object to check on. - * @param {String} key + * @param {string} key * The key to look for. - * @param {Boolean} invokeUnsafeGetter (defaults to false). + * @param {boolean} invokeUnsafeGetter (defaults to false). * Optional boolean to indicate if the function should execute unsafe getter * in order to retrieve its result's properties. * @return Boolean @@ -727,8 +727,8 @@ function mainThreadFetch( /** * Opens a channel for given URL. Tries a bit harder than NetUtil.newChannel. * - * @param {String} url - The URL to open a channel for. - * @param {Object} options - The options object passed to @method fetch. + * @param {string} url - The URL to open a channel for. + * @param {object} options - The options object passed to @method fetch. * @return {nsIChannel} - The newly created channel. Throws on failure. */ function newChannelForURL(url, { policy, window, principal }) { @@ -807,7 +807,7 @@ if (this.isWorker) { /** * Open the file at the given path for reading. * - * @param {String} filePath + * @param {string} filePath * * @returns Promise<nsIInputStream> */ @@ -835,13 +835,13 @@ exports.openFileStream = function (filePath) { * The parent window to use to display the filepicker. * @param {UInt8Array} dataArray * The data to write to the file. - * @param {String} fileName + * @param {string} fileName * The suggested filename. * @param {Array} filters * An array of object of the following shape: * - pattern: A pattern for accepted files (example: "*.js") * - label: The label that will be displayed in the save file dialog. - * @return {String|null} + * @return {string | null} * The path to the local saved file, if saved. */ exports.saveAs = async function ( @@ -878,7 +878,7 @@ exports.saveAs = async function ( * @param {nsIWindow} parentWindow * Optional parent window. If null the parent window of the file picker * will be the window of the attached input element. - * @param {String} suggestedFilename + * @param {string} suggestedFilename * The suggested filename. * @param {Array} filters * An array of object of the following shape: @@ -1020,9 +1020,9 @@ exports.getTopWindow = getTopWindow; * a deep equality check on their properties and values. * See toolkit/modules/ObjectUtils.jsm for implementation. * - * @param {Object} a - * @param {Object} b - * @return {Boolean} + * @param {object} a + * @param {object} b + * @return {boolean} */ exports.deepEqual = (a, b) => { return lazy.ObjectUtils.deepEqual(a, b); diff --git a/devtools/shared/ThreadSafeDevToolsUtils.js b/devtools/shared/ThreadSafeDevToolsUtils.js @@ -27,8 +27,8 @@ * assert(original.baz === 2); * assert(original.bang === undefined); * - * @param {...Object} ...objs - * @returns {Object} + * @param {...object} ...objs + * @returns {object} */ exports.immutableUpdate = function (...objs) { return Object.freeze(Object.assign({}, ...objs)); diff --git a/devtools/shared/accessibility.js b/devtools/shared/accessibility.js @@ -39,11 +39,11 @@ const LARGE_TEXT = { /** * Get contrast ratio score based on WCAG criteria. * - * @param {Number} ratio + * @param {number} ratio * Value of the contrast ratio for a given accessible object. - * @param {Boolean} isLargeText + * @param {boolean} isLargeText * True if the accessible object contains large text. - * @return {String} + * @return {string} * Value that represents calculated contrast ratio score. */ function getContrastRatioScore(ratio, isLargeText) { @@ -62,7 +62,7 @@ function getContrastRatioScore(ratio, isLargeText) { /** * Get calculated text style properties from a node's computed style, if possible. * - * @param {Object} computedStyle + * @param {object} computedStyle * Computed style using which text styling information is to be calculated. * - fontSize {String} * Font size of the text @@ -72,7 +72,7 @@ function getContrastRatioScore(ratio, isLargeText) { * Rgb color of the text * - opacity {String} Optional * Opacity of the text - * @return {Object} + * @return {object} * Color and text size information for a given DOM node. */ function getTextProperties(computedStyle) { @@ -124,7 +124,7 @@ function getTextProperties(computedStyle) { * against the given background color data. If background is multi-colored, return a * range, otherwise a single contrast ratio. * - * @param {Object} backgroundColorData + * @param {object} backgroundColorData * Object with one or more of the following properties: * - value {Array} * rgba array for single color background @@ -132,12 +132,12 @@ function getTextProperties(computedStyle) { * min luminance rgba array for multi color background * - max {Array} * max luminance rgba array for multi color background - * @param {Object} textData + * @param {object} textData * - color {Array} * rgba array for text of referenced DOM node * - isLargeText {Boolean} * True if text of referenced DOM node is large - * @return {Object} + * @return {object} * An object that may contain one or more of the following fields: error, * isLargeText, value, min, max values for contrast. */ diff --git a/devtools/shared/commands/commands-factory.js b/devtools/shared/commands/commands-factory.js @@ -36,12 +36,12 @@ exports.CommandsFactory = { * Create commands for a given local tab. * * @param {Tab} tab: A local Firefox tab, running in this process. - * @param {Object} options + * @param {object} options * @param {DevToolsClient} options.client: An optional DevToolsClient. If none is passed, * a new one will be created. * @param {DevToolsClient} options.isWebExtension: An optional boolean to flag commands * that are created for the WebExtension codebase. - * @returns {Object} Commands + * @returns {object} Commands */ async forTab(tab, { client, isWebExtension } = {}) { if (!client) { @@ -69,11 +69,11 @@ exports.CommandsFactory = { /** * Create commands for the main process. * - * @param {Object} options + * @param {object} options * @param {DevToolsClient} options.client: An optional DevToolsClient. If none is passed, * a new one will be created. - * @param {Boolean} enableWindowGlobalThreadActors: An optional boolean for on test. - * @returns {Object} Commands + * @param {boolean} enableWindowGlobalThreadActors: An optional boolean for on test. + * @returns {object} Commands */ async forMainProcess({ client, @@ -97,11 +97,11 @@ exports.CommandsFactory = { * Note that it can also be used for local tab, but isLocalTab attribute * on commands.descriptorFront will be false. * - * @param {Number} browserId: Identify which tab we should create commands for. - * @param {Object} options + * @param {number} browserId: Identify which tab we should create commands for. + * @param {object} options * @param {DevToolsClient} options.client: An optional DevToolsClient. If none is passed, * a new one will be created. - * @returns {Object} Commands + * @returns {object} Commands */ async forRemoteTab(browserId, { client } = {}) { if (!client) { @@ -116,13 +116,13 @@ exports.CommandsFactory = { /** * Create commands for a given main process worker. * - * @param {String} id: WorkerDebugger's id, which is a unique ID computed by the platform code. + * @param {string} id: WorkerDebugger's id, which is a unique ID computed by the platform code. * These ids are exposed via WorkerDescriptor's id attributes. * WorkerDescriptors can be retrieved via MainFront.listAllWorkers()/listWorkers(). - * @param {Object} options + * @param {object} options * @param {DevToolsClient} options.client: An optional DevToolsClient. If none is passed, * a new one will be created. - * @returns {Object} Commands + * @returns {object} Commands */ async forWorker(id, { client } = {}) { if (!client) { @@ -137,11 +137,11 @@ exports.CommandsFactory = { /** * Create commands for a Web Extension. * - * @param {String} id The Web Extension ID to debug. - * @param {Object} options + * @param {string} id The Web Extension ID to debug. + * @param {object} options * @param {DevToolsClient} options.client: An optional DevToolsClient. If none is passed, * a new one will be created. - * @returns {Object} Commands + * @returns {object} Commands */ async forAddon(id, { client } = {}) { if (!client) { diff --git a/devtools/shared/commands/index.js b/devtools/shared/commands/index.js @@ -34,7 +34,7 @@ const Commands = { * This dictionary is lazy and commands will be loaded and instanciated on-demand. * * @param {DescriptorFront} descriptorFront - * @param {Boolean} enableWindowGlobalThreadActors: Used by one test. + * @param {boolean} enableWindowGlobalThreadActors: Used by one test. */ async function createCommandsDictionary( descriptorFront, diff --git a/devtools/shared/commands/inspected-window/inspected-window-command.js b/devtools/shared/commands/inspected-window/inspected-window-command.js @@ -32,11 +32,11 @@ class InspectedWindowCommand { /** * Evaluate the provided javascript code in a target window. * - * @param {Object} webExtensionCallerInfo - The addonId and the url (the addon base url + * @param {object} webExtensionCallerInfo - The addonId and the url (the addon base url * or the url of the actual caller filename and lineNumber) used to log useful * debugging information in the produced error logs and eval stack trace. - * @param {String} expression - The expression to evaluate. - * @param {Object} options - An option object. Check the actor method definition to see + * @param {string} expression - The expression to evaluate. + * @param {object} options - An option object. Check the actor method definition to see * what properties it can hold (minus the `consoleFront` property which is defined * below). * @param {WebConsoleFront} options.consoleFront - An optional webconsole front. When @@ -100,7 +100,7 @@ class InspectedWindowCommand { * the addonId and the url (the addon base url or the url of the actual caller * filename and lineNumber) used to log useful debugging information in the * produced error logs and eval stack trace. - * @param {Object} options + * @param {object} options * @param {boolean|undefined} options.ignoreCache * Enable/disable the cache bypass headers. * @param {string|undefined} options.injectedScript diff --git a/devtools/shared/commands/inspector/inspector-command.js b/devtools/shared/commands/inspector/inspector-command.js @@ -43,10 +43,10 @@ class InspectorCommand { /** * Search the document for the given string and return all the results. * - * @param {Object} walkerFront - * @param {String} query + * @param {object} walkerFront + * @param {string} query * The string to search for. - * @param {Object} options + * @param {object} options * {Boolean} options.reverse - search backwards * @returns {Array} The list of search results */ @@ -62,11 +62,11 @@ class InspectorCommand { * If a new query which does not match the current one all is reset and new search * is kicked off. * - * @param {String} query + * @param {string} query * The string / selector searched for - * @param {Object} options + * @param {object} options * {Boolean} reverse - determines if the search is done backwards - * @returns {Object} res + * @returns {object} res * {String} res.type * {String} res.query - The string / selector searched for * {Object} res.node - the current node @@ -113,11 +113,11 @@ class InspectorCommand { /** * Returns a list of matching results for CSS selector autocompletion. * - * @param {String} query + * @param {string} query * The selector query being completed - * @param {String} firstPart + * @param {string} firstPart * The exact token being completed out of the query - * @param {String} state + * @param {string} state * One of "pseudo", "id", "tag", "class", "null" * @return {Array<string>} suggestions * The list of suggested CSS selectors @@ -333,7 +333,7 @@ class InspectorCommand { * it will return something like: ["body > iframe", "#sub-document-title"] * * @param {NodeFront} nodeFront: The nodefront to get the selectors for - * @returns {Promise<Array<String>>} A promise that resolves with an array of selectors (strings) + * @returns {Promise<Array<string>>} A promise that resolves with an array of selectors (strings) */ async getNodeFrontSelectorsFromTopDocument(nodeFront) { const selectors = []; @@ -361,10 +361,10 @@ class InspectorCommand { /** * Get compatibility issues for given domRule declarations * - * @param {Array<Object>} domRuleDeclarations + * @param {Array<object>} domRuleDeclarations * @param {string} domRuleDeclarations[].name: Declaration name * @param {string} domRuleDeclarations[].value: Declaration value - * @returns {Promise<Array<Object>>} + * @returns {Promise<Array<object>>} */ async getCSSDeclarationBlockIssues(domRuleDeclarations) { // Filter out custom property declarations as we can't have issue with those and @@ -415,7 +415,7 @@ class InspectorCommand { /** * Get compatibility issues for all queued domRules declarations * - * @returns {Promise<Array<Array<Object>>>} + * @returns {Promise<Array<Array<object>>>} */ #batchedGetCSSDeclarationBlockIssues = async () => { const declarations = diff --git a/devtools/shared/commands/inspector/tests/browser_inspector_command_search.js b/devtools/shared/commands/inspector/tests/browser_inspector_command_search.js @@ -72,11 +72,11 @@ add_task(async () => { /** * Does an inspector search to find the next node and assert the results * - * @param {Object} commands - * @param {Object} options + * @param {object} commands + * @param {object} options * options.query - search query * options.reverse - search in reverse - * @param {Object} expected + * @param {object} expected * Holds the expected values */ async function searchAndAssert(commands, { query, reverse }, expected) { diff --git a/devtools/shared/commands/network/network-command.js b/devtools/shared/commands/network/network-command.js @@ -15,7 +15,7 @@ class NetworkCommand { * The context to inspect identified by this descriptor. * @param {WatcherFront} watcherFront * If available, a reference to the related Watcher Front. - * @param {Object} commands + * @param {object} commands * The commands object with all interfaces defined from devtools/shared/commands/ */ constructor({ descriptorFront, watcherFront, commands }) { @@ -76,7 +76,7 @@ class NetworkCommand { /** * Block only one additional URL filter * - * @param {String} url + * @param {string} url * URL filter to block. * See getBlockedUrls for definition of URL filters. */ @@ -88,7 +88,7 @@ class NetworkCommand { /** * Stop blocking only one specific URL filter * - * @param {String} url + * @param {string} url * URL filter to unblock. * See getBlockedUrls for definition of URL filters. */ diff --git a/devtools/shared/commands/resource/resource-command.js b/devtools/shared/commands/resource/resource-command.js @@ -119,7 +119,7 @@ class ResourceCommand { /** * Return all specified resources cached in this watcher. * - * @param {String} resourceType + * @param {string} resourceType * @return {Array} resources cached in this watcher */ getAllResources(resourceType) { @@ -135,9 +135,9 @@ class ResourceCommand { /** * Return the specified resource cached in this watcher. * - * @param {String} resourceType - * @param {String} resourceId - * @return {Object} resource cached in this watcher + * @param {string} resourceType + * @param {string} resourceId + * @return {object} resource cached in this watcher */ getResourceById(resourceType, resourceId) { return this._cache.get(cacheKey(resourceType, resourceId)); @@ -149,7 +149,7 @@ class ResourceCommand { * * @param {Array:string} resources * List of all resources which should be fetched and observed. - * @param {Object} options + * @param {object} options * - {Function} onAvailable: This attribute is mandatory. * Function which will be called with an array of resources * each time resource(s) are created. @@ -336,13 +336,13 @@ class ResourceCommand { /** * Wait for a single resource of the provided resourceType. * - * @param {String} resourceType + * @param {string} resourceType * One of ResourceCommand.TYPES, type of the expected resource. - * @param {Object} additional options + * @param {object} additional options * - {Boolean} ignoreExistingResources: ignore existing resources or not. * - {Function} predicate: if provided, will wait until a resource makes * predicate(resource) return true. - * @return {Promise<Object>} + * @return {Promise<object>} * Return a promise which resolves once we fully settle the resource listener. * You should await for its resolution before doing the action which may fire * your resource. @@ -377,9 +377,9 @@ class ResourceCommand { /** * Check if there are any watchers for the specified resource. * - * @param {String} resourceType + * @param {string} resourceType * One of ResourceCommand.TYPES - * @return {Boolean} + * @return {boolean} * If the resources type is beibg watched. */ isResourceWatched(resourceType) { @@ -464,12 +464,12 @@ class ResourceCommand { /** * Method called by the TargetCommand for each already existing or target which has just been created. * - * @param {Object} arg + * @param {object} arg * @param {Front} arg.targetFront * The Front of the target that is available. * This Front inherits from TargetMixin and is typically * composed of a WindowGlobalTargetFront or ContentProcessTargetFront. - * @param {Boolean} arg.isTargetSwitching + * @param {boolean} arg.isTargetSwitching * true when the new target was created because of a target switching. */ async _onTargetAvailable({ targetFront, isTargetSwitching }) { @@ -601,10 +601,10 @@ class ResourceCommand { /** * Method called by the TargetCommand when a target has just been destroyed * - * @param {Object} arg + * @param {object} arg * @param {Front} arg.targetFront * The Front of the target that was destroyed - * @param {Boolean} arg.isModeSwitching + * @param {boolean} arg.isModeSwitching * true when this is called as the result of a change to the devtools.browsertoolbox.scope pref. */ _onTargetDestroyed({ targetFront, isModeSwitching }) { @@ -786,13 +786,13 @@ class ResourceCommand { * - the backward compatibility code (LegacyListeners) * - target actors RDP events * - * @param {Object} source + * @param {object} source * A dictionary object with only one of these two attributes: * - targetFront: a Target Front, if the resource is watched from the * target process or thread. * - watcherFront: a Watcher Front, if the resource is watched from * the parent process. - * @param {Array<Object>} updates + * @param {Array<object>} updates * Depending on the listener. * * Among the element in the array, the following attributes are given special handling. @@ -895,7 +895,7 @@ class ResourceCommand { /** * Called every time a resource is destroyed in the remote target. * - * @param {Object} source + * @param {object} source * A dictionary object with only one of these two attributes: * - targetFront: a Target Front, if the resource is watched from the * target process or thread. @@ -1011,7 +1011,7 @@ class ResourceCommand { * Tells if the server supports listening to the given resource type * via the watcher actor's watchResources method. * - * @return {Boolean} True, if the server supports this type. + * @return {boolean} True, if the server supports this type. */ hasResourceCommandSupport(resourceType) { return this.watcherFront?.traits?.resources?.[resourceType]; @@ -1022,7 +1022,7 @@ class ResourceCommand { * via the watcher actor's watchResources method, and that, for a specific * target. * - * @return {Boolean} True, if the server supports this type. + * @return {boolean} True, if the server supports this type. */ _hasResourceCommandSupportForTarget(resourceType, targetFront) { // First check if the watcher supports this target type. @@ -1043,10 +1043,10 @@ class ResourceCommand { * For backward compatibility code, we register the legacy listeners on * each individual target * - * @param {String} resourceType + * @param {string} resourceType * One string of ResourceCommand.TYPES, which designates the types of resources * to be listened. - * @param {Object} + * @param {object} * - {Boolean} bypassListenerCount * Pass true to avoid checking/updating the listenersCount map. * Exclusively used when target switching, to stop & start listening diff --git a/devtools/shared/commands/resource/tests/browser_resources_console_messages.js b/devtools/shared/commands/resource/tests/browser_resources_console_messages.js @@ -184,7 +184,7 @@ async function logExistingMessages(browser, executeInIframe) { * preceding stack. * * @param {BrowsingContext} The browsing context into which the script should be evaluated - * @param {Function|String} The JS to execute in the browsing context + * @param {Function | string} The JS to execute in the browsing context * * @return {Promise} Which resolves once the JS is done executing in the page */ diff --git a/devtools/shared/commands/resource/tests/browser_resources_stylesheets_navigation.js b/devtools/shared/commands/resource/tests/browser_resources_stylesheets_navigation.js @@ -203,7 +203,7 @@ add_task(async function () { * * @param {Browser|BrowsingContext} browserOrBrowsingContext: The browser element or a * browsing context. - * @returns {Promise<Boolean>} + * @returns {Promise<boolean>} */ function getDocumentStyleSheetChangeEventsEnabled(browserOrBrowsingContext) { return SpecialPowers.spawn(browserOrBrowsingContext, [], () => { @@ -218,7 +218,7 @@ function getDocumentStyleSheetChangeEventsEnabled(browserOrBrowsingContext) { * have a "title" attribute that represent their expected order so we can sort them in * a way that makes it easier for us to assert. * - * @param {Array<Object>} resources: Array of stylesheet resources + * @param {Array<object>} resources: Array of stylesheet resources */ function sortResourcesByExpectedOrder(resources) { resources.sort((a, b) => { @@ -229,10 +229,10 @@ function sortResourcesByExpectedOrder(resources) { /** * Check that the resources have the expected text * - * @param {Array<Object>} resources: Array of stylesheet resources - * @param {Array<Object>} expected: Array of object of the following shape: - * @param {Object} expected[] - * @param {Object} expected[].styleText: Expected text content of the stylesheet + * @param {Array<object>} resources: Array of stylesheet resources + * @param {Array<object>} expected: Array of object of the following shape: + * @param {object} expected[] + * @param {object} expected[].styleText: Expected text content of the stylesheet */ async function assertResource(resource, expected) { const styleText = (await getStyleSheetResourceText(resource)).trim(); diff --git a/devtools/shared/commands/resource/tests/head.js b/devtools/shared/commands/resource/tests/head.js @@ -43,12 +43,12 @@ async function _initResourceCommandFromCommands( * * @param {Tab} tab * The browser frontend's tab to connect to. - * @param {Object} options - * @param {Boolean} options.listenForWorkers - * @return {Object} object + * @param {object} options + * @param {boolean} options.listenForWorkers + * @return {object} object * @return {ResourceCommand} object.resourceCommand * The underlying resource command interface. - * @return {Object} object.commands + * @return {object} object.commands * The commands object defined by modules from devtools/shared/commands. * @return {DevToolsClient} object.client * The underlying client instance. @@ -63,10 +63,10 @@ async function initResourceCommand(tab, options) { /** * Instantiate a multi-process ResourceCommand, watching all type of targets. * - * @return {Object} object + * @return {object} object * @return {ResourceCommand} object.resourceCommand * The underlying resource command interface. - * @return {Object} object.commands + * @return {object} object.commands * The commands object defined by modules from devtools/shared/commands. * @return {DevToolsClient} object.client * The underlying client instance. @@ -139,7 +139,7 @@ async function triggerNetworkRequests(browser, commands) { /** * Get the stylesheet text for a given stylesheet resource. * - * @param {Object} styleSheetResource + * @param {object} styleSheetResource * @returns Promise<String> */ async function getStyleSheetResourceText(styleSheetResource) { diff --git a/devtools/shared/commands/script/script-command.js b/devtools/shared/commands/script/script-command.js @@ -17,20 +17,20 @@ class ScriptCommand { /** * Execute a JavaScript expression. * - * @param {String} expression: The code you want to evaluate. - * @param {Object} options: Options for evaluation: - * @param {Object} options.frameActor: a FrameActor ID. The actor holds a reference to + * @param {string} expression: The code you want to evaluate. + * @param {object} options: Options for evaluation: + * @param {object} options.frameActor: a FrameActor ID. The actor holds a reference to * a Debugger.Frame. This option allows you to evaluate the string in the frame * of the given FrameActor. - * @param {String} options.url: the url to evaluate the script as. Defaults to "debugger eval code". + * @param {string} options.url: the url to evaluate the script as. Defaults to "debugger eval code". * @param {TargetFront} options.selectedTargetFront: When passed, the expression will be * evaluated in the context of the target (as opposed to the default, top-level one). - * @param {String} options.selectedNodeActor: A NodeActor ID that may be used by helper + * @param {string} options.selectedNodeActor: A NodeActor ID that may be used by helper * functions that can reference the currently selected node in the Inspector, like $0. - * @param {String} options.selectedObjectActor: the actorID of a given objectActor. + * @param {string} options.selectedObjectActor: the actorID of a given objectActor. * This is used by context menu entries to get a reference to an object, in order * to perform some operation on it (copy it, store it as a global variable, …). - * @param {Number} options.innerWindowID: An optional window id to be used for the evaluation, + * @param {number} options.innerWindowID: An optional window id to be used for the evaluation, * instead of the regular webConsoleActor.evalWindow. * This is used by functions that may want to evaluate in a different window (for * example a non-remote iframe), like getting the elements of a given document. diff --git a/devtools/shared/commands/target-configuration/target-configuration-command.js b/devtools/shared/commands/target-configuration/target-configuration-command.js @@ -77,9 +77,9 @@ class TargetConfigurationCommand { * we won't be using the target configuration actor and report all keys * as not supported. * - * @param {Object} configurationKey + * @param {object} configurationKey * Name of the configuration you would like to set. - * @return {Promise<Boolean>} True, if this configuration can be set via this API. + * @return {Promise<boolean>} True, if this configuration can be set via this API. */ async supports(configurationKey) { if (!this._hasTargetWatcherSupport()) { diff --git a/devtools/shared/commands/target/actions/targets.js b/devtools/shared/commands/target/actions/targets.js @@ -13,7 +13,7 @@ function unregisterTarget(targetFront) { /** * - * @param {String} targetActorID: The actorID of the target we want to select. + * @param {string} targetActorID: The actorID of the target we want to select. */ function selectTarget(targetActorID) { return function ({ dispatch }) { diff --git a/devtools/shared/commands/target/target-command.js b/devtools/shared/commands/target/target-command.js @@ -45,7 +45,7 @@ class TargetCommand extends EventEmitter { * The context to inspector identified by this descriptor. * @param {WatcherFront} watcherFront * If available, a reference to the related Watcher Front. - * @param {Object} commands + * @param {object} commands * The commands object with all interfaces defined from devtools/shared/commands/ */ constructor({ descriptorFront, watcherFront, commands }) { @@ -353,16 +353,16 @@ class TargetCommand extends EventEmitter { * * @param {TargetFront} targetFront * The target that just got destroyed. - * @param {Object} options - * @param {Boolean} [options.isTargetSwitching] + * @param {object} options + * @param {boolean} [options.isTargetSwitching] * To be set to true when this is about the top level target which is being replaced * by a new one. * The passed target should be still the one store in TargetCommand.targetFront * and will be replaced via a call to onTargetAvailable with a new target front. - * @param {Boolean} [options.isModeSwitching] + * @param {boolean} [options.isModeSwitching] * To be set to true when the target was destroyed was called as the result of a * change to the devtools.browsertoolbox.scope pref. - * @param {Boolean} [options.shouldDestroyTargetFront] + * @param {boolean} [options.shouldDestroyTargetFront] * By default, the passed target front will be destroyed. But in some cases like * legacy listeners for service workers we want to keep the front alive. */ @@ -470,9 +470,9 @@ class TargetCommand extends EventEmitter { * - a target type is supported * - or that a custom trait is true * - * @param {String} [targetTypeOrTrait] + * @param {string} [targetTypeOrTrait] * Optional target type or trait. - * @return {Boolean} true if the watcher is available and supports the + * @return {boolean} true if the watcher is available and supports the * optional targetTypeOrTrait */ hasTargetWatcherSupport(targetTypeOrTrait) { @@ -753,8 +753,8 @@ class TargetCommand extends EventEmitter { /** * Listen for the creation and/or destruction of target fronts matching one of the provided types. * - * @param {Object} options - * @param {Array<String>} options.types + * @param {object} options + * @param {Array<string>} options.types * The type of target to listen for. Constant of TargetCommand.TYPES. * @param {Function} options.onAvailable * Mandatory callback fired when a target has been just created or was already available. @@ -935,7 +935,7 @@ class TargetCommand extends EventEmitter { /** * Retrieve all the current target fronts of a given type. * - * @param {Array<String>} types + * @param {Array<string>} types * The types of target to retrieve. Array of TargetCommand.TYPES * @return {Array<TargetFront>} Array of target fronts matching any of the * provided types. @@ -956,7 +956,7 @@ class TargetCommand extends EventEmitter { * Retrieve all the target fronts in the selected target tree (including the selected * target itself). * - * @param {Array<String>} types + * @param {Array<string>} types * The types of target to retrieve. Array of TargetCommand.TYPES * @return {Promise<Array<TargetFront>>} Promise that resolves to an array of target fronts. */ @@ -982,12 +982,12 @@ class TargetCommand extends EventEmitter { /** * For all the target fronts of given types, retrieve all the target-scoped fronts of the given types. * - * @param {Array<String>} targetTypes + * @param {Array<string>} targetTypes * The types of target to iterate over. Constant of TargetCommand.TYPES. - * @param {String} frontType + * @param {string} frontType * The type of target-scoped front to retrieve. It can be "inspector", "console", "thread",... - * @param {Object} options - * @param {Boolean} options.onlyInSelectedTargetTree + * @param {object} options + * @param {boolean} options.onlyInSelectedTargetTree * Set to true to only get the fronts for targets who are in the "targets tree" * of the selected target. */ @@ -1062,7 +1062,7 @@ class TargetCommand extends EventEmitter { * Reload the current top level target. * This only works for targets inheriting from WindowGlobalTarget. * - * @param {Boolean} bypassCache + * @param {boolean} bypassCache * If true, the reload will be forced to bypass any cache. */ async reloadTopLevelTarget(bypassCache = false) { @@ -1093,8 +1093,8 @@ class TargetCommand extends EventEmitter { /** * Navigate the top level document to a new URL. * - * @param {String} url - * @param {Boolean} waitForLoad + * @param {string} url + * @param {boolean} waitForLoad * Default to true and wait for the document to be fully loaded before resolving. * @return Promise * Promise resolved once the navigation has been proceeded by the remote runtime, @@ -1153,7 +1153,7 @@ class TargetCommand extends EventEmitter { /** * Returns true if the top-level frame is the selected one * - * @returns {Boolean} + * @returns {boolean} */ isTopLevelTargetSelected() { return this.selectedTargetFront === this.targetFront; @@ -1162,7 +1162,7 @@ class TargetCommand extends EventEmitter { /** * Returns true if a non top-level frame is the selected one in the iframe picker. * - * @returns {Boolean} + * @returns {boolean} */ isNonTopLevelTargetSelected() { return this.selectedTargetFront !== this.targetFront; diff --git a/devtools/shared/compatibility/compatibility-user-settings.js b/devtools/shared/compatibility/compatibility-user-settings.js @@ -107,7 +107,7 @@ async function getTargetBrowsers() { * Store the list of browser id and status that should be used for checking compatibility * issues. * - * @param {Object[]} browsers + * @param {object[]} browsers * @param {string} browsers[].id: The browser id. Should be one of TARGET_BROWSER_ID * @param {string} browsers[].status: The browser status. Should be one of TARGET_BROWSER_STATUS */ diff --git a/devtools/shared/compatibility/helpers.js b/devtools/shared/compatibility/helpers.js @@ -12,7 +12,7 @@ * For example, if the terms is ["background-color"], * this function returns compatNode["background-color"].__compat. * - * @return {Object} compatibility table + * @return {object} compatibility table * { * description: {String} Description of this compatibility table. * mdn_url: {String} Document in the MDN. diff --git a/devtools/shared/css/color.js b/devtools/shared/css/color.js @@ -53,7 +53,7 @@ const SPECIALVALUES = new Set([ */ class CssColor { /** - * @param {String} colorValue: Any valid color string + * @param {string} colorValue: Any valid color string */ constructor(colorValue) { // Store a lower-cased version of the color to help with format @@ -315,7 +315,7 @@ class CssColor { * Check whether the current color value is in the special list e.g. * transparent or invalid. * - * @return {String|Boolean} + * @return {string | boolean} * - If the current color is a special value e.g. "transparent" then * return the color. * - If the current color is a system value e.g. "accentcolor" then @@ -459,7 +459,7 @@ class CssColor { /** * Check whether the color is fully transparent (alpha === 0). * - * @return {Boolean} True if the color is transparent and valid. + * @return {boolean} True if the color is transparent and valid. */ isTransparent() { return this.getRGBATuple().a === 0; @@ -469,9 +469,9 @@ class CssColor { /** * Convert rgb value to hsl * - * @param {array} rgb + * @param {Array} rgb * Array of rgb values - * @return {array} + * @return {Array} * Array of hsl values. */ function rgbToHsl([r, g, b]) { @@ -514,9 +514,9 @@ function rgbToHsl([r, g, b]) { /** * Convert RGB value to HWB * - * @param {array} rgb + * @param {Array} rgb * Array of RGB values - * @return {array} + * @return {Array} * Array of HWB values. */ function rgbToHwb([r, g, b]) { @@ -540,9 +540,9 @@ function roundTo(number, digits) { * Given a color, classify its type as one of the possible color * units, as known by |CssColor.COLORUNIT|. * - * @param {String} value + * @param {string} value * The color, in any form accepted by CSS. - * @return {String} + * @return {string} * The color classification, one of "rgb", "hsl", "hwb", * "hex", "name", or if no format is recognized, "authored". */ @@ -565,10 +565,10 @@ function classifyColor(value) { /** * A helper function to convert a hex string like "F0C" or "F0C8" to a color. * - * @param {String} name the color string - * @param {Boolean} highResolution Forces returned alpha value to be in the + * @param {string} name the color string + * @param {boolean} highResolution Forces returned alpha value to be in the * range 0 - 255 as opposed to 0.0 - 1.0. - * @return {Object} an object of the form {r, g, b, a}; or null if the + * @return {object} an object of the form {r, g, b, a}; or null if the * name was not a valid color */ function hexToRGBA(name, highResolution) { @@ -652,7 +652,7 @@ function blendColors(foregroundColor, backgroundColor = [255, 255, 255, 1]) { * the background color. * @param {Array} textColor An array with [r,g,b,a] values containing * the text color. - * @return {Number} The calculated luminance. + * @return {number} The calculated luminance. */ function calculateContrastRatio(backgroundColor, textColor) { // Do not modify given colors. diff --git a/devtools/shared/css/lexer.js b/devtools/shared/css/lexer.js @@ -55,9 +55,9 @@ class InspectorCSSParserWrapper { /** * - * @param {String} input: The CSS text to lex - * @param {Object} options - * @param {Boolean} options.trackEOFChars: Set to true if performEOFFixup will be called. + * @param {string} input: The CSS text to lex + * @param {object} options + * @param {boolean} options.trackEOFChars: Set to true if performEOFFixup will be called. */ constructor(input, options = {}) { this.parser = new InspectorCSSParser(input); diff --git a/devtools/shared/debounce.js b/devtools/shared/debounce.js @@ -12,7 +12,7 @@ * The function to debounce * @param {number} wait * The wait period - * @param {Object} scope + * @param {object} scope * The scope to use for func * @return {Function} The debounced function, which has a `cancel` method that the * consumer can call to cancel any pending setTimeout callback. diff --git a/devtools/shared/event-emitter.js b/devtools/shared/event-emitter.js @@ -30,11 +30,11 @@ class EventEmitter { * Registers an event `listener` that is called every time events of * specified `type` is emitted on this instance. * - * @param {String} type + * @param {string} type * The type of event. * @param {Function} listener * The listener that processes the event. - * @param {Object} options + * @param {object} options * @param {AbortSignal} options.signal * The listener will be removed when linked AbortController’s abort() method is called * @returns {Function} @@ -77,7 +77,7 @@ class EventEmitter { * If no `listener` is passed removes all listeners of the given * `type`. If `type` is not passed removes all the listeners of this instance. * - * @param {String} [type] + * @param {string} [type] * The type of event. * @param {Function} [listener] * The listener that processes the event. @@ -129,11 +129,11 @@ class EventEmitter { * of the specified `type` is emitted on this instance. * It returns a Promise resolved once the specified event `type` is emitted. * - * @param {String} type + * @param {string} type * The type of the event. * @param {Function} [listener] * The listener that processes the event. - * @param {Object} options + * @param {object} options * @param {AbortSignal} options.signal * The listener will be removed when linked AbortController’s abort() method is called * @return {Promise} @@ -166,9 +166,9 @@ class EventEmitter { /** * Emit an event of a given `type` on this instance. * - * @param {String} type + * @param {string} type * The type of the event. - * @param {Boolean} async + * @param {boolean} async * If true, this function will wait for each listener completion. * Each listener has to return a promise, which will be awaited for. * @param {Array} args @@ -253,9 +253,9 @@ class EventEmitter { /** * Returns a number of event listeners registered for the given event `type` on this instance. * - * @param {String} type + * @param {string} type * The type of event. - * @return {Number} + * @return {number} * The number of event listeners. */ count(type) { diff --git a/devtools/shared/heapsnapshot/CensusUtils.js b/devtools/shared/heapsnapshot/CensusUtils.js @@ -19,10 +19,10 @@ exports.Visitor = Visitor; /** * The `enter` method is called when a new sub-report is entered in traversal. * - * @param {Object} breakdown + * @param {object} breakdown * The breakdown for the sub-report that is being entered by traversal. * - * @param {Object} report + * @param {object} report * The report generated by the given breakdown. * * @param {any} edge @@ -34,10 +34,10 @@ Visitor.prototype.enter = function () {}; /** * The `exit` method is called when traversal of a sub-report has finished. * - * @param {Object} breakdown + * @param {object} breakdown * The breakdown for the sub-report whose traversal has finished. * - * @param {Object} report + * @param {object} report * The report generated by the given breakdown. * * @param {any} edge @@ -50,10 +50,10 @@ Visitor.prototype.exit = function () {}; * The `count` method is called when leaf nodes (reports whose breakdown is * by: "count") in the report tree are encountered. * - * @param {Object} breakdown + * @param {object} breakdown * The count breakdown for this report. * - * @param {Object} report + * @param {object} report * The report generated by a breakdown by "count". * * @param {any|null} edge @@ -132,10 +132,10 @@ EDGES.filename = function (breakdown, report) { * Get the set of outgoing edges from `report` as specified by the given * breakdown. * - * @param {Object} breakdown + * @param {object} breakdown * The census breakdown. * - * @param {Object} report + * @param {object} report * The census report. */ function getReportEdges(breakdown, report) { @@ -167,10 +167,10 @@ function recursiveWalk(breakdown, edge, report, visitor) { * Walk the given `report` that was generated by taking a census with the * specified `breakdown`. * - * @param {Object} breakdown + * @param {object} breakdown * The census breakdown. * - * @param {Object} report + * @param {object} report * The census report. * * @param {Visitor} visitor @@ -187,7 +187,7 @@ exports.walk = walk; * Return true if the object is a Map, false otherwise. Works with Map objects * from other globals, unlike `instanceof`. * - * @returns {Boolean} + * @returns {boolean} */ function isMap(obj) { return Object.prototype.toString.call(obj) === "[object Map]"; @@ -197,7 +197,7 @@ function isMap(obj) { * A Visitor for computing the difference between the census report being * traversed and the given other census. * - * @param {Object} otherCensus + * @param {object} otherCensus * The other census report. */ function DiffVisitor(otherCensus) { @@ -335,7 +335,7 @@ const basisTotalCount = (exports.basisTotalCount = Symbol("basisTotalCount")); * Get the resulting report of the difference between the traversed census * report and the other census report. * - * @returns {Object} + * @returns {object} * The delta census report. */ DiffVisitor.prototype.results = function () { @@ -358,16 +358,16 @@ DiffVisitor.prototype.results = function () { * contains the number/size of things that are in the `endCensus` that are not * in the `startCensus`. * - * @param {Object} breakdown + * @param {object} breakdown * The breakdown used to generate both census reports. * - * @param {Object} startCensus + * @param {object} startCensus * The first census report. * - * @param {Object} endCensus + * @param {object} endCensus * The second census report. * - * @returns {Object} + * @returns {object} * A delta report mirroring the structure of the two census reports (as * specified by the given breakdown). Has two additional properties: * - {Number} basisTotalBytes: the total number of bytes in the start @@ -407,8 +407,8 @@ const BUCKET = Object.freeze({ by: "bucket" }); * Convert a breakdown whose leaves are { by: "count" } to an identical * breakdown, except with { by: "bucket" } leaves. * - * @param {Object} breakdown - * @returns {Object} + * @param {object} breakdown + * @returns {object} */ exports.countToBucketBreakdown = function (breakdown) { if (typeof breakdown !== "object" || !breakdown) { @@ -468,11 +468,11 @@ GetLeavesVisitor.prototype.leaves = function () { * Given a set of indices of leaves in a pre-order depth-first traversal of the * given census report, return the leaves. * - * @param {Set<Number>} indices - * @param {Object} breakdown - * @param {Object} report + * @param {Set<number>} indices + * @param {object} breakdown + * @param {object} report * - * @returns {Array<Object>} + * @returns {Array<object>} */ exports.getReportLeaves = function (indices, breakdown, report) { const visitor = new GetLeavesVisitor(indices); @@ -484,8 +484,8 @@ exports.getReportLeaves = function (indices, breakdown, report) { * Get a list of the individual node IDs that belong to the census report leaves * of the given indices. * - * @param {Set<Number>} indices - * @param {Object} breakdown + * @param {Set<number>} indices + * @param {object} breakdown * @param {HeapSnapshot} snapshot * * @returns {Array<NodeId>} diff --git a/devtools/shared/heapsnapshot/DominatorTreeNode.js b/devtools/shared/heapsnapshot/DominatorTreeNode.js @@ -141,7 +141,7 @@ LabelAndShallowSizeVisitor.prototype.count = function (breakdown, report) { /** * Get the generated label structure accumulated by this visitor. * - * @returns {Object} + * @returns {object} */ LabelAndShallowSizeVisitor.prototype.label = function () { return this._label; @@ -150,7 +150,7 @@ LabelAndShallowSizeVisitor.prototype.label = function () { /** * Get the shallow size of the node this visitor visited. * - * @returns {Number} + * @returns {number} */ LabelAndShallowSizeVisitor.prototype.shallowSize = function () { return this._shallowSize; @@ -165,11 +165,11 @@ LabelAndShallowSizeVisitor.prototype.shallowSize = function () { * report has only one count leaf that is non-zero. The label structure is the * path in this report from the root to the non-zero count leaf. * - * @param {Number} nodeId + * @param {number} nodeId * @param {HeapSnapshot} snapshot - * @param {Object} breakdown + * @param {object} breakdown * - * @returns {Object} + * @returns {object} * An object with the following properties: * - {Number} shallowSize * - {Object} label @@ -201,9 +201,9 @@ DominatorTreeNode.getLabelAndShallowSize = function ( * * @param {DominatorTree} dominatorTree * @param {HeapSnapshot} snapshot - * @param {Object} breakdown - * @param {Number} maxDepth - * @param {Number} maxSiblings + * @param {object} breakdown + * @param {number} maxDepth + * @param {number} maxSiblings * * @returns {DominatorTreeNode} */ @@ -256,7 +256,7 @@ DominatorTreeNode.partialTraversal = function ( * @param {DominatorTreeNode} tree * @param {Array<NodeId>} path * @param {Array<DominatorTreeNode>} newChildren - * @param {Boolean} moreChildrenAvailable + * @param {boolean} moreChildrenAvailable * * @returns {DominatorTreeNode} */ @@ -332,10 +332,10 @@ DominatorTreeNode.getNodeByIdAlongPath = function (id, tree, path) { * and populate each node's `shortestPaths` property with them in place. * * @param {HeapSnapshot} snapshot - * @param {Object} breakdown + * @param {object} breakdown * @param {NodeId} start * @param {Array<DominatorTreeNode>} treeNodes - * @param {Number} maxNumPaths + * @param {number} maxNumPaths */ DominatorTreeNode.attachShortestPaths = function ( snapshot, diff --git a/devtools/shared/heapsnapshot/HeapAnalysesClient.js b/devtools/shared/heapsnapshot/HeapAnalysesClient.js @@ -43,7 +43,7 @@ HeapAnalysesClient.prototype.destroy = function () { * path. This is a prerequisite for asking the worker to perform various * analyses on a heap snapshot. * - * @param {String} snapshotFilePath + * @param {string} snapshotFilePath * * @returns Promise * The promise is fulfilled if the heap snapshot is successfully @@ -59,7 +59,7 @@ HeapAnalysesClient.prototype.readHeapSnapshot = function (snapshotFilePath) { * Tell the worker to delete all references to the snapshot and dominator trees * linked to the provided snapshot file path. * - * @param {String} snapshotFilePath + * @param {string} snapshotFilePath * @return Promise<undefined> */ HeapAnalysesClient.prototype.deleteHeapSnapshot = function (snapshotFilePath) { @@ -70,9 +70,9 @@ HeapAnalysesClient.prototype.deleteHeapSnapshot = function (snapshotFilePath) { * Request the creation time given a snapshot file path. Returns `null` * if snapshot does not exist. * - * @param {String} snapshotFilePath + * @param {string} snapshotFilePath * The path to the snapshot. - * @return {Number?} + * @return {number?} * The unix timestamp of the creation time of the snapshot, or null if * snapshot does not exist. */ @@ -87,14 +87,14 @@ HeapAnalysesClient.prototype.getCreationTime = function (snapshotFilePath) { * given path. The heap snapshot at the given path must have already been read * into memory by the worker (see `readHeapSnapshot`). * - * @param {String} snapshotFilePath + * @param {string} snapshotFilePath * - * @param {Object} censusOptions + * @param {object} censusOptions * A structured-cloneable object specifying the requested census's * breakdown. See the "takeCensus" section of * `js/src/doc/Debugger/Debugger.Memory.md` for detailed documentation. * - * @param {Object} requestOptions + * @param {object} requestOptions * An object specifying options of this worker request. * - {Boolean} asTreeNode * Whether or not the census is returned as a CensusTreeNode, @@ -133,7 +133,7 @@ HeapAnalysesClient.prototype.takeCensus = function ( * Get the individual nodes that correspond to the given census report leaf * indices. * - * @param {Object} opts + * @param {object} opts * An object with the following properties: * - {DominatorTreeId} dominatorTreeId: The id of the dominator tree. * - {Set<Number>} indices: The indices of the census report leaves we @@ -146,7 +146,7 @@ HeapAnalysesClient.prototype.takeCensus = function ( * - {Number} maxIndividuals: The maximum number of individual nodes to * return. * - * @returns {Promise<Object>} + * @returns {Promise<object>} * A promise of an object with the following properties: * - {Array<DominatorTreeNode>} nodes: An array of `DominatorTreeNode`s * with their shortest paths attached, and without any dominator tree @@ -162,18 +162,18 @@ HeapAnalysesClient.prototype.getCensusIndividuals = function (opts) { * paths and then return the difference between them. Both heap snapshots must * have already been read into memory by the worker (see `readHeapSnapshot`). * - * @param {String} firstSnapshotFilePath + * @param {string} firstSnapshotFilePath * The first snapshot file path. * - * @param {String} secondSnapshotFilePath + * @param {string} secondSnapshotFilePath * The second snapshot file path. * - * @param {Object} censusOptions + * @param {object} censusOptions * A structured-cloneable object specifying the requested census's * breakdown. See the "takeCensus" section of * `js/src/doc/Debugger/Debugger.Memory.md` for detailed documentation. * - * @param {Object} requestOptions + * @param {object} requestOptions * An object specifying options for this request. * - {Boolean} asTreeNode * Whether the resulting delta report should be converted to a census @@ -214,7 +214,7 @@ HeapAnalysesClient.prototype.takeCensusDiff = function ( * Compute the dominator tree of the heap snapshot loaded from the given file * path. Returns the id of the computed dominator tree. * - * @param {String} snapshotFilePath + * @param {string} snapshotFilePath * * @returns {Promise<DominatorTreeId>} */ @@ -227,7 +227,7 @@ HeapAnalysesClient.prototype.computeDominatorTree = function ( /** * Get the initial, partial view of the dominator tree with the given id. * - * @param {Object} opts + * @param {object} opts * An object specifying options for this request. * - {DominatorTreeId} dominatorTreeId * The id of the dominator tree. @@ -251,7 +251,7 @@ HeapAnalysesClient.prototype.getDominatorTree = function (opts) { /** * Get a subset of a nodes children in the dominator tree. * - * @param {Object} opts + * @param {object} opts * An object specifying options for this request. * - {DominatorTreeId} dominatorTreeId * The id of the dominator tree. @@ -268,7 +268,7 @@ HeapAnalysesClient.prototype.getDominatorTree = function (opts) { * - {Number} maxRetainingPaths * The maximum number of retaining paths to find for each node. * - * @returns {Promise<Object>} + * @returns {Promise<object>} * A promise of an object with the following properties: * - {Array<DominatorTreeNode>} nodes * The requested nodes that are immediately dominated by the node diff --git a/devtools/shared/heapsnapshot/HeapSnapshotFileUtils.js b/devtools/shared/heapsnapshot/HeapSnapshotFileUtils.js @@ -53,7 +53,7 @@ function isValidSnapshotFileId(snapshotId) { /** * Get the file path for the given snapshot id. * - * @param {String} snapshotId + * @param {string} snapshotId * * @returns String | null */ diff --git a/devtools/shared/heapsnapshot/census-tree-node.js b/devtools/shared/heapsnapshot/census-tree-node.js @@ -25,7 +25,7 @@ let censusTreeNodeIdCounter = 0; * Return true if the given object is a SavedFrame stack object, false otherwise. * * @param {any} obj - * @returns {Boolean} + * @returns {boolean} */ function isSavedFrame(obj) { return Object.prototype.toString.call(obj) === "[object SavedFrame]"; @@ -70,7 +70,7 @@ CensusTreeNodeCacheValue.prototype = null; * The SavedFrame object we would like to lookup in or insert into a * CensusTreeNodeCache. * - * @returns {String} + * @returns {string} * The unique string that can be used as a key in a CensusTreeNodeCache. */ CensusTreeNodeCache.hashFrame = function (frame) { @@ -86,7 +86,7 @@ CensusTreeNodeCache.hashFrame = function (frame) { * @param {CensusTreeNode} node * The node we would like to lookup in or insert into a cache. * - * @returns {String} + * @returns {string} * The unique string that can be used as a key in a CensusTreeNodeCache. */ CensusTreeNodeCache.hashNode = function (node) { @@ -182,20 +182,20 @@ function getArrayOfFrames(stack) { * Given an `edge` to a sub-`report` whose structure is described by * `breakdown`, create a CensusTreeNode tree. * - * @param {Object} breakdown + * @param {object} breakdown * The breakdown specifying the structure of the given report. * - * @param {Object} report + * @param {object} report * The census report. * - * @param {null|String|SavedFrame} edge + * @param {null | string | SavedFrame} edge * The edge leading to this report from the parent report. * * @param {CensusTreeNodeCache} cache * The cache of CensusTreeNodes we have already made for the siblings of * the node being created. The existing nodes are reused when possible. * - * @param {Object} outParams + * @param {object} outParams * The return values are attached to this object after this function * returns. Because we create a CensusTreeNode for each frame in a * SavedFrame stack edge, there may multiple nodes per sub-report. @@ -405,7 +405,7 @@ CensusTreeNodeVisitor.prototype.root = function () { /** * Create a single, uninitialized CensusTreeNode. * - * @param {null|String|SavedFrame} name + * @param {null | string | SavedFrame} name */ function CensusTreeNode(name) { // Display name for this CensusTreeNode. Either null, a string, or a @@ -468,7 +468,7 @@ CensusTreeNode.prototype = null; * @param {CensusTreeNode} node1 * @param {CensusTreeNode} node2 * - * @returns {Number} + * @returns {number} * A number suitable for using with Array.prototype.sort. */ function compareByTotal(node1, node2) { @@ -487,7 +487,7 @@ function compareByTotal(node1, node2) { * @param {CensusTreeNode} node1 * @param {CensusTreeNode} node2 * - * @returns {Number} + * @returns {number} * A number suitable for using with Array.prototype.sort. */ function compareBySelf(node1, node2) { @@ -665,7 +665,7 @@ function filter(tree, predicate) { * Given a filter string, return a predicate function that takes a node and * returns true iff the node matches the filter. * - * @param {String} filterString + * @param {string} filterString * @returns {Function} */ function makeFilterPredicate(filterString) { @@ -703,13 +703,13 @@ function makeFilterPredicate(filterString) { * parent: <?Number> * } * - * @param {Object} breakdown + * @param {object} breakdown * The breakdown used to generate the census report. * - * @param {Object} report + * @param {object} report * The census report generated with the specified breakdown. * - * @param {Object} options + * @param {object} options * Configuration options. * - invert: Whether to invert the resulting tree or not. Defaults to * false, ie uninverted. diff --git a/devtools/shared/heapsnapshot/shortest-paths.js b/devtools/shared/heapsnapshot/shortest-paths.js @@ -14,7 +14,7 @@ * An array of paths to `target`, as returned by * `HeapSnapshot.computeShortestPaths`. * - * @returns {Object} + * @returns {object} * An object with two properties: * - edges: An array of unique objects of the form: * { diff --git a/devtools/shared/heapsnapshot/tests/xpcshell/head_heapsnapshot.js b/devtools/shared/heapsnapshot/tests/xpcshell/head_heapsnapshot.js @@ -153,7 +153,7 @@ function readHeapSnapshot(filePath) { * directory, read it back as a HeapSnapshot instance, and then take a census of * the heap snapshot's serialized heap graph with the provided census options. * - * @param {Object|undefined} censusOptions + * @param {object | undefined} censusOptions * Options that should be passed through to the takeCensus method. See * js/src/doc/Debugger/Debugger.Memory.md for details. * @@ -161,7 +161,7 @@ function readHeapSnapshot(filePath) { * If a Debugger object is given, only serialize the subgraph covered by * the Debugger's debuggees. If null, serialize the whole heap graph. * - * @param {String} fileName + * @param {string} fileName * The file name to save the heap snapshot's core dump file to, within * the current directory. * @@ -228,16 +228,16 @@ function savedFrameReplacer(key, val) { * Assert that creating a CensusTreeNode from the given `report` with the * specified `breakdown` creates the given `expected` CensusTreeNode. * - * @param {Object} breakdown + * @param {object} breakdown * The census breakdown. * - * @param {Object} report + * @param {object} report * The census report. * - * @param {Object} expected + * @param {object} expected * The expected CensusTreeNode result. * - * @param {Object} options + * @param {object} options * The options to pass through to `censusReportToCensusTreeNode`. */ function compareCensusViewData(breakdown, report, expected, options) { @@ -347,16 +347,16 @@ function assertStructurallyEquivalent(actual, expected, path = "root") { * Assert that creating a diff of the `first` and `second` census reports * creates the `expected` delta-report. * - * @param {Object} breakdown + * @param {object} breakdown * The census breakdown. * - * @param {Object} first + * @param {object} first * The first census report. * - * @param {Object} second + * @param {object} second * The second census report. * - * @param {Object} expected + * @param {object} expected * The expected delta-report. */ function assertDiff(breakdown, first, second, expected) { @@ -376,10 +376,10 @@ function assertDiff(breakdown, first, second, expected) { * Assert that creating a label and getting a shallow size from the given node * description with the specified breakdown is as expected. * - * @param {Object} breakdown - * @param {Object} givenDescription - * @param {Number} expectedShallowSize - * @param {Object} expectedLabel + * @param {object} breakdown + * @param {object} givenDescription + * @param {number} expectedShallowSize + * @param {object} expectedLabel */ function assertLabelAndShallowSize( breakdown, @@ -414,7 +414,7 @@ let TEST_NODE_ID_COUNTER = 0; * Create a mock DominatorTreeNode for testing, with sane defaults. Override any * property by providing it on `opts`. Optionally pass child nodes as well. * - * @param {Object} opts + * @param {object} opts * @param {Array<DominatorTreeNode>?} children * * @returns {DominatorTreeNode} diff --git a/devtools/shared/indentation.js b/devtools/shared/indentation.js @@ -14,7 +14,7 @@ const DETECT_INDENT_MAX_LINES = 500; * Get the number of indentation units to use to indent a "block" * and a boolean indicating whether indentation must be done using tabs. * - * @return {Object} an object of the form {indentUnit, indentWithTabs}. + * @return {object} an object of the form {indentUnit, indentWithTabs}. * |indentUnit| is the number of indentation units to use * to indent a "block". * |indentWithTabs| is a boolean which is true if indentation @@ -30,7 +30,7 @@ function getTabPrefs() { * Get the indentation to use in an editor, or return false if the user has * asked for the indentation to be guessed from some text. * - * @return {false | Object} + * @return {false | object} * Returns false if the "detect indentation" pref is set. * If the pref is not set, returns an object of the same * form as returned by getTabPrefs. @@ -53,7 +53,7 @@ function getIndentationFromPrefs() { * the range of text lines to examine, and |callback| is a function * to be called with the text of each line. * - * @return {Object} an object of the form {indentUnit, indentWithTabs}. + * @return {object} an object of the form {indentUnit, indentWithTabs}. * |indentUnit| is the number of indentation units to use * to indent a "block". * |indentWithTabs| is a boolean which is true if indentation @@ -79,8 +79,8 @@ function getIndentationFromIteration(iterFunc) { * A wrapper for @see getIndentationFromIteration which computes the * indentation of a given string. * - * @param {String} string the input text - * @return {Object} an object of the same form as returned by + * @param {string} string the input text + * @return {object} an object of the same form as returned by * getIndentationFromIteration */ function getIndentationFromString(string) { diff --git a/devtools/shared/inspector/css-logic.js b/devtools/shared/inspector/css-logic.js @@ -92,7 +92,7 @@ exports.CSSAtRuleClassNameType = { * Get Rule type as human-readable string (ex: "@media", "@container", …) * * @param {CSSRule} cssRule - * @returns {String} + * @returns {string} */ exports.getCSSAtRuleTypeName = function (cssRule) { const ruleClassName = ChromeUtils.getClassName(cssRule); @@ -107,9 +107,9 @@ exports.getCSSAtRuleTypeName = function (cssRule) { /** * Lookup a l10n string in the shared styleinspector string bundle. * - * @param {String} name + * @param {string} name * The key to lookup. - * @returns {String} A localized version of the given key. + * @returns {string} A localized version of the given key. */ exports.l10n = name => styleInspectorL10N.getStr(name); exports.l10nFormatStr = (name, ...args) => @@ -241,17 +241,17 @@ function getLineCountInComments(text) { * is an object that looks like this: * * { - * original: {line: {Number}, column: {Number}}, - * generated: {line: {Number}, column: {Number}}, + * original: {line: {number}, column: {number}}, + * generated: {line: {number}, column: {number}}, * } * - * @param {String} text + * @param {string} text * The CSS source to prettify. - * @param {Number} ruleCount + * @param {number} ruleCount * The number of CSS rules expected in the CSS source. * Set to null to force the text to be pretty-printed. * - * @return {Object} + * @return {object} * Object with the prettified source and source mappings. * { * result: {String} // Prettified source @@ -554,7 +554,7 @@ exports.prettifyCSS = prettifyCSS; * (the parent of the anonymous node), along with which pseudo element * it was. Otherwise, return the node itself. * - * @returns {Object} + * @returns {object} * - {DOMNode} node: The non-anonymous node * - {string|null} pseudo: The label representing the anonymous node * (e.g. '::marker', '::before', '::after', '::view-transition', @@ -871,8 +871,8 @@ var IS_VARIABLE_TOKEN = new RegExp(`^--(${VALID_CHAR})*$`, "i"); /** * Check that this is a CSS variable. * - * @param {String} input - * @return {Boolean} + * @param {string} input + * @return {boolean} */ function isCssVariable(input) { return !!input.match(IS_VARIABLE_TOKEN); diff --git a/devtools/shared/l10n.js b/devtools/shared/l10n.js @@ -28,9 +28,9 @@ const getNumberFormatter = function (decimals) { * Memoized getter for properties files that ensures a given url is only required and * parsed once. * - * @param {String} url + * @param {string} url * The URL of the properties file to parse. - * @return {Object} parsed properties mapped in an object. + * @return {object} parsed properties mapped in an object. */ function getProperties(url) { if (!propertiesMap[url]) { diff --git a/devtools/shared/layout/dom-matrix-2d.js b/devtools/shared/layout/dom-matrix-2d.js @@ -8,10 +8,10 @@ * Returns a matrix for the scaling given. * Calling `scale()` or `scale(1) returns a new identity matrix. * - * @param {Number} [sx = 1] + * @param {number} [sx = 1] * the abscissa of the scaling vector. * If unspecified, it will equal to `1`. - * @param {Number} [sy = sx] + * @param {number} [sy = sx] * The ordinate of the scaling vector. * If not present, its default value is `sx`, leading to a uniform scaling. * @return {Array} @@ -24,10 +24,10 @@ exports.scale = scale; * Returns a matrix for the translation given. * Calling `translate()` or `translate(0) returns a new identity matrix. * - * @param {Number} [tx = 0] + * @param {number} [tx = 0] * The abscissa of the translating vector. * If unspecified, it will equal to `0`. - * @param {Number} [ty = tx] + * @param {number} [ty = tx] * The ordinate of the translating vector. * If unspecified, it will equal to `tx`. * @return {Array} @@ -50,7 +50,7 @@ exports.reflectAboutY = reflectAboutY; * Returns a matrix for the rotation given. * Calling `rotate()` or `rotate(0)` returns a new identity matrix. * - * @param {Number} [angle = 0] + * @param {number} [angle = 0] * The angle, in radians, for which to return a corresponding rotation matrix. * If unspecified, it will equal `0`. * @return {Array} @@ -121,7 +121,7 @@ exports.apply = apply; * * @param {Array} M * The matrix to check - * @return {Boolean} + * @return {boolean} * `true` if the matrix passed is a identity matrix, `false` otherwise. */ const isIdentity = M => @@ -145,7 +145,7 @@ exports.isIdentity = isIdentity; * The first vector, serving as the "x axis" of the coordinate system. * @param {Array} v * The second vector, serving as the "y axis" of the coordinate system. - * @return {Object} + * @return {object} * { basis, invertedBasis, uLength, vLength } * basis and invertedBasis are the change of basis matrices. uLength and * vLength are the lengths of u and v. @@ -224,10 +224,10 @@ exports.getNodeTransformationMatrix = getNodeTransformationMatrix; * Returns the matrix to rotate, translate, and reflect (if needed) from the element's * top-left origin into the actual writing mode and text direction applied to the element. * - * @param {Object} size + * @param {object} size * An element's untransformed content `width` and `height` (excluding any margin, * borders, or padding). - * @param {Object} style + * @param {object} style * The computed `writingMode` and `direction` properties for the element. * @return {Array} * The matrix with adjustments for writing mode and text direction, if any. @@ -288,7 +288,7 @@ exports.getWritingModeMatrix = getWritingModeMatrix; * * @param {Array} M * The matrix in this module's 9 element format. - * @return {String} + * @return {string} * The matching 6 element CSS transform function. */ function getCSSMatrixTransform(M) { diff --git a/devtools/shared/layout/utils.js b/devtools/shared/layout/utils.js @@ -39,7 +39,7 @@ exports.setIgnoreLayoutChanges = (...args) => * * @param {DOMWindow} boundaryWindow * @param {DOMWindow} win - * @return {Boolean} + * @return {boolean} */ function isWindowIncluded(boundaryWindow, win) { if (win === boundaryWindow) { @@ -132,10 +132,10 @@ exports.getFrameOffsets = getFrameOffsets; * @param {DOMNode} node * The node for which we are to get the box model region * quads. - * @param {String} region + * @param {string} region * The box model region to return: "content", "padding", "border" or * "margin". - * @param {Object} [options.ignoreZoom=false] + * @param {object} [options.ignoreZoom=false] * Ignore zoom used in the context of e.g. canvas. * @return {Array} * An array of objects that have the same structure as quads returned by @@ -225,7 +225,7 @@ exports.getAdjustedQuads = getAdjustedQuads; * a DOM element to get the bounds for * @param {DOMWindow} contentWindow * the content window holding the node - * @return {Object} + * @return {object} * A rect object with the {top, left, width, height} properties */ function getRect(boundaryWindow, node, contentWindow) { @@ -279,7 +279,7 @@ exports.getRect = getRect; * The window where to stop to iterate. If `null` is given, the top * window is used. * @param {DOMNode} node - * @return {Object} + * @return {object} * An object with p1,p2,p3,p4 properties being {x,y} objects */ function getNodeBounds(boundaryWindow, node) { @@ -401,7 +401,7 @@ function getFrameContentOffset(frame) { * and attached to the window. * * @param {DOMNode} node - * @return {Boolean} + * @return {boolean} */ function isNodeConnected(node) { if (!node.ownerDocument || !node.ownerDocument.defaultView) { @@ -424,7 +424,7 @@ exports.isNodeConnected = isNodeConnected; * Determine whether a node is a template element. * * @param {DOMNode} node - * @return {Boolean} + * @return {boolean} */ function isTemplateElement(node) { return ( @@ -437,7 +437,7 @@ exports.isTemplateElement = isTemplateElement; * Determine whether a node is a shadow root. * * @param {DOMNode} node - * @return {Boolean} + * @return {boolean} */ const isShadowRoot = node => node.containingShadowRoot == node; exports.isShadowRoot = isShadowRoot; @@ -446,7 +446,7 @@ exports.isShadowRoot = isShadowRoot; * Gets the shadow root mode (open or closed). * * @param {DOMNode} node - * @return {String|null} + * @return {string | null} */ function getShadowRootMode(node) { return isShadowRoot(node) ? node.mode : null; @@ -458,7 +458,7 @@ exports.getShadowRootMode = getShadowRootMode; * attached to itself. * * @param {DOMNode} node - * @return {Boolean} + * @return {boolean} */ function isShadowHost(node) { const shadowRoot = node.openOrClosedShadowRoot; @@ -472,7 +472,7 @@ exports.isShadowHost = isShadowHost; * still considered to be the "host" element, and we need to walk them differently. * * @param {DOMNode} node - * @return {Boolean} + * @return {boolean} */ function isDirectShadowHostChild(node) { // native anonymous elements (which includes pseudo elements) are always part of the @@ -492,7 +492,7 @@ exports.isDirectShadowHostChild = isDirectShadowHostChild; * @param {DOMNode|DOMWindow} * The node for which the zoom factor should be calculated, or its * owner window. - * @return {Number} + * @return {number} */ function getCurrentZoom(node) { const win = getWindowFor(node); @@ -514,7 +514,7 @@ exports.getCurrentZoom = getCurrentZoom; * @param {DOMNode|DOMWindow} * The node for which the zoom factor should be calculated, or its * owner window. - * @return {Number} + * @return {number} */ function getDisplayPixelRatio(node) { const win = getWindowFor(node); @@ -525,7 +525,7 @@ exports.getDisplayPixelRatio = getDisplayPixelRatio; /** * Returns the window's dimensions for the `window` given. * - * @return {Object} An object with `width` and `height` properties, representing the + * @return {object} An object with `width` and `height` properties, representing the * number of pixels for the document's size. */ function getWindowDimensions(window) { @@ -552,7 +552,7 @@ exports.getWindowDimensions = getWindowDimensions; /** * Returns the viewport's dimensions for the `window` given. * - * @return {Object} An object with `width` and `height` properties, representing the + * @return {object} An object with `width` and `height` properties, representing the * number of pixels for the viewport's size. */ function getViewportDimensions(window) { @@ -597,8 +597,8 @@ function getWindowFor(node) { * `window` given. * * @param {DOMWindow} window - * @param {String} url - * @param {String} [type="agent"] + * @param {string} url + * @param {string} [type="agent"] */ function loadSheet(window, url, type = "agent") { if (!(type in SHEET_TYPE)) { @@ -619,8 +619,8 @@ exports.loadSheet = loadSheet; * style sheets of the document. The removal takes effect immediately. * * @param {DOMWindow} window - * @param {String} url - * @param {String} [type="agent"] + * @param {string} url + * @param {string} [type="agent"] */ function removeSheet(window, url, type = "agent") { if (!(type in SHEET_TYPE)) { @@ -641,7 +641,7 @@ exports.removeSheet = removeSheet; * * @param {DOMNode} node * The node for which the DOMQuad is to be returned. - * @param {String} region + * @param {string} region * The box model region to return: "content", "padding", "border" or * "margin". * @return {DOMQuad} @@ -724,11 +724,11 @@ exports.getUntransformedQuad = getUntransformedQuad; * * @param {DOMNode} node * The node for which the absolute scroll offsets should be calculated. - * @return {Object} object + * @return {object} object * An object containing scrollTop and scrollLeft values. - * @return {Number} object.scrollLeft + * @return {number} object.scrollLeft * The total scrollLeft values of the node and all of its ancestors. - * @return {Number} object.scrollTop + * @return {number} object.scrollTop * The total scrollTop values of the node and all of its ancestors. */ function getAbsoluteScrollOffsetsForNode(node) { @@ -767,7 +767,7 @@ exports.getAbsoluteScrollOffsetsForNode = getAbsoluteScrollOffsetsForNode; * Check if the provided node is a <frame> or <iframe> element. * * @param {DOMNode} node - * @returns {Boolean} + * @returns {boolean} */ function isFrame(node) { const className = ChromeUtils.getClassName(node); @@ -778,7 +778,7 @@ function isFrame(node) { * Check if the provided node is representing a remote <browser> element. * * @param {DOMNode} node - * @return {Boolean} + * @return {boolean} */ function isRemoteBrowserElement(node) { return ( @@ -798,7 +798,7 @@ exports.isRemoteBrowserElement = isRemoteBrowserElement; * a different origin document. * * @param {DOMNode} node - * @return {Boolean} + * @return {boolean} */ function isRemoteFrame(node) { if (isFrame(node)) { @@ -818,7 +818,7 @@ exports.isRemoteFrame = isRemoteFrame; * * @param {BrowsingContextTargetActor} targetActor * @param {DOMNode} node - * @returns {Boolean} + * @returns {boolean} */ function isFrameWithChildTarget(targetActor, node) { // If the iframe is blocked because of CSP, it won't have a document (and no associated targets) @@ -835,7 +835,7 @@ exports.isFrameWithChildTarget = isFrameWithChildTarget; * Check if the provided node is representing a frame that is blocked by CSP. * * @param {DOMNode} node - * @returns {Boolean} + * @returns {boolean} */ function isFrameBlockedByCSP(node) { if (!isFrame(node)) { diff --git a/devtools/shared/loader/browser-loader.sys.mjs b/devtools/shared/loader/browser-loader.sys.mjs @@ -241,15 +241,15 @@ BrowserLoaderBuilder.prototype = { * Several getters can be defined at once by providing an array of * properties and enabling destructuring. * - * @param { Object } obj + * @param {object} obj * The object to define the property on. - * @param { String | Array<String> } properties + * @param {string | Array<string>} properties * String: Name of the property for the getter. * Array<String>: When destructure is true, properties can be an array of * strings to create several getters at once. - * @param { String } module + * @param {string} module * The module path. - * @param { Boolean } destructure + * @param {boolean} destructure * Pass true if the property name is a member of the module's exports. */ lazyRequireGetter(obj, properties, module, destructure) { diff --git a/devtools/shared/loader/builtin-modules.js b/devtools/shared/loader/builtin-modules.js @@ -77,15 +77,15 @@ function defineLazyServiceGetter(object, name, contract, interfaceName) { * Several getters can be defined at once by providing an array of * properties and enabling destructuring. * - * @param { Object } obj + * @param {object} obj * The object to define the property on. - * @param { String | Array<String> } properties + * @param {string | Array<string>} properties * String: Name of the property for the getter. * Array<String>: When destructure is true, properties can be an array of * strings to create several getters at once. - * @param { String } module + * @param {string} module * The module path. - * @param { Boolean } destructure + * @param {boolean} destructure * Pass true if the property name is a member of the module's exports. */ function lazyRequireGetter(obj, properties, module, destructure) { diff --git a/devtools/shared/natural-sort.js b/devtools/shared/natural-sort.js @@ -68,16 +68,16 @@ function tryParseDate(str) { * Sort numbers, strings, IP Addresses, Dates, Filenames, version numbers etc. * "the way humans do." * - * @param {Object} a + * @param {object} a * Passed in by Array.sort(a, b) - * @param {Object} b + * @param {object} b * Passed in by Array.sort(a, b) - * @param {String} sessionString + * @param {string} sessionString * Client-side value of storage-expires-session l10n string. * Since this function can be called from both the client and the server, * and given that client and server might have different locale, we can't compute * the localized string directly from here. - * @param {Boolean} insensitive + * @param {boolean} insensitive * Should the search be case insensitive? */ // eslint-disable-next-line complexity diff --git a/devtools/shared/network-observer/ChannelMap.sys.mjs b/devtools/shared/network-observer/ChannelMap.sys.mjs @@ -47,7 +47,7 @@ export class ChannelMap { * WeakMap from nsIChannel instances to objects which encapsulate ChannelMap * values with the following structure: * - * @property {Object} value + * @property {object} value * The actual value stored in this ChannelMap entry, which should relate * to this channel. * @property {WeakRef} ref @@ -92,7 +92,7 @@ export class ChannelMap { * @param {nsIChannel} channel * The key to delete from the ChannelMap. * - * @return {Object|null} + * @return {object | null} * The value held for the provided channel. * Null if the channel did not match any known key. */ @@ -111,7 +111,7 @@ export class ChannelMap { * * @param {nsIChannel} channel * The key of the entry to add or update. - * @param {Object} value + * @param {object} value * The value to add or update. */ set(channel, value) { diff --git a/devtools/shared/network-observer/NetworkObserver.sys.mjs b/devtools/shared/network-observer/NetworkObserver.sys.mjs @@ -99,7 +99,7 @@ const HTTP_DOWNLOAD_ACTIVITIES = [ * routed to the remote Web Console. * * @constructor - * @param {Object} options + * @param {object} options * @param {Function(nsIChannel): boolean} options.ignoreChannelFunction * This function will be called for every detected channel to decide if it * should be monitored or not. @@ -181,7 +181,7 @@ export class NetworkObserver { * Network response bodies are piped through a buffer of the given size * (in bytes). * - * @type {Number} + * @type {number} */ #responsePipeSegmentSize = Services.prefs.getIntPref( "network.buffer.cache.size" @@ -201,7 +201,7 @@ export class NetworkObserver { /** * Throttling configuration, see constructor of NetworkThrottleManager * - * @type {Object} + * @type {object} */ #throttleData = null; /** diff --git a/devtools/shared/network-observer/NetworkOverride.sys.mjs b/devtools/shared/network-observer/NetworkOverride.sys.mjs @@ -39,7 +39,7 @@ function readFile(file) { * * @param {nsIHttpChannel} channel * The request to replace content for. - * @param {String} path + * @param {string} path * The absolute path to the local file to read content from. */ function overrideChannelWithFilePath(channel, path) { diff --git a/devtools/shared/network-observer/NetworkResponseListener.sys.mjs b/devtools/shared/network-observer/NetworkResponseListener.sys.mjs @@ -33,7 +33,7 @@ ChromeUtils.defineESModuleGetters( * nsitraceablechannel-intercept-http-traffic/ * * @constructor - * @param {Object} httpActivity + * @param {object} httpActivity * HttpActivity object associated with this request. See NetworkObserver * more information. * @param {object} options @@ -53,7 +53,7 @@ export class NetworkResponseListener { * The compressed and encoded response body size. Will progressively increase * until the full response is received. * - * @type {Number} + * @type {number} */ #bodySize = 0; /** @@ -87,7 +87,7 @@ export class NetworkResponseListener { /** * See constructor argument of the same name. * - * @type {Object} + * @type {object} */ #httpActivity; /** @@ -107,13 +107,13 @@ export class NetworkResponseListener { * Offset for the onDataAvailable calls where we pass the data from our pipe * to the converter. * - * @type {Number} + * @type {number} */ #offset = 0; /** * The received response body size. * - * @type {Number} + * @type {number} */ #receivedBodySize = 0; /** @@ -144,7 +144,7 @@ export class NetworkResponseListener { * Is true after the events which should be added at the start of a response * are added. This is only used for overridden requests. * - * @type {Boolean} + * @type {boolean} */ #sentStartEvents = false; /** @@ -170,7 +170,7 @@ export class NetworkResponseListener { * Backup for existing notificationCallbacks set on the monitored channel. * Initialized in the constructor. * - * @type {Object} + * @type {object} */ #wrappedNotificationCallbacks; diff --git a/devtools/shared/network-observer/NetworkThrottleManager.sys.mjs b/devtools/shared/network-observer/NetworkThrottleManager.sys.mjs @@ -107,9 +107,9 @@ class NetworkThrottleListener { * Allow some buffered data from this object to be forwarded to this * object's originalListener. * - * @param {Number} bytesPermitted The maximum number of bytes + * @param {number} bytesPermitted The maximum number of bytes * permitted to be sent. - * @return {Object} an object of the form {length, done}, where + * @return {object} an object of the form {length, done}, where * |length| is the number of bytes actually forwarded, and * |done| is a boolean indicating whether this particular * request has been completed. (A NetworkThrottleListener @@ -420,7 +420,7 @@ class NetworkThrottleQueue { * Construct a new object that can be used to throttle the network for * a group of related network requests. * - * @param {Object} An object with the following attributes: + * @param {object} An object with the following attributes: * latencyMean {Number} Mean latency in milliseconds. * latencyMax {Number} Maximum latency in milliseconds. * downloadBPSMean {Number} Mean bytes per second for downloads. diff --git a/devtools/shared/network-observer/NetworkTimings.sys.mjs b/devtools/shared/network-observer/NetworkTimings.sys.mjs @@ -12,9 +12,9 @@ export const NetworkTimings = new (class { * timings stored for each activity notification. The HAR timing information * is constructed based on these lower level data. * - * @param {Object} httpActivity + * @param {object} httpActivity * The HTTP activity object we are working with. - * @return {Object} + * @return {object} * This object holds three properties: * - {Object} offsets: the timings computed as offsets from the initial * request start time. @@ -173,7 +173,7 @@ export const NetworkTimings = new (class { * For some requests such as cached or data: URI requests, we don't have * access to any timing information so all timings should be 0. * - * @return {Object} + * @return {object} * A timings object (@see extractHarTimings), with all values set to 0. */ getEmptyHARTimings() { diff --git a/devtools/shared/network-observer/NetworkUtils.sys.mjs b/devtools/shared/network-observer/NetworkUtils.sys.mjs @@ -218,7 +218,7 @@ function isPreloadRequest(channel) { * Get the channel cause details. * * @param {nsIChannel} channel - * @returns {Object} + * @returns {object} * - loadingDocumentUri {string} uri of the document which created the * channel * - type {string} cause type as string @@ -303,7 +303,7 @@ const HTTP_PROTOCOL_STRINGS = ["http", "https"]; * default and otherwise falls back on `httpVersion`. Ideally we should merge * the two properties. * - * @param {Object} httpActivity + * @param {object} httpActivity * The httpActivity object for which we need to get the protocol. * * @returns {string} @@ -431,11 +431,11 @@ function getWebSocketChannel(channel) { * For a given channel, fetch the request's headers and cookies. * * @param {nsIChannel} channel - * @return {Object} + * @return {object} * An object with two properties: - * @property {Array<Object>} cookies + * @property {Array<object>} cookies * Array of { name, value } objects. - * @property {Array<Object>} headers + * @property {Array<object>} headers * Array of { name, value } objects. */ function fetchRequestHeadersAndCookies(channel) { @@ -470,7 +470,7 @@ function fetchRequestHeadersAndCookies(channel) { * Parse the early hint raw headers string to an * array of name/value object header pairs * - * @param {String} rawHeaders + * @param {string} rawHeaders * @returns {Array} */ function parseEarlyHintsResponseHeaders(rawHeaders) { @@ -489,11 +489,11 @@ function parseEarlyHintsResponseHeaders(rawHeaders) { * For a given channel, fetch the response's headers and cookies. * * @param {nsIChannel} channel - * @return {Object} + * @return {object} * An object with two properties: - * @property {Array<Object>} cookies + * @property {Array<object>} cookies * Array of { name, value } objects. - * @property {Array<Object>} headers + * @property {Array<object>} headers * Array of { name, value } objects. */ function fetchResponseHeadersAndCookies(channel) { @@ -747,7 +747,7 @@ function handleDataChannel(channel, networkEventActor) { * is available. The flag is used by the consumer of the resource (frontend) * to determine when to lazily fetch the data. * - * @param {Object} resource - This could be a network resource object or a network resource + * @param {object} resource - This could be a network resource object or a network resource * updates object. * @param {Array} networkEvents */ diff --git a/devtools/shared/network-observer/test/browser/head.js b/devtools/shared/network-observer/test/browser/head.js @@ -25,7 +25,7 @@ const URL_ROOT = CHROME_URL_ROOT.replace( * * @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) { @@ -38,7 +38,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) { diff --git a/devtools/shared/performance-new/recording-utils.sys.mjs b/devtools/shared/performance-new/recording-utils.sys.mjs @@ -30,7 +30,7 @@ export function getActiveBrowserID() { } /** - * @typedef {Object} ProfileCaptureResultAndAdditionalInformation + * @typedef {object} ProfileCaptureResultAndAdditionalInformation * @property {ProfileCaptureResult} profileCaptureResult * @property {MockedExports.ProfileGenerationAdditionalInformation} [additionalInformation] */ diff --git a/devtools/shared/platform/CacheEntry.sys.mjs b/devtools/shared/platform/CacheEntry.sys.mjs @@ -50,7 +50,7 @@ function getCacheSession(request) { * @param {nsICacheEntry} cacheEntry * The cache entry from the backend. * - * @returns {Object} + * @returns {object} * A responseCache object expected by RDP. */ function buildResponseCacheObject(cacheEntry) { diff --git a/devtools/shared/platform/clipboard.js b/devtools/shared/platform/clipboard.js @@ -17,7 +17,7 @@ function copyString(string) { /** * Retrieve the current clipboard data matching the flavor "text/plain". * - * @return {String} Clipboard text content, null if no text clipboard data is available. + * @return {string} Clipboard text content, null if no text clipboard data is available. */ function getText() { const flavor = "text/plain"; diff --git a/devtools/shared/platform/stack.js b/devtools/shared/platform/stack.js @@ -10,9 +10,9 @@ /** * Return the Nth path from the stack excluding substr. * - * @param {Number} + * @param {number} * n the Nth path from the stack to describe. - * @param {String} substr + * @param {string} substr * A segment of the path that should be excluded. */ function getNthPathExcluding(n, substr) { diff --git a/devtools/shared/protocol/Actor.js b/devtools/shared/protocol/Actor.js @@ -155,9 +155,9 @@ class Actor extends Pool { * Throw an error with the passed message and attach an `error` property to the Error * object so it can be consumed by the writeError function. * - * @param {String} error: A string (usually a single word serving as an id) that will + * @param {string} error: A string (usually a single word serving as an id) that will * be assign to error.error. - * @param {String} message: The string that will be passed to the Error constructor. + * @param {string} message: The string that will be passed to the Error constructor. * @throws This always throw. */ throwError(error, message) { @@ -174,10 +174,10 @@ exports.Actor = Actor; * When a RDP packet is received for calling an actor method, this lookup for * the method name in this object and call the function holded on this attribute. * - * @params {Object} actorSpec + * @params {object} actorSpec * The procotol-js actor specific coming from devtools/shared/specs/*.js files * This describes the types for methods and events implemented by all actors. - * @return {Object} requestTypes + * @return {object} requestTypes * An object where attributes are actor method names * and values are function implementing these methods. * These methods receive a RDP Packet (JSON-serializable object) and a DevToolsServerConnection. diff --git a/devtools/shared/protocol/Front.js b/devtools/shared/protocol/Front.js @@ -174,7 +174,7 @@ class Front extends Pool { /** * Listen for the creation and/or destruction of fronts matching one of the provided types. * - * @param {String} typeName + * @param {string} typeName * Actor type to watch. * @param {Function} onAvailable (optional) * Callback fired when a front has been just created or was already available. @@ -273,9 +273,9 @@ class Front extends Pool { /** * Send a packet on the connection. * - * @param {Object} packet - * @param {Object} options - * @param {Boolean} options.bulk + * @param {object} packet + * @param {object} options + * @param {boolean} options.bulk * To be set to true, if the packet relates to bulk request. * Bulk request allows to send raw bytes over the wire instead of * having to create a JSON string packet. diff --git a/devtools/shared/protocol/Pool.js b/devtools/shared/protocol/Pool.js @@ -18,7 +18,7 @@ var EventEmitter = require("resource://devtools/shared/event-emitter.js"); * Either a DevToolsServerConnection or a DevToolsClient. Must have * addActorPool, removeActorPool, and poolFor. * conn can be null if the subclass provides a conn property. - * @param {String} [label] + * @param {string} [label] * An optional label for the Pool. * @constructor */ @@ -131,7 +131,7 @@ class Pool extends EventEmitter { /** * Search for an actor in this pool, given an actorID * - * @param {String} actorID + * @param {string} actorID * @returns {Actor/null} Returns null if the actor wasn't found */ getActorByID(actorID) { diff --git a/devtools/shared/security/DevToolsSocketStatus.sys.mjs b/devtools/shared/security/DevToolsSocketStatus.sys.mjs @@ -19,7 +19,7 @@ export const DevToolsSocketStatus = { /** * Check if there are opened DevTools sockets. * - * @param {Object=} options + * @param {object=} options * @param {boolean=} options.excludeBrowserToolboxSockets * Exclude sockets opened by local Browser Toolbox sessions. Defaults to * false. diff --git a/devtools/shared/security/socket.js b/devtools/shared/security/socket.js @@ -316,7 +316,7 @@ function _isInputAlive(input) { * If remote connections are disabled, an error is thrown. * * @param {DevToolsServer} devToolsServer - * @param {Object} socketOptions + * @param {object} socketOptions * options of socket as follows * { * authenticator: diff --git a/devtools/shared/specs/webconsole.js b/devtools/shared/specs/webconsole.js @@ -165,13 +165,13 @@ const webconsoleSpecPrototype = { /** * Autocomplete a JavaScript expression. * - * @Arg {String} string + * @Arg {string} string * The code you want to autocomplete. - * @Arg {Number} cursor + * @Arg {number} cursor * Cursor location inside the string. Index starts from 0. - * @Arg {String} frameActor + * @Arg {string} frameActor * The id of the frame actor that made the call. - * @Arg {String} selectedNodeActor: Actor id of the selected node in the inspector. + * @Arg {string} selectedNodeActor: Actor id of the selected node in the inspector. * @Arg {Array} authorizedEvaluations * Array of the properties access which can be executed by the engine. * Example: [["x", "myGetter"], ["x", "myGetter", "y", "anotherGetter"]] to diff --git a/devtools/shared/storage/utils.js b/devtools/shared/storage/utils.js @@ -78,7 +78,7 @@ function _extractKeyValPairs(value) { * Check whether the value string represents something that should be * displayed as text. If so then it shouldn't be parsed into a tree. * - * @param {String} value + * @param {string} value * The value to be parsed. */ function _shouldParse(value) { diff --git a/devtools/shared/test-helpers/cc-analyzer.sys.mjs b/devtools/shared/test-helpers/cc-analyzer.sys.mjs @@ -23,7 +23,7 @@ export class CCAnalyzer { * to call nsICycleCollectorListener.processNext() * which would call nsICycleCollectorListener.{noteRefCountedObject,noteGCedObject,noteEdge}. * - * @param {Boolean} wantAllTraces + * @param {boolean} wantAllTraces * See nsICycleCollectorListener.allTraces() jsdoc. */ async run(wantAllTraces = false) { diff --git a/devtools/shared/test-helpers/dump-scope.sys.mjs b/devtools/shared/test-helpers/dump-scope.sys.mjs @@ -268,12 +268,12 @@ function serializeFrame(frame) { /** * @typedef JSONFrame - * @property {String} frame + * @property {string} frame * The frame location represented as a string built from the original script * url, the line number and the column number * @property {JSONFrameDetails} details * Same information as in frame, but as an object. - * @property {Object} scope + * @property {object} scope */ /** diff --git a/devtools/shared/test-helpers/trace-objects.sys.mjs b/devtools/shared/test-helpers/trace-objects.sys.mjs @@ -135,7 +135,7 @@ function getCCArrayElements(array) { * Return the shortest path between a given CCObject and a CCObject root. * * @param {CCObject} object - * @param {array} path (shouldn't be passed from the top callsite) + * @param {Array} path (shouldn't be passed from the top callsite) * @param {set} processed (shouldn't be passed from the top callsite) * @returns {Array<Object{from:CCObject, name:String}>} List of CC Edges from object to root. */ diff --git a/devtools/shared/tests/objects/JSObjectsTestUtils.sys.mjs b/devtools/shared/tests/objects/JSObjectsTestUtils.sys.mjs @@ -27,7 +27,7 @@ let gTestScope; /** * Initialize the test helper. * - * @param {Object} testScope + * @param {object} testScope * XPCShell or mochitest test scope (i.e. the global object of the test currently executed) */ function init(testScope) { diff --git a/devtools/shared/tests/xpcshell/test_eventemitter_basic.js b/devtools/shared/tests/xpcshell/test_eventemitter_basic.js @@ -314,7 +314,7 @@ function onConsoleWarningLogged(warningMessage) { /** * Create a runnable tests based on the tests descriptor given. * - * @param {Object} tests + * @param {object} tests * The tests descriptor object, contains the tests to run. */ const runnable = tests => diff --git a/devtools/shared/throttle.js b/devtools/shared/throttle.js @@ -21,7 +21,7 @@ * The function to throttle * @param {number} wait * The wait period - * @param {Object} scope + * @param {object} scope * The scope to use for func * @return {Function} The throttled function */ diff --git a/devtools/shared/webconsole/js-property-provider.js b/devtools/shared/webconsole/js-property-provider.js @@ -50,7 +50,7 @@ const MAX_AUTOCOMPLETIONS = (exports.MAX_AUTOCOMPLETIONS = 1500); * Provides a list of properties, that are possible matches based on the passed * Debugger.Environment/Debugger.Object and inputValue. * - * @param {Object} An object of the following shape: + * @param {object} An object of the following shape: * - {Object} dbgObject * When the debugger is not paused this Debugger.Object wraps * the scope for autocompletion. @@ -379,7 +379,7 @@ function hasArrayIndex(str) { * prototype. * * @param {Environment} env - * @param {String} name: Name of the constructor object we want the prototype of. + * @param {string} name: Name of the constructor object we want the prototype of. * @returns {Debugger.Object|null} the prototype, or null if it not found. */ function getContentPrototypeObject(env, name) { @@ -398,7 +398,7 @@ function getContentPrototypeObject(env, name) { } /** - * @param {Object} ast: An AST representing a property access (e.g. `foo.bar["baz"].x`) + * @param {object} ast: An AST representing a property access (e.g. `foo.bar["baz"].x`) * @returns {Array|null} An array representing the property access * (e.g. ["foo", "bar", "baz", "x"]). */ diff --git a/devtools/shared/webconsole/messages.js b/devtools/shared/webconsole/messages.js @@ -27,7 +27,7 @@ function getArrayTypeNames() { * side (with getGrip). * * @param {Message} parameters - * @returns {Boolean} + * @returns {boolean} */ function isSupportedByConsoleTable(parameters) { const supportedClasses = [