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

Commit 03e9ff8

Browse files
Mike Ratcliffenchevobbe
authored andcommitted
Added changes to make use of local and session storage objects in object actor
1 parent 4a8dd6f commit 03e9ff8

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

packages/devtools-connection/src/debugger/client.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2779,8 +2779,8 @@ ObjectClient.prototype = {
27792779
},
27802780
{
27812781
before: function(packet) {
2782-
if (!["Map", "WeakMap", "Set", "WeakSet"].includes(this._grip.class)) {
2783-
throw new Error("enumEntries is only valid for Map/Set-like grips.");
2782+
if (!["Map", "WeakMap", "Set", "WeakSet", "Storage"].includes(this._grip.class)) {
2783+
throw new Error("enumEntries is only valid for Map/Set/Storage-like grips.");
27842784
}
27852785
return packet;
27862786
},

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ function nodeHasEntries(
251251
return value.class === "Map"
252252
|| value.class === "Set"
253253
|| value.class === "WeakMap"
254-
|| value.class === "WeakSet";
254+
|| value.class === "WeakSet"
255+
|| value.class === "Storage";
255256
}
256257

257258
function nodeHasAllEntriesInPreview(item : Node) : boolean {

packages/devtools-reps/src/reps/grip-map-entry.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ function supportsObject(grip, noGrip = false) {
5050
if (noGrip === true) {
5151
return false;
5252
}
53-
return (grip && grip.type === "mapEntry" && grip.preview);
53+
return grip &&
54+
(grip.type === "mapEntry" || grip.type === "storageEntry") &&
55+
grip.preview;
5456
}
5557

5658
function createGripMapEntry(key, value) {

0 commit comments

Comments
 (0)