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

Records may only have String keys #77

Closed
unadlib opened this issue Apr 5, 2022 · 0 comments · Fixed by #93
Closed

Records may only have String keys #77

unadlib opened this issue Apr 5, 2022 · 0 comments · Fixed by #93

Comments

@unadlib
Copy link

unadlib commented Apr 5, 2022

Describe the bug
According to proposal-record-tuple, the key of Record can only be a string.

Records may only have String keys, not Symbol keys, due to the issues described in tc39/proposal-record-tuple#15. Creating a Record with a Symbol key is a TypeError.

To Reproduce

const record = #{ [Symbol()]: #{} };

Expected behavior
It should show the error // TypeError: Record may only have string as keys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant