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

Ensure parse error on property assignment with string property name and no initializer #11591

Closed
dsherret opened this issue Aug 5, 2021 · 0 comments · Fixed by #13025
Closed
Assignees
Labels
bug Something isn't working correctly cli related to cli/ dir

Comments

@dsherret
Copy link
Member

dsherret commented Aug 5, 2021

For exmaple, doing the following in the REPL:

> [{"a"}];
Uncaught SyntaxError: Unexpected token '<'

This doesn't seem to make sense, but swc parses this fine by default and transforms it to:

[
    {
        "a": <invalid>
    }
];

We should inspect parser.take_errors() to see if there is a diagnostic here that we could surface as a parse error. I will do this after #11581 lands (don't want to bother with conflicts).

@dsherret dsherret added bug Something isn't working correctly cli related to cli/ dir labels Aug 5, 2021
@dsherret dsherret self-assigned this Aug 5, 2021
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 cli related to cli/ dir
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant