Skip to content

Commit 18713a4

Browse files
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
1 parent 5e40377 commit 18713a4

File tree

8 files changed

+9
-16
lines changed

8 files changed

+9
-16
lines changed

eslint-rollouts.config.mjs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -488,13 +488,6 @@ export default [
488488
"browser/components/ipprotection/IPPNetworkErrorObserver.sys.mjs",
489489
"browser/components/ipprotection/IPProtectionService.sys.mjs",
490490
"browser/components/uitour/UITour-lib.js",
491-
"remote/shared/AppInfo.sys.mjs",
492-
"remote/shared/NavigationManager.sys.mjs",
493-
"remote/shared/UserContextManager.sys.mjs",
494-
"remote/shared/listeners/CachedResourceListener.sys.mjs",
495-
"remote/shared/listeners/DataChannelListener.sys.mjs",
496-
"remote/shared/listeners/DownloadListener.sys.mjs",
497-
"remote/shared/listeners/NetworkListener.sys.mjs",
498491
],
499492
rules: {
500493
"jsdoc/valid-types": "off",

remote/shared/AppInfo.sys.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const ID_THUNDERBIRD = "{3550f703-e582-4d05-9a08-453d09bdfdc6}";
1111
* Extends Services.appinfo with further properties that are
1212
* used by different protocols as handled by the Remote Agent.
1313
*
14-
* @typedef {object} RemoteAgent.AppInfo
14+
* @typedef {object} AppInfo
1515
* @property {boolean} isAndroid - Whether the application runs on Android.
1616
* @property {boolean} isLinux - Whether the application runs on Linux.
1717
* @property {boolean} isMac - Whether the application runs on Mac OS.

remote/shared/NavigationManager.sys.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -955,13 +955,13 @@ export function registerNavigationId(data) {
955955
* NavigationRegistry can register or unregister the underlying listeners/actors
956956
* correctly.
957957
*
958-
* @fires navigation-started
958+
* @fires NavigationManager#"navigation-started"
959959
* The NavigationManager emits "navigation-started" when a new navigation is
960960
* detected, with the following object as payload:
961961
* - {string} navigationId - The UUID for the navigation.
962962
* - {string} navigableId - The UUID for the navigable.
963963
* - {string} url - The target url for the navigation.
964-
* @fires navigation-stopped
964+
* @fires NavigationManager#"navigation-stopped"
965965
* The NavigationManager emits "navigation-stopped" when a known navigation
966966
* is stopped, with the following object as payload:
967967
* - {string} navigationId - The UUID for the navigation.

remote/shared/UserContextManager.sys.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ const DEFAULT_INTERNAL_ID = 0;
2525
* This class is exported for test purposes. Otherwise the UserContextManager
2626
* singleton should be used.
2727
*
28-
* @fires user-context-created
28+
* @fires UserContextManagerClass#"user-context-created"
2929
* - {string} userContextId
3030
* The UUID of the user context which was just created.
31-
* @fires user-context-deleted
31+
* @fires UserContextManagerClass#"user-context-deleted"
3232
* - {string} userContextId
3333
* The UUID of the user context which was just deleted.
3434
*/

remote/shared/listeners/CachedResourceListener.sys.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const OBSERVER_TOPIC_RESOURCE_CACHE_RESPONSE =
3131
* };
3232
* ```
3333
*
34-
* @fires cached-resource-sent
34+
* @fires CachedResourceListener#"cached-resource-sent"
3535
* The CachedResourceListener emits "cached-resource-sent" event with the
3636
* following object as payload:
3737
* - {nsIHttpChannel} channel

remote/shared/listeners/DataChannelListener.sys.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const OBSERVER_TOPIC_DATA_CHANNEL_OPENED = "data-channel-opened";
3131
* };
3232
* ```
3333
*
34-
* @fires cached-resource-sent
34+
* @fires DataChannelListener#"cached-resource-sent"
3535
* The DataChannelListener emits "data-channel-opened" event with the
3636
* following object as payload:
3737
* - {nsIDataChannel} channel

remote/shared/listeners/DownloadListener.sys.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
2525
* };
2626
* ```
2727
*
28-
* @fires download-started
28+
* @fires DownloadListener#"download-started"
2929
* The DownloadListener emits the following events:
3030
* - "download-started" when a download begins,
3131
* - "download-stopped" when a download is stopped

remote/shared/listeners/NetworkListener.sys.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
2929
* };
3030
* ```
3131
*
32-
* @fires before-request-sent
32+
* @fires NetworkListener#"before-request-sent"
3333
* The NetworkListener emits "before-request-sent" events, with the
3434
* following object as payload:
3535
* - {number} browsingContextId - The browsing context id of the browsing

0 commit comments

Comments
 (0)