1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-24 16:19:12 -05:00

fix(ext/webstorage): make getOwnPropertyDescriptor with symbol return undefined (#13348)

Closes #13347
This commit is contained in:
Leo Kettmeir 2024-10-07 07:59:27 -07:00 committed by GitHub
parent 39a2034967
commit 9a92603a14
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View file

@ -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;

View file

@ -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"));
});