no-mistakes-postgres-engine 0.109.131

PostgreSQL embedded SQL extraction, schema catalog, and replay-safety analysis for no-mistakes
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use oxc_ast::ast::Statement;

/// Only a branch whose sole statement throws is unreachable at the join.
/// The walk still visits its expression; try/catch invalidates the joined facts.
pub(super) fn throws(statement: &Statement<'_>) -> bool {
    match statement {
        Statement::ThrowStatement(_) => true,
        Statement::BlockStatement(block) => {
            matches!(block.body.as_slice(), [Statement::ThrowStatement(_)])
        }
        _ => false,
    }
}