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

feat(parser): better handling of invalid modifiers #6482

Merged

Commits on Oct 13, 2024

  1. feat(parser): better handling of invalid modifiers (#6482)

    ## What This PR Does
    
    1. Recover on, and provide a better message for, invalid `export` modifier on constructor parameters. Before, an `unexpected token` error would be produced and the parser would panic. Now, the parser recovers and produces a message saying `'export' modifier cannot appear on a parameter.`
      ```ts
    class Foo {
        constructor(export x: number) {}
    }
      ```
    
    2. Recover on, and provide a better message for, invalid modifiers on index signatures. Same recovery/message characteristics as above.
      ```ts
    class Foo {
        public [x: string]: string;
    }
    ```
    DonIsaac committed Oct 13, 2024
    Configuration menu
    Copy the full SHA
    58467a5 View commit details
    Browse the repository at this point in the history