Sitelet https://github.com/acornjs/acorn/issues/199
Skip to content

Loose parser fails to parse ArrayExpression on multiple lines #199

Description

@mrennie

Using the latest from master parse the following:

var a = [1,
2,
3];

The resulting AST has three root nodes in the body (I would expect only a variableDeclaration node) and has only one element in the elements array of the ArrayExpression node (I would expect three Literal nodes).

Acorn.parse(...) properly parses the same expression correctly.

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