Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ESBuild mistakes tuple label of "readonly" for a keyword #4192

@matthew-dean

Description

@matthew-dean

Reproduction: https://esbuild.github.io/try/#dAAwLjI1LjQALS1sb2FkZXI9dHMAbGV0IGRlY2xDYW5kaWRhdGU6IFtkZWNsYXJhdGlvbjogRGVjbGFyYXRpb24sIHJlYWRvbmx5PzogYm9vbGVhbl0gfCB1bmRlZmluZWQ

Discovered this quite randomly by having a tuple with a label of "readonly". Since tuple labels cannot have a modifier keyword of readonly, TypeScript thinks this is perfectly fine. (Basically, any valid object JS identifiers should be valid tuple labels AFAIK.) ESBuild, however, fails on this valid TS syntax.

Note, the ESBuild code should probably have tests for other keyword identifiers which are valid in a tuple.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions