41 lines
No EOL
884 B
Text
41 lines
No EOL
884 B
Text
==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (6 errors) ====
|
|
function fn() {
|
|
try {
|
|
} catch { // syntax error, missing '(x)'
|
|
~
|
|
!!! '(' expected.
|
|
}
|
|
|
|
catch(x) { } // error missing try
|
|
~~~~~
|
|
!!! 'try' expected.
|
|
|
|
finally{ } // potential error; can be absorbed by the 'catch'
|
|
}
|
|
|
|
function fn2() {
|
|
finally { } // error missing try
|
|
~~~~~~~
|
|
!!! 'try' expected.
|
|
catch (x) { } // error missing try
|
|
~~~~~
|
|
!!! 'try' expected.
|
|
|
|
// no error
|
|
try {
|
|
}
|
|
finally {
|
|
}
|
|
|
|
// error missing try
|
|
finally {
|
|
~~~~~~~
|
|
!!! 'try' expected.
|
|
}
|
|
|
|
// error missing try
|
|
catch (x) {
|
|
~~~~~
|
|
!!! 'try' expected.
|
|
}
|
|
} |