TypeScript/tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts
2014-07-25 18:25:43 -07:00

28 lines
No EOL
454 B
TypeScript

function fn() {
try {
} catch { // syntax error, missing '(x)'
}
catch(x) { } // error missing try
finally{ } // potential error; can be absorbed by the 'catch'
}
function fn2() {
finally { } // error missing try
catch (x) { } // error missing try
// no error
try {
}
finally {
}
// error missing try
finally {
}
// error missing try
catch (x) {
}
}