stc icon indicating copy to clipboard operation
stc copied to clipboard

Check reserved identifiers in function params

Open littledivy opened this issue 3 years ago • 1 comments

Adds TS1359 validation for function parameter identifiers.

error[TS1359]: ExpectedIdentifierReservedKeyword {
    span: Span {
        lo: BytePos(
            21,
        ),
        hi: BytePos(
            26,
        ),
        ctxt: #0,
    },
}
 --> a.ts:1:20
  |
1 | async function foo(await): Promise<void> {
  |                    ^^^^^

New passing conforming tests:

async/es2017/functionDeclarations/asyncFunctionDeclaration5_es2017.ts

littledivy avatar Oct 28 '22 14:10 littledivy

Also, I think this should be handled by the parser.

TS1xxx errors are for parser/lexer

kdy1 avatar Oct 28 '22 23:10 kdy1