mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
fix(parser): ASI of async class member (#1214)
Co-authored-by: Boshen <boshenc@gmail.com>
This commit is contained in:
parent
a60b7e5856
commit
8afb81aa34
2 changed files with 6 additions and 1 deletions
|
|
@ -200,7 +200,9 @@ impl<'a> Parser<'a> {
|
||||||
|
|
||||||
// async ...
|
// async ...
|
||||||
if key_name.is_none() && self.at(Kind::Async) && !self.peek_at(Kind::Question) {
|
if key_name.is_none() && self.at(Kind::Async) && !self.peek_at(Kind::Question) {
|
||||||
if self.peek_kind().is_class_element_name_start() || self.peek_at(Kind::Star) {
|
if !self.peek_token().is_on_new_line
|
||||||
|
&& (self.peek_kind().is_class_element_name_start() || self.peek_at(Kind::Star))
|
||||||
|
{
|
||||||
self.bump(Kind::Async);
|
self.bump(Kind::Async);
|
||||||
r#async = true;
|
r#async = true;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
class C {
|
class C {
|
||||||
|
async
|
||||||
async
|
async
|
||||||
foo() {}
|
foo() {}
|
||||||
static
|
static
|
||||||
|
static
|
||||||
|
static
|
||||||
bar() {}
|
bar() {}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue