Skip to content

Comment(s) in parenthesis statement being removed #426

Description

@lucivpav

Problem with escodegen.attachComments (and maybe also with esprima.parse). See https://github.com/estools/escodegen/blob/master/test/comment.js or #427 PR for reproduction.

Input:

function foo(a, b, c) {
    return (
        (a >= b && a <= c)

        // lorem
        // ipsum
        || a === 42 || a === 666
    );
}

Output:

function foo(a, b, c) {
    return a >= b && a <= c || a === 42 || a === 666;
}

Suggested output:

function foo(a, b, c) {
    // lorem
    // ipsum
    return a >= b && a <= c || a === 42 || a === 666;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions