Skip to content

Parser: let.x; or let?.x; is parsed as 2 statements #16856

@overlookmotel

Description

@overlookmotel

Fixing #16839 surfaced another obscure bug.

let.x;
let?.x;

These are each parsed as 2 statements - 1 x ExpressionStatement + 1 x EmptyStatement.

Playground

Once fixed, this idempotency test failure for oxc_codegen should be resolved:

Normal: tasks/coverage/misc/pass/let-optional-chaining.cjs

Metadata

Metadata

Labels

A-parserArea - ParserC-bugCategory - Bug

Type

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions