Bug 1498987 - localStorage and sessionStorage display key: key instead of key: value in developer console. r=nchevobbe, a=RyanVM
authorMichael Ratcliffe <mratcliffe@mozilla.com>
Tue, 23 Oct 2018 15:33:29 +0000
changeset 500825 647a42eaae85d8d4d06e3a9f51d1f0301844f4dd
parent 500824 cad7fc1b8cf23646661342472c514c731760f3ad
child 500826 154465d8a68413c82c8fdb3cfe15e704829dada3
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnchevobbe, RyanVM
bugs1498987
milestone64.0
Bug 1498987 - localStorage and sessionStorage display key: key instead of key: value in developer console. r=nchevobbe, a=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D9397
devtools/client/webconsole/test/mochitest/browser_webconsole_object_inspector_local_session_storage.js
devtools/server/actors/object.js
--- a/devtools/client/webconsole/test/mochitest/browser_webconsole_object_inspector_local_session_storage.js
+++ b/devtools/client/webconsole/test/mochitest/browser_webconsole_object_inspector_local_session_storage.js
@@ -60,29 +60,34 @@ async function checkValues(oi, storageTy
   entriesNode.querySelector(".arrow").click();
   await onMapOiMutation;
 
   nodes = oi.querySelectorAll(".node");
   // There are now 7 nodes, the 5 original ones, and the 2 entries.
   is(nodes.length, 7, "There is the expected number of nodes in the tree");
 
   const title = nodes[0].querySelector(".objectTitle").textContent;
+  const name1 = nodes[1].querySelector(".object-label").textContent;
+  const value1 = nodes[1].querySelector(".objectBox").textContent;
+
   const length = [...nodes[2].querySelectorAll(".object-label,.objectBox")]
                              .map(node => node.textContent);
   const key2 = [...nodes[4].querySelectorAll(".object-label,.nodeName,.objectBox-string")]
                            .map(node => node.textContent);
   const key = [...nodes[5].querySelectorAll(".object-label,.nodeName,.objectBox-string")]
                           .map(node => node.textContent);
 
   is(title, "Storage", `${storageType} object has the expected title`);
   is(length[0], "length", `${storageType} length property name is correct`);
   is(length[1], "2", `${storageType} length property value is correct`);
   is(key2[0], "0", `1st entry of ${storageType} entry has the correct index`);
   is(key2[1], "key2", `1st entry of ${storageType} entry has the correct key`);
 
   const firstValue = storageType === "localStorage" ? `"value2"` : `"value4"`;
+  is(name1, "key2", "Name of short descriptor is correct");
+  is(value1, firstValue, "Value of short descriptor is correct");
   is(key2[2], firstValue, `1st entry of ${storageType} entry has the correct value`);
   is(key[0], "1", `2nd entry of ${storageType} entry has the correct index`);
   is(key[1], "key", `2nd entry of ${storageType} entry has the correct key`);
 
   const secondValue = storageType === "localStorage" ? `"value1"` : `"value3"`;
   is(key[2], secondValue, `2nd entry of ${storageType} entry has the correct value`);
 }
--- a/devtools/server/actors/object.js
+++ b/devtools/server/actors/object.js
@@ -640,22 +640,17 @@ const proto = {
         value: e.name,
       };
     }
 
     if (isStorage(this.obj)) {
       if (name === "length") {
         return undefined;
       }
-      return {
-        configurable: true,
-        writable: true,
-        enumerable: true,
-        value: name,
-      };
+      return desc;
     }
 
     if (!desc || onlyEnumerable && !desc.enumerable) {
       return undefined;
     }
 
     const retval = {
       configurable: desc.configurable,