Bug 1498987 - localStorage and sessionStorage display key: key instead of key: value in developer console r=nchevobbe

Differential Revision: https://phabricator.services.mozilla.com/D9397

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Michael Ratcliffe 2018-10-23 15:33:29 +00:00
Родитель 597134aa66
Коммит 11a5c2ff95
2 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -65,6 +65,9 @@ async function checkValues(oi, storageType) {
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")]
@ -79,6 +82,8 @@ async function checkValues(oi, storageType) {
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`);

Просмотреть файл

@ -645,12 +645,7 @@ const proto = {
if (name === "length") {
return undefined;
}
return {
configurable: true,
writable: true,
enumerable: true,
value: name,
};
return desc;
}
if (!desc || onlyEnumerable && !desc.enumerable) {