mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 20:38:55 +00:00
fix(ext/webstorage): make getOwnPropertyDescriptor
with symbol return undefined
(#13348)
Closes #13347
This commit is contained in:
parent
39a2034967
commit
9a92603a14
@ -143,6 +143,9 @@ function createStorage(persistent) {
|
|||||||
if (ReflectHas(target, key)) {
|
if (ReflectHas(target, key)) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (typeof key === "symbol") {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
const value = target.getItem(key);
|
const value = target.getItem(key);
|
||||||
if (value === null) {
|
if (value === null) {
|
||||||
return undefined;
|
return undefined;
|
||||||
|
@ -50,3 +50,8 @@ Deno.test(function webstorageProxy() {
|
|||||||
assertEquals(localStorage[symbol as any], "bar");
|
assertEquals(localStorage[symbol as any], "bar");
|
||||||
assertEquals(symbol in localStorage, true);
|
assertEquals(symbol in localStorage, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Deno.test(function webstorageGetOwnPropertyDescriptorSymbol() {
|
||||||
|
localStorage.clear();
|
||||||
|
Object.getOwnPropertyDescriptor(localStorage, Symbol("foo"));
|
||||||
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user