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
POST-for-in
expression with implicit function call crashes
#333
POST-for-in
expression with implicit function call crashes
#333
Comments
I'm actually getting:
With this code: (b for b in (c)) http://decaffeinate-project.org/repl/#?evaluate=false&code=(b%20for%20b%20in%20(c)) |
Looks like the initial issue have been fixed, but @niieani 's issue does still exist |
Great, thanks for calling that out. I guess we should keep this open track the other issue. I haven't looked at it too deeply, but I suspect that the original issue was fixed with Rich-Harris/magic-string#89 . |
Fixes decaffeinate/decaffeinate#333 Fixes decaffeinate/decaffeinate#502 The code to fix CoffeeScript location data was incorrectly assuming that the last node of a loop is the loop body, but that isn't true in postfix loops, so it was causing the end location to be artificially early. Probably, the ideal behavior (assuming location data actually needs to be fixed here) is to take the max of all nodes, but that didn't seem trivial. Instead, an easy fix is to just do the same thing we do for the `if` case: just use the body to extend the bounds if necessary, but never shrink it. This also seems more robust in general, probably. At the very least, it's really simple and doesn't break any decaffeinate tests.
Fixes decaffeinate/decaffeinate#333 Fixes decaffeinate/decaffeinate#502 The code to fix CoffeeScript location data was incorrectly assuming that the last node of a loop is the loop body, but that isn't true in postfix loops, so it was causing the end location to be artificially early. Probably, the ideal behavior (assuming location data actually needs to be fixed here) is to take the max of all nodes, but that didn't seem trivial. Instead, an easy fix is to just do the same thing we do for the `if` case: just use the body to extend the bounds if necessary, but never shrink it. This also seems more robust in general, probably. At the very least, it's really simple and doesn't break any decaffeinate tests.
decaffeinate is crashing on my CoffeeScript input:
(repl)
I get this error:
The fix for this is probably similar to #330.
The text was updated successfully, but these errors were encountered: