Skip to content

Commit 306c912

Browse files
committed
fix: support for edge case found in AFFiNe.
1 parent 8e4ca8e commit 306c912

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

crates/oxc_linter/src/rules/eslint/no_unreachable.rs

+11-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ impl Rule for NoUnreachable {
7373
DfsEvent::Discover(node, _) => {
7474
let mut incoming = graph.edges_directed(node, Direction::Incoming);
7575
if incoming.any(|e| match e.weight() {
76-
EdgeType::NewFunction => true,
76+
EdgeType::NewFunction | EdgeType::Finalize => true,
7777
EdgeType::Jump
7878
if cfg
7979
.basic_block(e.source())
@@ -221,7 +221,16 @@ fn test() {
221221
c();
222222
}
223223
d();
224-
",
224+
",
225+
"
226+
try {
227+
while (true) {
228+
a();
229+
}
230+
} finally {
231+
b();
232+
}
233+
",
225234
];
226235

227236
let fail = vec![

0 commit comments

Comments
 (0)