TypeScript/tests/baselines/reference/invalidTryStatements2.errors.txt
2014-09-11 16:11:08 -07:00

41 lines
968 B
Plaintext

==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (6 errors) ====
function fn() {
try {
} catch { // syntax error, missing '(x)'
~
!!! error TS1005: '(' expected.
}
catch(x) { } // error missing try
~~~~~
!!! error TS1005: 'try' expected.
finally{ } // potential error; can be absorbed by the 'catch'
}
function fn2() {
finally { } // error missing try
~~~~~~~
!!! error TS1005: 'try' expected.
catch (x) { } // error missing try
~~~~~
!!! error TS1005: 'try' expected.
// no error
try {
}
finally {
}
// error missing try
finally {
~~~~~~~
!!! error TS1005: 'try' expected.
}
// error missing try
catch (x) {
~~~~~
!!! error TS1005: 'try' expected.
}
}