Skip to content

Commit 90ea10e

Browse files
committed
Accept baselines
1 parent e349943 commit 90ea10e

12 files changed

Lines changed: 63 additions & 31 deletions

tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(138,13): error T
3434
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(141,32): error TS1005: '{' expected.
3535
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(143,13): error TS1005: 'try' expected.
3636
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,24): error TS1109: Expression expected.
37-
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,30): error TS1005: '(' expected.
37+
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,30): error TS1005: '{' expected.
3838
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,31): error TS2304: Cannot find name 'Property'.
3939
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(166,13): error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'.
4040
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(180,40): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
@@ -323,7 +323,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS
323323
~~~~~
324324
!!! error TS1109: Expression expected.
325325
~
326-
!!! error TS1005: '(' expected.
326+
!!! error TS1005: '{' expected.
327327
~~~~~~~~
328328
!!! error TS2304: Cannot find name 'Property'.
329329
retVal += c.Member();

tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ var BasicFeatures = (function () {
441441
var xx = c;
442442
retVal += ;
443443
try { }
444-
catch () { }
444+
catch (_ignoredCatchParameter) { }
445445
Property;
446446
retVal += c.Member();
447447
retVal += xx.Foo() ? 0 : 1;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//// [emitter.ignoredCatchParameter.esnext.ts]
2+
function fn() {
3+
try {} catch {}
4+
}
5+
6+
7+
//// [emitter.ignoredCatchParameter.esnext.js]
8+
function fn() {
9+
try { }
10+
catch { }
11+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
=== tests/cases/conformance/emitter/esnext/noCatchParameter/emitter.ignoredCatchParameter.esnext.ts ===
2+
function fn() {
3+
>fn : Symbol(fn, Decl(emitter.ignoredCatchParameter.esnext.ts, 0, 0))
4+
5+
try {} catch {}
6+
}
7+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
=== tests/cases/conformance/emitter/esnext/noCatchParameter/emitter.ignoredCatchParameter.esnext.ts ===
2+
function fn() {
3+
>fn : () => void
4+
5+
try {} catch {}
6+
}
7+

tests/baselines/reference/invalidTryStatements.errors.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(8,23): error TS1196: Catch clause variable cannot have a type annotation.
22
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(9,23): error TS1196: Catch clause variable cannot have a type annotation.
33
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(10,23): error TS1196: Catch clause variable cannot have a type annotation.
4+
tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(14,13): error TS2714: Duplicate identifier '_ignoredCatchParameter'. Compiler uses the parameter declaration '_ignoredCatchParameter' to bind ignored catched exceptions.
45

56

6-
==== tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts (3 errors) ====
7+
==== tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts (4 errors) ====
78
function fn() {
89
try {
910
} catch (x) {
@@ -20,6 +21,13 @@ tests/cases/conformance/statements/tryStatements/invalidTryStatements.ts(10,23):
2021
try { } catch (y: string) { }
2122
~~~~~~
2223
!!! error TS1196: Catch clause variable cannot have a type annotation.
24+
25+
26+
try { } catch {
27+
let _ignoredCatchParameter; // Should error since we downlevel emit this variable.
28+
~~~~~~~~~~~~~~~~~~~~~~
29+
!!! error TS2714: Duplicate identifier '_ignoredCatchParameter'. Compiler uses the parameter declaration '_ignoredCatchParameter' to bind ignored catched exceptions.
30+
}
2331
}
2432

2533

tests/baselines/reference/invalidTryStatements.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ function fn() {
99
try { } catch (z: any) { }
1010
try { } catch (a: number) { }
1111
try { } catch (y: string) { }
12+
13+
14+
try { } catch {
15+
let _ignoredCatchParameter; // Should error since we downlevel emit this variable.
16+
}
1217
}
1318

1419

@@ -27,4 +32,8 @@ function fn() {
2732
catch (a) { }
2833
try { }
2934
catch (y) { }
35+
try { }
36+
catch (_ignoredCatchParameter) {
37+
var _ignoredCatchParameter = void 0; // Should error since we downlevel emit this variable.
38+
}
3039
}

tests/baselines/reference/invalidTryStatements2.errors.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(3,13): error TS1005: '(' expected.
21
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(6,5): error TS1005: 'try' expected.
32
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(12,5): error TS1005: 'try' expected.
43
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(13,5): error TS1005: 'try' expected.
54
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(22,5): error TS1005: 'try' expected.
65
tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts(26,5): error TS1005: 'try' expected.
76

87

9-
==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (6 errors) ====
8+
==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (5 errors) ====
109
function fn() {
1110
try {
1211
} catch { // syntax error, missing '(x)'
13-
~
14-
!!! error TS1005: '(' expected.
1512
}
1613

1714
catch(x) { } // error missing try

tests/baselines/reference/invalidTryStatements2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function fn2() {
3232
function fn() {
3333
try {
3434
}
35-
catch () {
35+
catch (_ignoredCatchParameter) {
3636
}
3737
try {
3838
}

tests/baselines/reference/tryStatements.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
//// [tryStatements.ts]
22
function fn() {
3-
try {
3+
try { } catch { }
44

5-
} catch (x) {
6-
var x: any;
7-
}
5+
try { } catch (x) { var x: any; }
86

97
try { } finally { }
108

11-
try { }catch(z){ } finally { }
9+
try { } catch(z) { } finally { }
1210
}
1311

1412
//// [tryStatements.js]
1513
function fn() {
16-
try {
17-
}
14+
try { }
15+
catch (_ignoredCatchParameter) { }
16+
try { }
1817
catch (x) {
1918
var x;
2019
}

0 commit comments

Comments
 (0)