-
Notifications
You must be signed in to change notification settings - Fork 2k
Lexer: Chaining: Method chaining wraps enclosing object incorrectly #4533
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
Comments
This illustrates yet another reason why allowing chains to close implicit calls is hinkey and maybe shouldn't have been added in the first place. You want
To be:
But this:
Looks like it really ought to be:
|
I don't think that's any more ambiguous than |
Well, we could take the feature out entirely in 2. It was never properly documented in 1, so it wouldn’t be the hugest breaking change, but it would certainly affect a lot of people. Or we could leave it in as it is now, a basically undocumented feature. I could close all the remaining chaining issues with the excuse that “this is a deprecated feature. It remains available in order to not break backward compatibility, but we don’t plan to make any further improvements to it” or similar. Or we could just try to fix it as best we can. Now is the time, so that any breaking changes that result happen before 2 leaves beta. |
We're probably missing a definition of a 'canonical style' for writing CoffeeScript, then it would be clearer in these discussions which direction is better. In particular, some canonical definition of which whitespace constructs are supported would go a long way to explaining why some things compile the way they do and reduce the number of cases of people being 'surprised' by compilations, particularly when they were deliberately implemented (such as this one) rather than emergent from the whitespace rules.
In this case, it's because an indented |
Input:
Output:
But consider that
compiles to
I have a fix coming.
The text was updated successfully, but these errors were encountered: