mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 20:32:10 +00:00
fix(semantic): replace ClassStatickBlockAwait with ClassStaticBlockAwait (#2179)
This commit is contained in:
parent
080e78c647
commit
122abd56ef
1 changed files with 3 additions and 3 deletions
|
|
@ -159,7 +159,7 @@ fn check_module_record(ctx: &SemanticBuilder<'_>) {
|
||||||
#[derive(Debug, Error, Diagnostic)]
|
#[derive(Debug, Error, Diagnostic)]
|
||||||
#[error("Cannot use await in class static initialization block")]
|
#[error("Cannot use await in class static initialization block")]
|
||||||
#[diagnostic()]
|
#[diagnostic()]
|
||||||
struct ClassStatickBlockAwait(#[label] Span);
|
struct ClassStaticBlockAwait(#[label] Span);
|
||||||
|
|
||||||
#[derive(Debug, Error, Diagnostic)]
|
#[derive(Debug, Error, Diagnostic)]
|
||||||
#[error("The keyword '{0}' is reserved")]
|
#[error("The keyword '{0}' is reserved")]
|
||||||
|
|
@ -190,7 +190,7 @@ fn check_identifier<'a>(name: &Atom, span: Span, node: &AstNode<'a>, ctx: &Seman
|
||||||
}
|
}
|
||||||
// It is a Syntax Error if ClassStaticBlockStatementList Contains await is true.
|
// It is a Syntax Error if ClassStaticBlockStatementList Contains await is true.
|
||||||
if ctx.scope.get_flags(node.scope_id()).is_class_static_block() {
|
if ctx.scope.get_flags(node.scope_id()).is_class_static_block() {
|
||||||
return ctx.error(ClassStatickBlockAwait(span));
|
return ctx.error(ClassStaticBlockAwait(span));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1096,7 +1096,7 @@ fn check_await_expression<'a>(
|
||||||
// It is a Syntax Error if ClassStaticBlockStatementList Contains await is true.
|
// It is a Syntax Error if ClassStaticBlockStatementList Contains await is true.
|
||||||
if ctx.scope.get_flags(node.scope_id()).is_class_static_block() {
|
if ctx.scope.get_flags(node.scope_id()).is_class_static_block() {
|
||||||
let start = expr.span.start;
|
let start = expr.span.start;
|
||||||
ctx.error(ClassStatickBlockAwait(Span::new(start, start + 5)));
|
ctx.error(ClassStaticBlockAwait(Span::new(start, start + 5)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue