Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw an error when accessing the value of symbol property on localStorage object #13347

Closed
ah-yu opened this issue Jan 12, 2022 · 0 comments · Fixed by #13348
Closed

Throw an error when accessing the value of symbol property on localStorage object #13347

ah-yu opened this issue Jan 12, 2022 · 0 comments · Fixed by #13348
Labels
bug Something isn't working correctly web related to Web APIs

Comments

@ah-yu
Copy link
Contributor

ah-yu commented Jan 12, 2022

Code snippet:

Object.getOwnPropertyDescriptor(localStorage,Symbol("foo"));

chrome returns undefined but deno throws an error.

error: Uncaught TypeError: Failed to execute 'getItem' on 'Storage': Argument 1 is a symbol, which cannot be converted to a string
console.log(Object.getOwnPropertyDescriptor(localStorage,Symbol("foo")));
                   ^
    at makeException (deno:ext/webidl/00_webidl.js:79:12)
    at Array.converters.DOMString (deno:ext/webidl/00_webidl.js:370:13)
    at Storage.getItem (deno:ext/webstorage/01_webstorage.js:67:31)
    at Object.getOwnPropertyDescriptor (deno:ext/webstorage/01_webstorage.js:147:30)
    at Function.getOwnPropertyDescriptor (<anonymous>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly web related to Web APIs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants