tor-browser

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

commit 18713a402b5af3881044b0a0b1b395b79c110f84
parent 5e40377cba35e10e5506b687f6d3216b23b5f1a2
Author: Julian Descottes <jdescottes@mozilla.com>
Date:   Wed, 12 Nov 2025 08:43:25 +0000

Bug 1998716 - [remote] Fix jsdoc/valid-types issues in remote r=frontend-codestyle-reviewers,Sasha

When an event name contains special characters, which can't normally be used in JS variable name (eg `-`, `.`), the event name must be escaped with surrounding quotes. However when doing this, the namespace (normally optional for `@fires`), becomes mandatory.
So the pattern to use is `@fires ClassName#"event-name.with-special.chars"`. But when using a simpler name (eg `message` or `beforeStopRequest`) it can be directly documented without namespace or escaping (`@fires message`).

We can align the other @fires for consistency, but I would file something else to do so.

Differential Revision: https://phabricator.services.mozilla.com/D272081

Diffstat:
Meslint-rollouts.config.mjs | 7-------
Mremote/shared/AppInfo.sys.mjs | 2+-
Mremote/shared/NavigationManager.sys.mjs | 4++--
Mremote/shared/UserContextManager.sys.mjs | 4++--
Mremote/shared/listeners/CachedResourceListener.sys.mjs | 2+-
Mremote/shared/listeners/DataChannelListener.sys.mjs | 2+-
Mremote/shared/listeners/DownloadListener.sys.mjs | 2+-
Mremote/shared/listeners/NetworkListener.sys.mjs | 2+-
8 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/eslint-rollouts.config.mjs b/eslint-rollouts.config.mjs @@ -488,13 +488,6 @@ export default [ "browser/components/ipprotection/IPPNetworkErrorObserver.sys.mjs", "browser/components/ipprotection/IPProtectionService.sys.mjs", "browser/components/uitour/UITour-lib.js", - "remote/shared/AppInfo.sys.mjs", - "remote/shared/NavigationManager.sys.mjs", - "remote/shared/UserContextManager.sys.mjs", - "remote/shared/listeners/CachedResourceListener.sys.mjs", - "remote/shared/listeners/DataChannelListener.sys.mjs", - "remote/shared/listeners/DownloadListener.sys.mjs", - "remote/shared/listeners/NetworkListener.sys.mjs", ], rules: { "jsdoc/valid-types": "off", diff --git a/remote/shared/AppInfo.sys.mjs b/remote/shared/AppInfo.sys.mjs @@ -11,7 +11,7 @@ const ID_THUNDERBIRD = "{3550f703-e582-4d05-9a08-453d09bdfdc6}"; * Extends Services.appinfo with further properties that are * used by different protocols as handled by the Remote Agent. * - * @typedef {object} RemoteAgent.AppInfo + * @typedef {object} AppInfo * @property {boolean} isAndroid - Whether the application runs on Android. * @property {boolean} isLinux - Whether the application runs on Linux. * @property {boolean} isMac - Whether the application runs on Mac OS. diff --git a/remote/shared/NavigationManager.sys.mjs b/remote/shared/NavigationManager.sys.mjs @@ -955,13 +955,13 @@ export function registerNavigationId(data) { * NavigationRegistry can register or unregister the underlying listeners/actors * correctly. * - * @fires navigation-started + * @fires NavigationManager#"navigation-started" * The NavigationManager emits "navigation-started" when a new navigation is * detected, with the following object as payload: * - {string} navigationId - The UUID for the navigation. * - {string} navigableId - The UUID for the navigable. * - {string} url - The target url for the navigation. - * @fires navigation-stopped + * @fires NavigationManager#"navigation-stopped" * The NavigationManager emits "navigation-stopped" when a known navigation * is stopped, with the following object as payload: * - {string} navigationId - The UUID for the navigation. diff --git a/remote/shared/UserContextManager.sys.mjs b/remote/shared/UserContextManager.sys.mjs @@ -25,10 +25,10 @@ const DEFAULT_INTERNAL_ID = 0; * This class is exported for test purposes. Otherwise the UserContextManager * singleton should be used. * - * @fires user-context-created + * @fires UserContextManagerClass#"user-context-created" * - {string} userContextId * The UUID of the user context which was just created. - * @fires user-context-deleted + * @fires UserContextManagerClass#"user-context-deleted" * - {string} userContextId * The UUID of the user context which was just deleted. */ diff --git a/remote/shared/listeners/CachedResourceListener.sys.mjs b/remote/shared/listeners/CachedResourceListener.sys.mjs @@ -31,7 +31,7 @@ const OBSERVER_TOPIC_RESOURCE_CACHE_RESPONSE = * }; * ``` * - * @fires cached-resource-sent + * @fires CachedResourceListener#"cached-resource-sent" * The CachedResourceListener emits "cached-resource-sent" event with the * following object as payload: * - {nsIHttpChannel} channel diff --git a/remote/shared/listeners/DataChannelListener.sys.mjs b/remote/shared/listeners/DataChannelListener.sys.mjs @@ -31,7 +31,7 @@ const OBSERVER_TOPIC_DATA_CHANNEL_OPENED = "data-channel-opened"; * }; * ``` * - * @fires cached-resource-sent + * @fires DataChannelListener#"cached-resource-sent" * The DataChannelListener emits "data-channel-opened" event with the * following object as payload: * - {nsIDataChannel} channel diff --git a/remote/shared/listeners/DownloadListener.sys.mjs b/remote/shared/listeners/DownloadListener.sys.mjs @@ -25,7 +25,7 @@ ChromeUtils.defineESModuleGetters(lazy, { * }; * ``` * - * @fires download-started + * @fires DownloadListener#"download-started" * The DownloadListener emits the following events: * - "download-started" when a download begins, * - "download-stopped" when a download is stopped diff --git a/remote/shared/listeners/NetworkListener.sys.mjs b/remote/shared/listeners/NetworkListener.sys.mjs @@ -29,7 +29,7 @@ ChromeUtils.defineESModuleGetters(lazy, { * }; * ``` * - * @fires before-request-sent + * @fires NetworkListener#"before-request-sent" * The NetworkListener emits "before-request-sent" events, with the * following object as payload: * - {number} browsingContextId - The browsing context id of the browsing