fix(es/lexer): Fix typo in package keyword (#8589)

**Description:**

There is a typo in the ES lexer for the keyword `package`.

**Related issue:**

- Closes #8588
This commit is contained in:
yannkaiser 2024-02-02 02:17:48 +01:00 committed by GitHub
parent 386c391081
commit 8413a6c48e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 1 deletions

View File

@ -198,7 +198,7 @@ const L_O: ByteHandler = Some(|lexer| {
const L_P: ByteHandler = Some(|lexer| {
lexer.read_word_with(|s| match s {
"public" => Some(Word::Ident(IdentLike::Known(KnownIdent::Public))),
"pacakge" => Some(Word::Ident(IdentLike::Known(KnownIdent::Package))),
"package" => Some(Word::Ident(IdentLike::Known(KnownIdent::Package))),
"protected" => Some(Word::Ident(IdentLike::Known(KnownIdent::Protected))),
"private" => Some(Word::Ident(IdentLike::Known(KnownIdent::Private))),
_ => None,

View File

@ -0,0 +1 @@
const package = 1;

View File

@ -0,0 +1,6 @@
x `package` cannot be used as an identifier in strict mode
,-[$DIR/tests/typescript-errors/issue-8588/input.ts:1:1]
1 | const package = 1;
: ^^^^^^^
`----