-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
JSX Spread operator throws syntax error #351
Comments
Support for the object spread operator was released in 0cda392 (version 20160623), and added in 2a904e0. It's not clear to me which parts of the parser are JSX related and need to be updated. Relevant JSX docs: https://facebook.github.io/react/docs/jsx-spread.html |
It seems like this would require us to support JS syntax like this first: var b = ...c; Is there some ESn proposal like this? Can this even make sense? Alternatively, we'd have to parse interpolated expressions inside XML literals like functions parameters..? |
rest parameters, e.g. spread syntax e.g. destructuring assignment e.g. So your example doesn't make sense, but you can use |
Yes. Too bad E4X doesn't interpret |
Would there be any downsides to doing this? I'm not familiar with the js2-mode code. |
It will likely break E4X support, to some extent. Which is the (outdated) technology we actually support, not JSX. |
fwiw |
It looks like https://github.com/felipeochoa/rjsx-mode has solved this problem. |
is this still a problem in this package? is the suggested rjsx-mode the fix? If so, I can close this issue as wontfix |
I can confirm that using rjsx-mode (which extends js2-mode) fixes this issue, so this can probably be closed. |
Yeah, ok. 😃 |
for example:
The text was updated successfully, but these errors were encountered: