2015-02-03 00:30:33 +01:00
|
|
|
//// [invalidTryStatements2.ts]
|
|
|
|
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) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//// [invalidTryStatements2.js]
|
|
|
|
function fn() {
|
|
|
|
try {
|
|
|
|
}
|
|
|
|
catch () {
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
}
|
2015-03-09 02:23:23 +01:00
|
|
|
catch (x) {
|
|
|
|
} // error missing try
|
|
|
|
finally {
|
|
|
|
} // potential error; can be absorbed by the 'catch'
|
2015-02-03 00:30:33 +01:00
|
|
|
}
|
|
|
|
function fn2() {
|
|
|
|
try {
|
|
|
|
}
|
2015-03-09 02:23:23 +01:00
|
|
|
finally {
|
|
|
|
} // error missing try
|
2015-02-03 00:30:33 +01:00
|
|
|
try {
|
|
|
|
} // error missing try
|
2015-03-09 02:23:23 +01:00
|
|
|
catch (x) {
|
|
|
|
} // error missing try
|
2015-02-03 00:30:33 +01:00
|
|
|
// no error
|
|
|
|
try {
|
|
|
|
}
|
|
|
|
finally {
|
|
|
|
}
|
|
|
|
// error missing try
|
|
|
|
try {
|
|
|
|
}
|
|
|
|
finally {
|
|
|
|
}
|
|
|
|
// error missing try
|
|
|
|
try {
|
|
|
|
}
|
|
|
|
catch (x) {
|
|
|
|
}
|
|
|
|
}
|