Removes valid test cases from invalid test case file

This commit is contained in:
Tingan Ho
2017-07-30 11:03:43 +02:00
parent 90ea10e45e
commit c65e5a1d13
4 changed files with 5 additions and 21 deletions

View File

@@ -1807,7 +1807,7 @@ namespace ts {
export interface CatchClause extends Node {
kind: SyntaxKind.CatchClause;
parent: TryStatement;
parent?: TryStatement; // We parse missing try statements
variableDeclaration?: VariableDeclaration;
block: Block;
}

View File

@@ -1,16 +1,12 @@
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(6,5): error TS1005: 'try' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(12,5): error TS1005: 'try' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(13,5): error TS1005: 'try' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(2,5): error TS1005: 'try' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(8,5): error TS1005: 'try' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(9,5): error TS1005: 'try' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(18,5): error TS1005: 'try' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(22,5): error TS1005: 'try' expected.
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(26,5): error TS1005: 'try' expected.
==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (5 errors) ====
function fn() {
try {
} catch { // syntax error, missing '(x)'
}
catch(x) { } // error missing try
~~~~~
!!! error TS1005: 'try' expected.

View File

@@ -1,9 +1,5 @@
//// [invalidTryStatements2.ts]
function fn() {
try {
} catch { // syntax error, missing '(x)'
}
catch(x) { } // error missing try
finally{ } // potential error; can be absorbed by the 'catch'
@@ -30,10 +26,6 @@ function fn2() {
//// [invalidTryStatements2.js]
function fn() {
try {
}
catch (_ignoredCatchParameter) {
}
try {
}
catch (x) { } // error missing try

View File

@@ -1,8 +1,4 @@
function fn() {
try {
} catch { // syntax error, missing '(x)'
}
catch(x) { } // error missing try
finally{ } // potential error; can be absorbed by the 'catch'