-
Notifications
You must be signed in to change notification settings - Fork 2k
[CS2] Spread syntax triple dots on either right or left #4606
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
[CS2] Spread syntax triple dots on either right or left #4606
Conversation
LGTM |
src/rewriter.coffee
Outdated
if (tag in IMPLICIT_FUNC and token.spaced or | ||
tag is '?' and i > 0 and not tokens[i - 1].spaced) and | ||
(nextTag in IMPLICIT_CALL or | ||
(nextTag in [IMPLICIT_CALL..., '...'] or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bit of a nitpick but... this could be nextTag in IMPLICIT_CALL or nextTag is '...'
and would probably be a bit cheaper and, I think, more readable (assuming we can't simply add ...
to IMPLICIT_CALL
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, looks like it’s much cheaper: https://jsperf.com/in-spread-array-vs-two-comparisons/1
I'm still not entirely convinced it's a good idea 😛 but apart from a small nitpick it LGTM. What's our strategy going to be for documenting this? |
Tiny note in the changelog, and nothing else 😉 |
See #85.