-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Require curly braces for same-name key-value shorthand #873
Comments
I agree 100%. I have 6969 lines of CoffeeScript code in my current project and never, ever, had a need for the The change TrevorBurnham proposes however, allows us to have, for example, string parameters after the implicit ...This alone, in my current project, would allow the removal of curly braces in over 30 places. Furthermore, whenever I'm rereading my code, those curly braces always stop me in my tracks, making me think: "Why are these here? Why haven't I removed them?" Food for thought. |
ref. #618 |
I love the |
Yep, I'm afraid this is a duplicate of #618 -- meaning that I don't know how to make it parseable. If anyone can come up with a patch or an idea for how to fix it, please post it to that ticket; closing this one. |
Oh, well, this makes me sad... But only a bit -- programming in CoffeeScript is still a joy. :) |
A patch to fix this issue is now on master, as of #1061. Please give it a try and see if it works for your use cases. |
This has been discussed a bit in other issues, but I don't think anyone has raised the matter directly.
{a}
is shorthand for{a: a}
. That's cool. And in a function call, I can writeas shorthand for
Also cool. But if I write
then this is parsed as
I see this as seriously ambiguous. I'd prefer that only consecutive explicit
key: value
pairs without curly braces be interpreted as object declarations. Do others agree?The text was updated successfully, but these errors were encountered: