Skip to content

Commit

Permalink
fix(es/lexer): Fix typo in package keyword (#8589)
Browse files Browse the repository at this point in the history
**Description:**

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

**Related issue:**

- Closes #8588
  • Loading branch information
yannkaiser authored Feb 2, 2024
1 parent 386c391 commit 8413a6c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/swc_ecma_parser/src/lexer/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const package = 1;
Original file line number Diff line number Diff line change
@@ -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;
: ^^^^^^^
`----

0 comments on commit 8413a6c

Please sign in to comment.