You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When run through CS1 or decaffeinate, the code prints this:
[1, undefined, 1, 2]
[1, undefined, 1, 2]
But CS2 gives this output:
[1, 2, undefined, undefined]
[1, 1, 2, undefined]
CS2 switched to a slice-and-destructure approach that behaves differently here, so the straightforward approach is to replicate that behavior when in CS2 mode.
The text was updated successfully, but these errors were encountered:
alangpierce
changed the title
Implement CS2 behavior when not enough values are given to an expansion node
Implement CS2 behavior when not enough values are given to an expansion assignment
Mar 19, 2018
cc @GeoffreyBooth in case you consider this an unintentional breaking change in CS2. (It's hopefully pretty obscure and not something people would rely on in practice anyway.)
There have been a bunch of bugfixes regarding this in the last few weeks; see the changelog for 2.2.0 and newer. There’s one more bugfix on master I’ll be releasing soon, but I don’t think it affects this issue.
So I guess please make sure you’re on the latest CoffeeScript, maybe even master, and open an issue on the CoffeeScript repo if you think the output is incorrect.
decaffeinate is producing the wrong JavaScript based on my CoffeeScript input:
(repl)
When run through CS1 or decaffeinate, the code prints this:
But CS2 gives this output:
CS2 switched to a slice-and-destructure approach that behaves differently here, so the straightforward approach is to replicate that behavior when in CS2 mode.
The text was updated successfully, but these errors were encountered: