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