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

Commit f2d8362

Browse files
2007heavennchevobbe
authored andcommitted
Fix getString output type & clarify fullText attachment
1 parent 49e4b4a commit f2d8362

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ async function getPrototype(
8484
async function getFullText(
8585
objectClient: ObjectClient,
8686
object: NodeContents,
87-
) : Promise<string> {
87+
) : Promise<?string | {}> {
8888
if (typeof objectClient.getString !== "function") {
8989
console.error("objectClient.getString is not a function");
9090
return Promise.resolve({});

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ function nodeIsLongString(
225225
function nodeHasFullText(
226226
item: Node
227227
) : boolean {
228-
return nodeIsLongString(item)
229-
&& getValue(item).hasOwnProperty("fullText");
228+
const value = getValue(item);
229+
return nodeIsLongString(item) && value.hasOwnProperty("fullText");
230230
}
231231

232232
function nodeHasAccessors(item: Node) : boolean {
@@ -740,6 +740,7 @@ function getChildren(options: {
740740
}
741741

742742
if (nodeIsLongString(item) && hasLoadedProps) {
743+
// Set longString object's fullText to fetched one.
743744
item.contents.value.fullText = loadedProps.fullText;
744745
return addToCache(item);
745746
}

0 commit comments

Comments
 (0)