Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions crates/oxc_linter/src/rules/eslint/constructor_super.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,7 @@ impl Rule for ConstructorSuper {

let cfg = ctx.cfg();

// Find constructor's CFG entry block
// TODO: this is expensive, we should have a direct mapping from function AST to node id (and then to CFG block)
let constructor_func_node = ctx.nodes().iter().find(
|n| matches!(n.kind(), AstKind::Function(func) if func.span == constructor.value.span),
);

let Some(constructor_func_node) = constructor_func_node else { return };
let constructor_block_id = ctx.nodes().cfg_id(constructor_func_node.id());
let constructor_block_id = ctx.nodes().cfg_id(constructor.value.node_id());

let (super_call_counts, super_call_spans) =
Self::find_super_calls_in_cfg(cfg, constructor_block_id, node.id(), ctx);
Expand Down
Loading