mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
32 lines
1014 B
Plaintext
32 lines
1014 B
Plaintext
//// [tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts] ////
|
|
|
|
=== invalidTryStatements.ts ===
|
|
function fn() {
|
|
>fn : Symbol(fn, Decl(invalidTryStatements.ts, 0, 0))
|
|
|
|
catch(x) { } // error missing try
|
|
>x : Symbol(x, Decl(invalidTryStatements.ts, 1, 10))
|
|
|
|
finally { } // potential error; can be absorbed by the 'catch'
|
|
|
|
try { }; // error missing finally
|
|
}
|
|
|
|
function fn2() {
|
|
>fn2 : Symbol(fn2, Decl(invalidTryStatements.ts, 6, 1))
|
|
|
|
finally { } // error missing try
|
|
catch (x) { } // error missing try
|
|
>x : Symbol(x, Decl(invalidTryStatements.ts, 10, 11))
|
|
|
|
try { } finally { } // statement is here, so the 'catch' clause above doesn't absorb errors from the 'finally' clause below
|
|
|
|
finally { } // error missing try
|
|
|
|
catch (x) { } // error missing try
|
|
>x : Symbol(x, Decl(invalidTryStatements.ts, 16, 11))
|
|
|
|
try { } catch () { } // error missing catch binding
|
|
> : Symbol((Missing), Decl(invalidTryStatements.ts, 18, 19))
|
|
}
|