Skip to content

Commit c65e5a1

Browse files
committed
Removes valid test cases from invalid test case file
1 parent 90ea10e commit c65e5a1

4 files changed

Lines changed: 5 additions & 21 deletions

File tree

src/compiler/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

tests/baselines/reference/invalidTryStatements2.errors.txt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
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.
45
tests/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.

tests/baselines/reference/invalidTryStatements2.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
//// [invalidTryStatements2.ts]
22
function 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]
3228
function fn() {
33-
try {
34-
}
35-
catch (_ignoredCatchParameter) {
36-
}
3729
try {
3830
}
3931
catch (x) { } // error missing try

tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
function 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'

0 commit comments

Comments
 (0)