mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
fix(linter): stack overflow in oxc/no-async-endpoint-handlers (#6614)
Closes #6583
This commit is contained in:
parent
78fe4af3ad
commit
41dc8e314e
1 changed files with 17 additions and 0 deletions
|
|
@ -231,6 +231,15 @@ impl NoAsyncEndpointHandlers {
|
||||||
AstKind::Function(f) => self.check_function(ctx, registered_at, id_name, f),
|
AstKind::Function(f) => self.check_function(ctx, registered_at, id_name, f),
|
||||||
AstKind::VariableDeclarator(decl) => {
|
AstKind::VariableDeclarator(decl) => {
|
||||||
if let Some(init) = &decl.init {
|
if let Some(init) = &decl.init {
|
||||||
|
if let Expression::Identifier(id) = &init {
|
||||||
|
if decl
|
||||||
|
.id
|
||||||
|
.get_identifier()
|
||||||
|
.is_some_and(|declared| declared == id.name)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
self.check_endpoint_expr(ctx, id_name, registered_at, init);
|
self.check_endpoint_expr(ctx, id_name, registered_at, init);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -334,6 +343,14 @@ fn test() {
|
||||||
",
|
",
|
||||||
Some(json!([ { "allowedNames": ["middleware"] } ])),
|
Some(json!([ { "allowedNames": ["middleware"] } ])),
|
||||||
),
|
),
|
||||||
|
// https://github.com/oxc-project/oxc/issues/6583
|
||||||
|
(
|
||||||
|
"
|
||||||
|
class B{o(a={}){const attribute=attribute
|
||||||
|
c.get(attribute)}}
|
||||||
|
",
|
||||||
|
None,
|
||||||
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
let fail = vec![
|
let fail = vec![
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue