Skip to content

Commit

Permalink
fix: more correct try catch finally join.
Browse files Browse the repository at this point in the history
  • Loading branch information
rzvxa committed Jun 12, 2024
1 parent 2d08d8d commit b6a762d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion crates/oxc_semantic/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,19 @@ impl<'a> Visit<'a> for SemanticBuilder<'a> {
}
}
if let Some(finally_block_end_ix) = finally_block_end_ix {
self.cfg.add_edge(finally_block_end_ix, after_try_statement_block_ix, EdgeType::Join);
if catch_block_end_ix.is_some() {
self.cfg.add_edge(
finally_block_end_ix,
after_try_statement_block_ix,
EdgeType::Normal,
);
} else {
self.cfg.add_edge(
finally_block_end_ix,
after_try_statement_block_ix,
EdgeType::Join,
);
}
}
/* cfg */

Expand Down

0 comments on commit b6a762d

Please sign in to comment.