File tree Expand file tree Collapse file tree
cases/conformance/statements/tryStatements Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1807,7 +1807,7 @@ namespace ts {
18071807
18081808 export interface CatchClause extends Node {
18091809 kind : SyntaxKind . CatchClause ;
1810- parent : TryStatement ;
1810+ parent ? : TryStatement ; // We parse missing try statements
18111811 variableDeclaration ?: VariableDeclaration ;
18121812 block : Block ;
18131813 }
Original file line number Diff line number Diff line change 1- tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(6,5): error TS1005: 'try' expected.
2- tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(12,5): error TS1005: 'try' expected.
3- tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(13,5): error TS1005: 'try' expected.
1+ tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(2,5): error TS1005: 'try' expected.
2+ tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(8,5): error TS1005: 'try' expected.
3+ tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(9,5): error TS1005: 'try' expected.
4+ tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(18,5): error TS1005: 'try' expected.
45tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(22,5): error TS1005: 'try' expected.
5- tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(26,5): error TS1005: 'try' expected.
66
77
88==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (5 errors) ====
99 function fn() {
10- try {
11- } catch { // syntax error, missing '(x)'
12- }
13-
1410 catch(x) { } // error missing try
1511 ~~~~~
1612!!! error TS1005: 'try' expected.
Original file line number Diff line number Diff line change 11//// [invalidTryStatements2.ts]
22function fn ( ) {
3- try {
4- } catch { // syntax error, missing '(x)'
5- }
6-
73 catch ( x ) { } // error missing try
84
95 finally { } // potential error; can be absorbed by the 'catch'
@@ -30,10 +26,6 @@ function fn2() {
3026
3127//// [invalidTryStatements2.js]
3228function fn ( ) {
33- try {
34- }
35- catch ( _ignoredCatchParameter ) {
36- }
3729 try {
3830 }
3931 catch ( x ) { } // error missing try
Original file line number Diff line number Diff line change 11function fn ( ) {
2- try {
3- } catch { // syntax error, missing '(x)'
4- }
5-
62 catch ( x ) { } // error missing try
73
84 finally { } // potential error; can be absorbed by the 'catch'
You can’t perform that action at this time.
0 commit comments