2014-07-26 03:25:43 +02:00
|
|
|
==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (6 errors) ====
|
2014-07-13 01:04:16 +02:00
|
|
|
function fn() {
|
|
|
|
try {
|
|
|
|
} catch { // syntax error, missing '(x)'
|
|
|
|
~
|
|
|
|
!!! '(' expected.
|
|
|
|
}
|
|
|
|
|
|
|
|
catch(x) { } // error missing try
|
|
|
|
~~~~~
|
2014-07-27 06:17:53 +02:00
|
|
|
!!! 'try' expected.
|
2014-07-13 01:04:16 +02:00
|
|
|
|
2014-07-26 03:25:43 +02:00
|
|
|
finally{ } // potential error; can be absorbed by the 'catch'
|
|
|
|
}
|
|
|
|
|
|
|
|
function fn2() {
|
|
|
|
finally { } // error missing try
|
|
|
|
~~~~~~~
|
2014-07-27 06:17:53 +02:00
|
|
|
!!! 'try' expected.
|
2014-07-26 03:25:43 +02:00
|
|
|
catch (x) { } // error missing try
|
|
|
|
~~~~~
|
2014-07-27 06:17:53 +02:00
|
|
|
!!! 'try' expected.
|
2014-07-26 03:25:43 +02:00
|
|
|
|
|
|
|
// no error
|
|
|
|
try {
|
|
|
|
}
|
|
|
|
finally {
|
|
|
|
}
|
|
|
|
|
|
|
|
// error missing try
|
|
|
|
finally {
|
|
|
|
~~~~~~~
|
2014-07-27 06:17:53 +02:00
|
|
|
!!! 'try' expected.
|
2014-07-26 03:25:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// error missing try
|
|
|
|
catch (x) {
|
|
|
|
~~~~~
|
2014-07-27 06:17:53 +02:00
|
|
|
!!! 'try' expected.
|
2014-07-26 03:25:43 +02:00
|
|
|
}
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|