We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 75a1308 commit 21789c4Copy full SHA for 21789c4
.changeset/healthy-planes-behave.md
@@ -0,0 +1,6 @@
1
+---
2
+swc_core: patch
3
+swc_ecma_parser: patch
4
5
+
6
+perf(es/parser): less str cmp
crates/swc_ecma_parser/src/parser/ident.rs
@@ -159,8 +159,7 @@ impl<I: Tokens> Parser<I> {
159
Word::Keyword(Keyword::This) if p.input.syntax().typescript() => Ok(atom!("this")),
160
Word::Keyword(Keyword::Let) => Ok(atom!("let")),
161
Word::Ident(ident) => {
162
- if matches!(&ident, IdentLike::Other(arguments) if &**arguments == "arguments")
163
- && p.ctx().in_class_field
+ if p.ctx().in_class_field && matches!(&ident, IdentLike::Other(arguments) if atom!("arguments").eq(arguments))
164
{
165
p.emit_err(p.input.prev_span(), SyntaxError::ArgumentsInClassField)
166
}
0 commit comments