mirror of
https://github.com/swc-project/swc.git
synced 2024-12-25 06:36:08 +03:00
fix(es/parser): Fix ASI hazard of static
(#8262)
**Related issue:** - Closes #8253
This commit is contained in:
parent
35b95ae430
commit
c1281534b6
14
crates/swc/tests/fixture/issues-8xxx/8253/input/.swcrc
Normal file
14
crates/swc/tests/fixture/issues-8xxx/8253/input/.swcrc
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"jsc": {
|
||||
"parser": {
|
||||
"syntax": "ecmascript"
|
||||
},
|
||||
"target": "es2022",
|
||||
"loose": false
|
||||
},
|
||||
"module": {
|
||||
"type": "es6"
|
||||
},
|
||||
"minify": false,
|
||||
"isModule": true
|
||||
}
|
4
crates/swc/tests/fixture/issues-8xxx/8253/input/index.js
Normal file
4
crates/swc/tests/fixture/issues-8xxx/8253/input/index.js
Normal file
@ -0,0 +1,4 @@
|
||||
class Foo {
|
||||
static
|
||||
bar = 1
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
class Foo {
|
||||
static bar = 1;
|
||||
}
|
@ -534,7 +534,7 @@ impl<I: Tokens> Parser<I> {
|
||||
kind: MethodKind::Method,
|
||||
},
|
||||
);
|
||||
} else if self.is_class_property(/* asi */ true)
|
||||
} else if self.is_class_property(/* asi */ false)
|
||||
|| (self.syntax().typescript() && is!(self, '?'))
|
||||
{
|
||||
// Property named `static`
|
||||
|
Loading…
Reference in New Issue
Block a user