Skip to content
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

fix: don't remove comments when removing trailing empty returns #295

Commits on Jul 10, 2016

  1. fix: don't remove comments when removing trailing empty returns

    Before this commit, the comment after a removed return statement would be
    destroyed:
    http://decaffeinate-project.org/repl/#?evaluate=true&code=-%3E%0A%20%20a%20%20%23%20foo%0A%20%20return
    
    Now, the code is a little more careful by deleting up to the start of the line
    or the previous semicolon. Also, the code now exits early and doesn't patch the
    `return` node or insert a semicolon at the end, since that was causing a
    semicolon at the end of the comment.
    
    This also fixes a crash on this type of input that I ran into when using
    magic-string with  Rich-Harris/magic-string#89 applied.
    alangpierce committed Jul 10, 2016
    Configuration menu
    Copy the full SHA
    6cf041e View commit details
    Browse the repository at this point in the history