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

a +'' yields unexpected behavior #4474

Closed
xxv opened this issue Mar 24, 2017 · 1 comment
Closed

a +'' yields unexpected behavior #4474

xxv opened this issue Mar 24, 2017 · 1 comment

Comments

@xxv
Copy link

xxv commented Mar 24, 2017

The Coffeescript:

a + ''

produces the Javascript:

a + '';

Whereas the Coffeescript:

a +''

produces:

a(+'');

which is very surprising. You can see this sketch for all the permutations

Keywords of symbols: plus apostrophe quote whitespace

@xxv xxv changed the title a +' yields unexpected behavior a +'' yields unexpected behavior Mar 24, 2017
@lydell
Copy link
Collaborator

lydell commented Mar 24, 2017

Thanks for the very clear issue!

This is simply one of common gotchas of CoffeeScript.

See also previous issues: #2703 #2469 #2754

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

No branches or pull requests

2 participants