mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
44 lines
1.5 KiB
Plaintext
44 lines
1.5 KiB
Plaintext
invalidTryStatements.ts(2,5): error TS1005: 'try' expected.
|
|
invalidTryStatements.ts(6,12): error TS1472: 'catch' or 'finally' expected.
|
|
invalidTryStatements.ts(10,5): error TS1005: 'try' expected.
|
|
invalidTryStatements.ts(11,5): error TS1005: 'try' expected.
|
|
invalidTryStatements.ts(15,5): error TS1005: 'try' expected.
|
|
invalidTryStatements.ts(17,5): error TS1005: 'try' expected.
|
|
invalidTryStatements.ts(19,20): error TS1003: Identifier expected.
|
|
|
|
|
|
==== invalidTryStatements.ts (7 errors) ====
|
|
function fn() {
|
|
catch(x) { } // error missing try
|
|
~~~~~
|
|
!!! error TS1005: 'try' expected.
|
|
|
|
finally { } // potential error; can be absorbed by the 'catch'
|
|
|
|
try { }; // error missing finally
|
|
~
|
|
!!! error TS1472: 'catch' or 'finally' expected.
|
|
}
|
|
|
|
function fn2() {
|
|
finally { } // error missing try
|
|
~~~~~~~
|
|
!!! error TS1005: 'try' expected.
|
|
catch (x) { } // error missing try
|
|
~~~~~
|
|
!!! error TS1005: 'try' expected.
|
|
|
|
try { } finally { } // statement is here, so the 'catch' clause above doesn't absorb errors from the 'finally' clause below
|
|
|
|
finally { } // error missing try
|
|
~~~~~~~
|
|
!!! error TS1005: 'try' expected.
|
|
|
|
catch (x) { } // error missing try
|
|
~~~~~
|
|
!!! error TS1005: 'try' expected.
|
|
|
|
try { } catch () { } // error missing catch binding
|
|
~
|
|
!!! error TS1003: Identifier expected.
|
|
} |