Skip to content

Commit f5ccf43

Browse files
Test updates for strict initialization (#62958)
1 parent c574e40 commit f5ccf43

File tree

2,295 files changed

+20290
-21417
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,295 files changed

+20290
-21417
lines changed

tests/baselines/reference/ES5For-ofTypeCheck11.errors.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ES5For-ofTypeCheck11.ts(3,6): error TS2322: Type 'string | number' is not assign
33

44

55
==== ES5For-ofTypeCheck11.ts (1 errors) ====
6-
var union: string | number[];
6+
declare var union: string | number[];
77
var v: string;
88
for (v of union) { }
99
~

tests/baselines/reference/ES5For-ofTypeCheck11.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
//// [tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck11.ts] ////
22

33
//// [ES5For-ofTypeCheck11.ts]
4-
var union: string | number[];
4+
declare var union: string | number[];
55
var v: string;
66
for (v of union) { }
77

88
//// [ES5For-ofTypeCheck11.js]
9-
var union;
109
var v;
1110
for (var _i = 0, union_1 = union; _i < union_1.length; _i++) {
1211
v = union_1[_i];
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
//// [tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck11.ts] ////
22

33
=== ES5For-ofTypeCheck11.ts ===
4-
var union: string | number[];
5-
>union : Symbol(union, Decl(ES5For-ofTypeCheck11.ts, 0, 3))
4+
declare var union: string | number[];
5+
>union : Symbol(union, Decl(ES5For-ofTypeCheck11.ts, 0, 11))
66

77
var v: string;
88
>v : Symbol(v, Decl(ES5For-ofTypeCheck11.ts, 1, 3))
99

1010
for (v of union) { }
1111
>v : Symbol(v, Decl(ES5For-ofTypeCheck11.ts, 1, 3))
12-
>union : Symbol(union, Decl(ES5For-ofTypeCheck11.ts, 0, 3))
12+
>union : Symbol(union, Decl(ES5For-ofTypeCheck11.ts, 0, 11))
1313

tests/baselines/reference/ES5For-ofTypeCheck11.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//// [tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck11.ts] ////
22

33
=== ES5For-ofTypeCheck11.ts ===
4-
var union: string | number[];
4+
declare var union: string | number[];
55
>union : string | number[]
66
> : ^^^^^^^^^^^^^^^^^
77

tests/baselines/reference/ES5For-ofTypeCheck14.errors.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ES5For-ofTypeCheck14.ts(2,17): error TS2802: Type 'Set<number>' can only be iter
22

33

44
==== ES5For-ofTypeCheck14.ts (1 errors) ====
5-
var union: string | Set<number>
5+
declare var union: string | Set<number>
66
for (const e of union) { }
77
~~~~~
88
!!! error TS2802: Type 'Set<number>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
//// [tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck14.ts] ////
22

33
//// [ES5For-ofTypeCheck14.ts]
4-
var union: string | Set<number>
4+
declare var union: string | Set<number>
55
for (const e of union) { }
66

77
//// [ES5For-ofTypeCheck14.js]
8-
var union;
98
for (var _i = 0, union_1 = union; _i < union_1.length; _i++) {
109
var e = union_1[_i];
1110
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
//// [tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck14.ts] ////
22

33
=== ES5For-ofTypeCheck14.ts ===
4-
var union: string | Set<number>
5-
>union : Symbol(union, Decl(ES5For-ofTypeCheck14.ts, 0, 3))
4+
declare var union: string | Set<number>
5+
>union : Symbol(union, Decl(ES5For-ofTypeCheck14.ts, 0, 11))
66
>Set : Symbol(Set, Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
77

88
for (const e of union) { }
99
>e : Symbol(e, Decl(ES5For-ofTypeCheck14.ts, 1, 10))
10-
>union : Symbol(union, Decl(ES5For-ofTypeCheck14.ts, 0, 3))
10+
>union : Symbol(union, Decl(ES5For-ofTypeCheck14.ts, 0, 11))
1111

tests/baselines/reference/ES5For-ofTypeCheck14.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//// [tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck14.ts] ////
22

33
=== ES5For-ofTypeCheck14.ts ===
4-
var union: string | Set<number>
4+
declare var union: string | Set<number>
55
>union : string | Set<number>
66
> : ^^^^^^^^^^^^^^^^^^^^
77

tests/baselines/reference/ES5For-ofTypeCheck7.errors.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ES5For-ofTypeCheck7.ts(2,15): error TS2461: Type 'number' is not an array type.
22

33

44
==== ES5For-ofTypeCheck7.ts (1 errors) ====
5-
var union: string | number;
5+
declare var union: string | number;
66
for (var v of union) { }
77
~~~~~
88
!!! error TS2461: Type 'number' is not an array type.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
//// [tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck7.ts] ////
22

33
//// [ES5For-ofTypeCheck7.ts]
4-
var union: string | number;
4+
declare var union: string | number;
55
for (var v of union) { }
66

77
//// [ES5For-ofTypeCheck7.js]
8-
var union;
98
for (var _i = 0, union_1 = union; _i < union_1.length; _i++) {
109
var v = union_1[_i];
1110
}

0 commit comments

Comments
 (0)