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

Shorthand if-else is taken for object literal #256

Closed
Juribiyan opened this issue Mar 27, 2016 · 2 comments
Closed

Shorthand if-else is taken for object literal #256

Juribiyan opened this issue Mar 27, 2016 · 2 comments

Comments

@Juribiyan
Copy link

function fn(a) { return a ? a*a : 0 }

The last a is highlighted as if it was a property key in an object literal.

@Juribiyan Juribiyan changed the title Shorthand if is taken for object literal Shorthand if-else is taken for object literal Mar 27, 2016
@zertosh
Copy link
Member

zertosh commented May 9, 2016

Yeah - sorry, this is a bad one. With regexs you can't distinguish between object literals and blocks. So there are weird edge cases like this.

zertosh added a commit that referenced this issue Nov 28, 2016
@zertosh
Copy link
Member

zertosh commented Nov 28, 2016

Just added a test for this to catch it in the re-write. See "re-rewrite babel-sublime" #293.

@zertosh zertosh closed this as completed Nov 28, 2016
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