Skip to content
This repository was archived by the owner on Sep 21, 2021. It is now read-only.

Commit 7c53878

Browse files
committed
Delete unused loadItemProperties function.
1 parent be49ea1 commit 7c53878

File tree

1 file changed

+0
-76
lines changed

1 file changed

+0
-76
lines changed

packages/devtools-reps/src/object-inspector/utils/load-properties.js

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
const {
6-
enumEntries,
7-
enumIndexedProperties,
8-
enumNonIndexedProperties,
9-
getPrototype,
10-
enumSymbols,
11-
} = require("./client");
12-
135
const {
146
getClosestGripNode,
157
getClosestNonBucketNode,
@@ -27,77 +19,10 @@ const {
2719
} = require("./node");
2820

2921
import type {
30-
GripProperties,
3122
LoadedProperties,
3223
Node,
33-
NodeContents,
34-
ObjectClient,
35-
RdpGrip,
3624
} from "../types";
3725

38-
function loadItemProperties(
39-
item: Node,
40-
createObjectClient: (RdpGrip | NodeContents) => ObjectClient,
41-
loadedProperties: LoadedProperties
42-
) : Promise<GripProperties> | null {
43-
const [start, end] = item.meta
44-
? [item.meta.startIndex, item.meta.endIndex]
45-
: [];
46-
47-
let objectClient;
48-
const getObjectClient = () => {
49-
if (objectClient) {
50-
return objectClient;
51-
}
52-
53-
const gripItem = getClosestGripNode(item);
54-
const value = getValue(gripItem);
55-
return createObjectClient(value);
56-
};
57-
58-
let loadingPromises = [];
59-
if (shouldLoadItemIndexedProperties(item, loadedProperties)) {
60-
loadingPromises.push(enumIndexedProperties(getObjectClient(), start, end));
61-
}
62-
63-
if (shouldLoadItemNonIndexedProperties(item, loadedProperties)) {
64-
loadingPromises.push(enumNonIndexedProperties(getObjectClient(), start, end));
65-
}
66-
67-
if (shouldLoadItemEntries(item, loadedProperties)) {
68-
loadingPromises.push(enumEntries(getObjectClient(), start, end));
69-
}
70-
71-
if (shouldLoadItemPrototype(item, loadedProperties)) {
72-
loadingPromises.push(getPrototype(getObjectClient()));
73-
}
74-
75-
if (shouldLoadItemSymbols(item, loadedProperties)) {
76-
loadingPromises.push(enumSymbols(getObjectClient(), start, end));
77-
}
78-
79-
if (loadingPromises.length === 0) {
80-
return null;
81-
}
82-
83-
return Promise.all(loadingPromises)
84-
.then(responses => responses.reduce((accumulator, res) => {
85-
// Let's loop through the responses to build a single response object.
86-
Object.entries(res).forEach(([k, v]) => {
87-
if (accumulator.hasOwnProperty(k)) {
88-
if (Array.isArray(accumulator[k])) {
89-
accumulator[k].push(...v);
90-
} else if (typeof accumulator[k] === "object") {
91-
accumulator[k] = Object.assign({}, accumulator[k], v);
92-
}
93-
} else {
94-
accumulator[k] = v;
95-
}
96-
});
97-
return accumulator;
98-
}, {}));
99-
}
100-
10126
function shouldLoadItemIndexedProperties(
10227
item: Node,
10328
loadedProperties: LoadedProperties = new Map()
@@ -180,7 +105,6 @@ function shouldLoadItemSymbols(
180105
}
181106

182107
module.exports = {
183-
loadItemProperties,
184108
shouldLoadItemEntries,
185109
shouldLoadItemIndexedProperties,
186110
shouldLoadItemNonIndexedProperties,

0 commit comments

Comments
 (0)