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

Trailing commas in function application fail to parse #123

Open
DanBurton opened this issue Aug 26, 2020 · 0 comments
Open

Trailing commas in function application fail to parse #123

DanBurton opened this issue Aug 26, 2020 · 0 comments

Comments

@DanBurton
Copy link

λ> parseModule "f(x)" "src"
Right (JSAstModule [JSModuleStatementListItem (JSMethodCall (JSIdentifier (JSAnnot (TokenPn 0 1 1) []) "f") (JSAnnot (TokenPn 1 1 2) []) (JSLOne (JSIdentifier (JSAnnot (TokenPn 2 1 3) []) "x")) (JSAnnot (TokenPn 3 1 4) []) JSSemiAuto)] (JSAnnot (TokenPn 0 0 0) []))
λ> parseModule "f(x,)" "src"
Left "RightParenToken {tokenSpan = TokenPn 4 1 5, tokenComment = []}"

Expected: f(x,) to parse as valid JavaScript (ECMAScript 2017 & up).
Actual: it doesn't

See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Trailing_commas#Function_calls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant