Skip to content

Re-enable error recovery for contextual keywords used as identifiers #10603

@thorn0

Description

@thorn0
yield = 3

causes an error: Unexpected reserved word 'yield' (playground), which should only happen in modules. In non-module code, yield is an acceptable identifier (spec). Prettier 2.2.1 handles this better thanks to the error recovery (playground).

Originally posted by @thorn0 in #10446 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty:easyIssues that should be easy to fix. Resolve me on the train to work!lang:javascriptIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.type:testsIssues about tests that are not correct, should be added, or similar

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions