--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: JsTryStatement.js --- # Input ```jsx function JsTryStatement1() { try { tryBlock(); return; } catch (err) { catchClause(); return; } afterTryCatchReturn(); } function JsTryStatement2() { try { tryBlock(); return; } catch (err) { catchClause(); } afterTryCatchReturn(); } function JsTryStatement3() { return; try { tryBlock(); } catch (err) { catchClause(); } } function JsTryStatement4() { try { } catch (err) { catchClause(); } } ``` # Diagnostics ``` JsTryStatement.js:10:5 lint/correctness/noUnreachable ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This code will never be reached ... 8 │ } 9 │ > 10 │ afterTryCatchReturn(); │ ^^^^^^^^^^^^^^^^^^^^^^ 11 │ } 12 │ i ... because either this statement ... 2 │ try { 3 │ tryBlock(); > 4 │ return; │ ^^^^^^^ 5 │ } catch (err) { 6 │ catchClause(); i ... or this statement will return from the function beforehand 5 │ } catch (err) { 6 │ catchClause(); > 7 │ return; │ ^^^^^^^ 8 │ } 9 │ ``` ``` JsTryStatement.js:27:5 lint/correctness/noUnreachable ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This code will never be reached ... 25 │ return; 26 │ > 27 │ try { │ ^^^^^ > 28 │ tryBlock(); > 29 │ } catch (err) { > 30 │ catchClause(); > 31 │ } │ ^ 32 │ } 33 │ i ... because this statement will return from the function beforehand 24 │ function JsTryStatement3() { > 25 │ return; │ ^^^^^^^ 26 │ 27 │ try { ``` ``` JsTryStatement.js:36:19 lint/correctness/noUnreachable ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This code is unreachable 34 │ function JsTryStatement4() { 35 │ try { > 36 │ } catch (err) { │ ^ > 37 │ catchClause(); > 38 │ } │ ^ 39 │ } 40 │ ```