Skip to content

Parser accepts trailing comma for ParenthesizedExpression, SequenceExpression #3878

@aapoalas

Description

@aapoalas

Currently, oxc parser accepts a few invalid inputs related to trailing commas inside parenthesis, be the result a ParenthesizedExpression or a SequenceExpression. The following input causes no errors:

(2,);
(2,3,);

But if you try to run the same input in engine262, it fails on both lines: https://engine262.js.org/#code=BQJgNAlA3AUKYGZJSA%3D%3D&mode=script&features=

Metadata

Metadata

Assignees

Labels

C-bugCategory - Bug

Type

No type

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions