Bug 1546202 - Part 1: Remove unused getFramwwork and hasSource functions. r=jlast
authorLogan Smyth <loganfsmyth@gmail.com>
Tue, 23 Apr 2019 16:50:06 +0000
changeset 470524 1c38471c164e3cad23fcc6ef3ff88c0cfdacce2a
parent 470523 74d827325fbe641c181842bd62c201eecfa42432
child 470525 d99fa29130d5e1f5a03a13b70ea3460e462d1344
push id35906
push useraciure@mozilla.com
push dateTue, 23 Apr 2019 22:14:56 +0000
treeherdermozilla-central@0ce3633f8b80 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlast
bugs1546202
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1546202 - Part 1: Remove unused getFramwwork and hasSource functions. r=jlast Differential Revision: https://phabricator.services.mozilla.com/D28408
devtools/client/debugger/bin/module-manifest.json
devtools/client/debugger/dist/parser-worker.js
devtools/client/debugger/src/workers/parser/index.js
devtools/client/debugger/src/workers/parser/sources.js
devtools/client/debugger/src/workers/parser/tests/sources.spec.js
devtools/client/debugger/src/workers/parser/worker.js
--- a/devtools/client/debugger/bin/module-manifest.json
+++ b/devtools/client/debugger/bin/module-manifest.json
@@ -10,17 +10,17 @@
           "0": 0,
           "1": 1
         }
       },
       "chunks": {
         "byName": {},
         "byBlocks": {},
         "usedIds": {
-          "1": 1
+          "0": 0
         }
       }
     }
   ],
   "extract-text-webpack-plugin ../../extract-text-webpack-plugin/dist ../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../react-aria-components/src/tabs/tab.css": [
     {
       "modules": {
         "byIdentifier": {
@@ -31,17 +31,17 @@
           "0": 0,
           "1": 1
         }
       },
       "chunks": {
         "byName": {},
         "byBlocks": {},
         "usedIds": {
-          "1": 1
+          "0": 0
         }
       }
     }
   ],
   "extract-text-webpack-plugin ../../extract-text-webpack-plugin/dist ../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../react-aria-components/src/tabs/tab-list.css": [
     {
       "modules": {
         "byIdentifier": {
@@ -52,17 +52,17 @@
           "0": 0,
           "1": 1
         }
       },
       "chunks": {
         "byName": {},
         "byBlocks": {},
         "usedIds": {
-          "1": 1
+          "0": 0
         }
       }
     }
   ],
   "extract-text-webpack-plugin ../../extract-text-webpack-plugin/dist ../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../devtools-contextmenu/menu.css": [
     {
       "modules": {
         "byIdentifier": {
@@ -73,17 +73,17 @@
           "0": 0,
           "1": 1
         }
       },
       "chunks": {
         "byName": {},
         "byBlocks": {},
         "usedIds": {
-          "1": 1
+          "0": 0
         }
       }
     }
   ],
   "extract-text-webpack-plugin ../../extract-text-webpack-plugin/dist ../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../../packages/devtools-components/src/tree.css": [
     {
       "modules": {
         "byIdentifier": {
@@ -94,17 +94,17 @@
           "0": 0,
           "1": 1
         }
       },
       "chunks": {
         "byName": {},
         "byBlocks": {},
         "usedIds": {
-          "1": 1
+          "0": 0
         }
       }
     }
   ],
   "extract-text-webpack-plugin ../../extract-text-webpack-plugin/dist ../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../../packages/devtools-reps/src/object-inspector/components/ObjectInspector.css": [
     {
       "modules": {
         "byIdentifier": {
@@ -115,17 +115,17 @@
           "0": 0,
           "1": 1
         }
       },
       "chunks": {
         "byName": {},
         "byBlocks": {},
         "usedIds": {
-          "1": 1
+          "0": 0
         }
       }
     }
   ],
   "extract-text-webpack-plugin ../../extract-text-webpack-plugin/dist ../../css-loader/index.js??ref--3-1!../../postcss-loader/lib/index.js!../../../packages/devtools-reps/src/reps/reps.css": [
     {
       "modules": {
         "byIdentifier": {
@@ -136,17 +136,17 @@
           "0": 0,
           "1": 1
         }
       },
       "chunks": {
         "byName": {},
         "byBlocks": {},
         "usedIds": {
-          "1": 1
+          "0": 0
         }
       }
     }
   ],
   "modules": {
     "byIdentifier": {
       "external \"devtools/client/shared/vendor/react-prop-types\"": 0,
       "external \"devtools/client/shared/vendor/react-dom-factories\"": 1,
--- a/devtools/client/debugger/dist/parser-worker.js
+++ b/devtools/client/debugger/dist/parser-worker.js
@@ -16985,30 +16985,25 @@ module.exports = isEmpty;
 /***/ (function(module, exports, __webpack_require__) {
 
 "use strict";
 
 
 Object.defineProperty(exports, "__esModule", {
   value: true
 });
-exports.hasSource = hasSource;
 exports.setSource = setSource;
 exports.getSource = getSource;
 exports.clearSources = clearSources;
 
 
 let cachedSources = new Map(); /* This Source Code Form is subject to the terms of the Mozilla Public
                                 * License, v. 2.0. If a copy of the MPL was not distributed with this
                                 * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
 
-function hasSource(sourceId) {
-  return cachedSources.has(sourceId);
-}
-
 function setSource(source) {
   cachedSources.set(source.id, source);
 }
 
 function getSource(sourceId) {
   if (!cachedSources.has(sourceId)) {
     throw new Error(`Parser: source ${sourceId} was not provided.`);
   }
@@ -17985,45 +17980,39 @@ var _sources = __webpack_require__(155);
 var _findOutOfScopeLocations = __webpack_require__(350);
 
 var _findOutOfScopeLocations2 = _interopRequireDefault(_findOutOfScopeLocations);
 
 var _steps = __webpack_require__(372);
 
 var _validate = __webpack_require__(374);
 
-var _frameworks = __webpack_require__(159);
-
 var _mapExpression = __webpack_require__(375);
 
 var _mapExpression2 = _interopRequireDefault(_mapExpression);
 
 var _devtoolsUtils = __webpack_require__(7);
 
 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
-
-const { workerHandler } = _devtoolsUtils.workerUtils;
+const { workerHandler } = _devtoolsUtils.workerUtils; /* This Source Code Form is subject to the terms of the Mozilla Public
+                                                       * License, v. 2.0. If a copy of the MPL was not distributed with this
+                                                       * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
 
 self.onmessage = workerHandler({
   findOutOfScopeLocations: _findOutOfScopeLocations2.default,
   getSymbols: _getSymbols.getSymbols,
   getScopes: _getScopes2.default,
   clearSymbols: _getSymbols.clearSymbols,
   clearScopes: _getScopes.clearScopes,
   clearASTs: _ast.clearASTs,
-  hasSource: _sources.hasSource,
   setSource: _sources.setSource,
   clearSources: _sources.clearSources,
   getNextStep: _steps.getNextStep,
   hasSyntaxError: _validate.hasSyntaxError,
-  getFramework: _frameworks.getFramework,
   mapExpression: _mapExpression2.default
 });
 
 /***/ }),
 /* 200 */
 /***/ (function(module, exports, __webpack_require__) {
 
 "use strict";
--- a/devtools/client/debugger/src/workers/parser/index.js
+++ b/devtools/client/debugger/src/workers/parser/index.js
@@ -41,19 +41,16 @@ export const clearScopes = async (): Pro
 
 export const clearSymbols = async (): Promise<void> =>
   dispatcher.invoke("clearSymbols");
 
 export const getSymbols = async (
   sourceId: string
 ): Promise<SymbolDeclarations> => dispatcher.invoke("getSymbols", sourceId);
 
-export const hasSource = async (sourceId: SourceId): Promise<Source> =>
-  dispatcher.invoke("hasSource", sourceId);
-
 export const setSource = async (source: Source): Promise<void> =>
   dispatcher.invoke("setSource", source);
 
 export const clearSources = async (): Promise<void> =>
   dispatcher.invoke("clearSources");
 
 export const hasSyntaxError = async (input: string): Promise<string | false> =>
   dispatcher.invoke("hasSyntaxError", input);
@@ -71,19 +68,16 @@ export const mapExpression = async (
     "mapExpression",
     expression,
     mappings,
     bindings,
     shouldMapBindings,
     shouldMapAwait
   );
 
-export const getFramework = async (sourceId: string): Promise<?string> =>
-  dispatcher.invoke("getFramework", sourceId);
-
 export type {
   SourceScope,
   BindingData,
   BindingLocation,
   BindingLocationType,
   BindingDeclarationLocation,
   BindingMetaValue,
   BindingType
--- a/devtools/client/debugger/src/workers/parser/sources.js
+++ b/devtools/client/debugger/src/workers/parser/sources.js
@@ -3,20 +3,16 @@
  * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
 
 // @flow
 
 import type { Source, SourceId } from "../../types";
 
 let cachedSources = new Map();
 
-export function hasSource(sourceId: SourceId): boolean {
-  return cachedSources.has(sourceId);
-}
-
 export function setSource(source: Source) {
   cachedSources.set(source.id, source);
 }
 
 export function getSource(sourceId: SourceId): Source {
   if (!cachedSources.has(sourceId)) {
     throw new Error(`Parser: source ${sourceId} was not provided.`);
   }
--- a/devtools/client/debugger/src/workers/parser/tests/sources.spec.js
+++ b/devtools/client/debugger/src/workers/parser/tests/sources.spec.js
@@ -1,42 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
 
 // @flow
 
-import { hasSource, getSource, setSource, clearSources } from "../sources";
-
-import type { Source } from "../../../types";
+import { getSource } from "../sources";
 
 describe("sources", () => {
-  it("hasSource", () => {
-    const sourceId = "some.source.id";
-    const source: Source = {
-      id: sourceId,
-      url: "http://example.org/some.source.js",
-      introductionUrl: "",
-      introductionType: undefined,
-      relativeUrl: "",
-      isBlackBoxed: false,
-      isPrettyPrinted: false,
-      isWasm: false,
-      loadedState: "loaded",
-      isExtension: false
-    };
-
-    expect(hasSource(sourceId)).toEqual(false);
-    setSource(source);
-    expect(hasSource(sourceId)).toEqual(true);
-    expect(getSource(sourceId)).toEqual(source);
-    clearSources();
-    expect(hasSource(sourceId)).toEqual(false);
-  });
-
   it("fail getSource", () => {
     const sourceId = "some.nonexistent.source.id";
-    expect(hasSource(sourceId)).toEqual(false);
     expect(() => {
       getSource(sourceId);
     }).toThrow();
   });
 });
--- a/devtools/client/debugger/src/workers/parser/worker.js
+++ b/devtools/client/debugger/src/workers/parser/worker.js
@@ -2,33 +2,30 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
 
 // @flow
 
 import { getSymbols, clearSymbols } from "./getSymbols";
 import { clearASTs } from "./utils/ast";
 import getScopes, { clearScopes } from "./getScopes";
-import { hasSource, setSource, clearSources } from "./sources";
+import { setSource, clearSources } from "./sources";
 import findOutOfScopeLocations from "./findOutOfScopeLocations";
 import { getNextStep } from "./steps";
 import { hasSyntaxError } from "./validate";
-import { getFramework } from "./frameworks";
 import mapExpression from "./mapExpression";
 
 import { workerUtils } from "devtools-utils";
 const { workerHandler } = workerUtils;
 
 self.onmessage = workerHandler({
   findOutOfScopeLocations,
   getSymbols,
   getScopes,
   clearSymbols,
   clearScopes,
   clearASTs,
-  hasSource,
   setSource,
   clearSources,
   getNextStep,
   hasSyntaxError,
-  getFramework,
   mapExpression
 });