mirror of
https://github.com/denoland/deno.git
synced 2024-11-23 15:16:54 -05:00
fix(ext/webstorage): make getOwnPropertyDescriptor
with symbol return undefined
(#13348)
Closes #13347
This commit is contained in:
parent
39a2034967
commit
9a92603a14
2 changed files with 8 additions and 0 deletions
|
@ -143,6 +143,9 @@ function createStorage(persistent) {
|
|||
if (ReflectHas(target, key)) {
|
||||
return undefined;
|
||||
}
|
||||
if (typeof key === "symbol") {
|
||||
return undefined;
|
||||
}
|
||||
const value = target.getItem(key);
|
||||
if (value === null) {
|
||||
return undefined;
|
||||
|
|
|
@ -50,3 +50,8 @@ Deno.test(function webstorageProxy() {
|
|||
assertEquals(localStorage[symbol as any], "bar");
|
||||
assertEquals(symbol in localStorage, true);
|
||||
});
|
||||
|
||||
Deno.test(function webstorageGetOwnPropertyDescriptorSymbol() {
|
||||
localStorage.clear();
|
||||
Object.getOwnPropertyDescriptor(localStorage, Symbol("foo"));
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue