gecko-dev/devtools/shared
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
..
acorn
compatibility Bug 1654103: Standardize on Black for Python code in mozilla-central. 2020-10-26 18:34:53 +00:00
css Bug 1673132 - Use the -moz-default-appearance values "scrollbar-horizontal" and "scrollbar-vertical" on macOS and remove the now-unused value "scrollbar". r=emilio 2020-10-27 12:37:44 +00:00
discovery Bug 1651774: Update mozilla/use-services rule for native Services implementation. r=Standard8 2020-11-06 18:58:33 +00:00
heapsnapshot Bug 1654103: Standardize on Black for Python code in mozilla-central. 2020-10-26 18:34:53 +00:00
inspector Bug 1654103: Standardize on Black for Python code in mozilla-central. 2020-10-26 18:34:53 +00:00
jsbeautify Bug 1588458 - Replace dxr links by searchfox in the code/test r=kats,sparky 2020-10-08 14:02:40 +00:00
layout Bug 1654103: Standardize on Black for Python code in mozilla-central. 2020-10-26 18:34:53 +00:00
locales Bug 1654103: Standardize on Black for Python code in mozilla-central. 2020-10-26 18:34:53 +00:00
node-properties
performance Bug 1654103: Standardize on Black for Python code in mozilla-central. 2020-10-26 18:34:53 +00:00
performance-new Bug 1654103: Standardize on Black for Python code in mozilla-central. 2020-10-26 18:34:53 +00:00
platform Bug 1654103: Standardize on Black for Python code in mozilla-central. 2020-10-26 18:34:53 +00:00
protocol Bug 1676974 - [devtools] Remove unused protocol/utils.js method() helper r=ochameau 2020-11-13 09:49:53 +00:00
qrcode Bug 1673724 - Remove defer usage in devtools/shared/qrcode/index.js. r=Honza 2020-10-28 11:33:21 +00:00
resources Backed out changeset 62af829812bd (bug 1662736) for permafailing bug 1676641 and bug 1655183 on a CLOSED TREE 2020-11-11 19:53:14 +02:00
screenshot Bug 1654103: Standardize on Black for Python code in mozilla-central. 2020-10-26 18:34:53 +00:00
security Bug 1673872 - [devtools] Remove defer usage in devtools/shared/security/cert.js. r=Honza 2020-10-29 13:02:59 +00:00
specs Bug 1606061 - move TouchEventsOverride to BrowsingContext. r=farre,devtools-backward-compat-reviewers 2020-11-10 15:57:30 +00:00
sprintfjs
storage Bug 1654103: Standardize on Black for Python code in mozilla-central. 2020-10-26 18:34:53 +00:00
test-helpers
tests Bug 1673386 - remove defer from devtools/shared/tests/xpcshell/test_executeSoon.js. r=Honza 2020-10-27 15:23:22 +00:00
transport Bug 1654103: Standardize on Black for Python code in mozilla-central. 2020-10-26 18:34:53 +00:00
webconsole Bug 1675256 - [devtools] Remove discardRequestBody and discardResponseBody attributes of NETWORK_EVENT resource. r=bomsy,devtools-backward-compat-reviewers 2020-11-04 17:14:03 +00:00
worker Bug 1654103: Standardize on Black for Python code in mozilla-central. 2020-10-26 18:34:53 +00:00
.eslintrc.js
accessibility.js
async-storage.js
async-utils.js
base-loader.js
builtin-modules.js Bug 1472821 - Support array of String for lazyRequireGetter r=nchevobbe,rcaliman 2020-08-03 05:43:59 +00:00
constants.js Bug 1674371 - [devtools] Move ELEMENT_STYLE constant to a single file r=rcaliman,devtools-backward-compat-reviewers 2020-11-02 18:45:03 +00:00
content-observer.js Bug 1651519: Remove nsIDOMWindowUtils::currentInnerWindowID. r=nika,remote-protocol-reviewers,webcompat-reviewers,whimboo 2020-08-17 20:20:50 +00:00
debounce.js
defer.js
DevToolsUtils.js Bug 1633712 - [devtools] Create WorkerTargets as soon as possible. r=ochameau,devtools-backward-compat-reviewers. 2020-10-26 12:53:43 +00:00
dom-helpers.js
dom-node-constants.js
dom-node-filter-constants.js
event-emitter.js Bug 1668117 - [devtools] do not load prefsHelper from devtools-modules in debugger r=nchevobbe 2020-10-02 15:39:44 +00:00
extend.js
flags.js
generate-uuid.js
indentation.js
indexed-db.js
jar.mn
l10n.js Bug 1672930 - [devtools] Handle Node environment in l10n module. r=ladybenko. 2020-10-26 17:11:17 +00:00
loader-plugin-raw.jsm
Loader.jsm
moz.build Bug 1654103: Standardize on Black for Python code in mozilla-central. 2020-10-26 18:34:53 +00:00
natural-sort.js
path.js
picker-constants.js
plural-form.js Bug 1668117 - [devtools] fix typo in plural-form.js r=nchevobbe 2020-10-02 15:38:32 +00:00
protocol.js Bug 1676974 - [devtools] Remove unused protocol/utils.js method() helper r=ochameau 2020-11-13 09:49:53 +00:00
system.js
task.js
ThreadSafeDevToolsUtils.js
throttle.js
wasm-source-map.js
webextension-fallback.html