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

Commit 1aa4499

Browse files
committed
Prevent unnecessary server call when expanding node.
When expanding a node, in some cases, we query the server to know how much indexed, non-indexed and symbol properties we have in the object. The issue is that we then always try to get all the properties of the object, even if the server told us there was none. This patch prevent this and should save a couple of client-server round-trip.
1 parent 2e06571 commit 1aa4499

File tree

1 file changed

+4
-0
lines changed
  • packages/devtools-reps/src/object-inspector/utils

1 file changed

+4
-0
lines changed

packages/devtools-reps/src/object-inspector/utils/client.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ function iteratorSlice(
112112
const count = end
113113
? end - start + 1
114114
: iterator.count;
115+
116+
if (count === 0) {
117+
return Promise.resolve({});
118+
}
115119
return iterator.slice(start, count);
116120
}
117121

0 commit comments

Comments
 (0)