gecko-dev/devtools
Julian Descottes 3ad6fe2ca8 Bug 1676974 - [devtools] Remove unused protocol/utils.js method() helper r=ochameau
Current implementation
```lang=javascript
exports.method = function(fn, spec = {}) {
  fn._methodSpec = Object.freeze(spec);
  if (spec.request) {
    Object.freeze(spec.request);
  }
  if (spec.response) {
    Object.freeze(spec.response);
  }
  return fn;
};
```
https://searchfox.org/mozilla-central/rev/5a1a34953a26117f3be1a00db20c8bbdc03273d6/devtools/shared/protocol/utils.js#70-79

The helper method() in protocol/utils.js is only called from two methods:
- actorBridge (never used in the codebase)
- actorBridgeWithSpec (used by a few actors)

actorBridgeWithSpec doesn't pass the second argument, so in practice, this method could be reduced to:
```lang=javascript
exports.method = function(fn) {
  fn._methodSpec = Object.freeze({});
  return fn;
};
```

`_methodSpec` is only mentioned in one other spot: https://searchfox.org/mozilla-central/rev/5a1a34953a26117f3be1a00db20c8bbdc03273d6/devtools/shared/protocol/Actor/generateActorSpec.js#27-40

But based on our coverage tooling, we never actually have a `_methodSpec` when we run this code: https://coverage.moz.tools/#view=file&revision=latest&path=devtools/shared/protocol/Actor/generateActorSpec.js

To hit it, we would have to call `generateActorSpec` directly with an actor where we used `actorBridgeWithSpec`. But we never do that, we only use it with plain JS objects in the devtools/shared/specs folder.

Consequently, this helper can be removed.

Differential Revision: https://phabricator.services.mozilla.com/D96935
2020-11-13 09:49:53 +00:00
..
client Backed out 10 changesets (bug 1662254) for lint failure on generate_static_pref_list.py CLOSED TREE 2020-11-12 23:59:07 +02:00
docs Bug 1673054 - Migrate uses of intl.uidirection to intl.l10n.pseudo; r=Gijs,zbraniecki 2020-11-09 15:33:39 +00:00
platform Bug 1654103: Standardize on Black for Python code in mozilla-central. 2020-10-26 18:34:53 +00:00
server Bug 1676974 - [devtools] Remove unused protocol/utils.js method() helper r=ochameau 2020-11-13 09:49:53 +00:00
shared Bug 1676974 - [devtools] Remove unused protocol/utils.js method() helper r=ochameau 2020-11-13 09:49:53 +00:00
startup Bug 1641270 - Part 6: Pass CookieJarSettings to nsIWebBrowserPersist.saveURI() and nsIWebBrowserPersist.savePrivacyAwareURI(). r=smaug 2020-11-11 18:19:27 +00:00
.eslintrc.js Bug 1652690 - Remove outdated eslint rule for devtools/shared/platform r=nchevobbe,perftest-reviewers,sparky 2020-07-15 14:59:19 +00:00
.eslintrc.mochitests.js Bug 1620537 - Fix eslint issues in devtools .eslintrc*.js files now that ESLint 7 will lint them. r=mossop 2020-07-24 20:39:07 +00:00
.eslintrc.xpcshell.js Bug 1620537 - Fix eslint issues in devtools .eslintrc*.js files now that ESLint 7 will lint them. r=mossop 2020-07-24 20:39:07 +00:00
CODE_OF_CONDUCT.md
moz.build Bug 1654103: Standardize on Black for Python code in mozilla-central. 2020-10-26 18:34:53 +00:00
templates.mozbuild
tsconfig.json