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

Cannot define an object literal with a getter for a symbol property #1729

Closed
andreabergia opened this issue Nov 25, 2024 · 2 comments
Closed

Comments

@andreabergia
Copy link
Contributor

This is not allowed by rhino, but it should be:

obj = { get [Symbol.match]() {} }

The error printed is TypeError: The object is not a string, but that's confusing. The reason is that there is a code path where the symbol is casted to a string, which does not work.

@p-bakker
Copy link
Collaborator

Think this is a dup of #1614

@andreabergia
Copy link
Contributor Author

@p-bakker you're right, it is!

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

No branches or pull requests

2 participants