Skip to content

Commit 2738f69

Browse files
Add importHelpers directive and fix line endings
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
1 parent 6fead46 commit 2738f69

11 files changed

Lines changed: 78 additions & 32 deletions

tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2015).errors.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
usingDeclarationsInForOfShadowing.ts(12,7): error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'.
1+
main.ts(12,7): error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'.
22

33

4-
==== usingDeclarationsInForOfShadowing.ts (1 errors) ====
4+
==== main.ts (1 errors) ====
55
class Foo {}
66

77
for (using foo of []) {
@@ -16,4 +16,8 @@ usingDeclarationsInForOfShadowing.ts(12,7): error TS2481: Cannot initialize oute
1616
var baz = 42;
1717
~~~
1818
!!! error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'.
19-
}
19+
}
20+
21+
==== tslib.d.ts (0 errors) ====
22+
export declare function __addDisposableResource<T>(env: any, value: T, async: boolean): T;
23+
export declare function __disposeResources(env: any): void;

tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2015).js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//// [tests/cases/conformance/statements/VariableStatements/usingDeclarations/usingDeclarationsInForOfShadowing.ts] ////
22

3-
//// [usingDeclarationsInForOfShadowing.ts]
3+
//// [main.ts]
44
class Foo {}
55

66
for (using foo of []) {
@@ -13,9 +13,13 @@ for (using bar of []) {
1313

1414
for (using baz of []) {
1515
var baz = 42;
16-
}
16+
}
17+
18+
//// [tslib.d.ts]
19+
export declare function __addDisposableResource<T>(env: any, value: T, async: boolean): T;
20+
export declare function __disposeResources(env: any): void;
1721

18-
//// [usingDeclarationsInForOfShadowing.js]
22+
//// [main.js]
1923
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
2024
if (value !== null && value !== void 0) {
2125
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");

tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2017).errors.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
usingDeclarationsInForOfShadowing.ts(12,7): error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'.
1+
main.ts(12,7): error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'.
22

33

4-
==== usingDeclarationsInForOfShadowing.ts (1 errors) ====
4+
==== main.ts (1 errors) ====
55
class Foo {}
66

77
for (using foo of []) {
@@ -16,4 +16,8 @@ usingDeclarationsInForOfShadowing.ts(12,7): error TS2481: Cannot initialize oute
1616
var baz = 42;
1717
~~~
1818
!!! error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'.
19-
}
19+
}
20+
21+
==== tslib.d.ts (0 errors) ====
22+
export declare function __addDisposableResource<T>(env: any, value: T, async: boolean): T;
23+
export declare function __disposeResources(env: any): void;

tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2017).js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//// [tests/cases/conformance/statements/VariableStatements/usingDeclarations/usingDeclarationsInForOfShadowing.ts] ////
22

3-
//// [usingDeclarationsInForOfShadowing.ts]
3+
//// [main.ts]
44
class Foo {}
55

66
for (using foo of []) {
@@ -13,9 +13,13 @@ for (using bar of []) {
1313

1414
for (using baz of []) {
1515
var baz = 42;
16-
}
16+
}
17+
18+
//// [tslib.d.ts]
19+
export declare function __addDisposableResource<T>(env: any, value: T, async: boolean): T;
20+
export declare function __disposeResources(env: any): void;
1721

18-
//// [usingDeclarationsInForOfShadowing.js]
22+
//// [main.js]
1923
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
2024
if (value !== null && value !== void 0) {
2125
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");

tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2022).errors.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
usingDeclarationsInForOfShadowing.ts(12,7): error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'.
1+
main.ts(12,7): error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'.
22

33

4-
==== usingDeclarationsInForOfShadowing.ts (1 errors) ====
4+
==== main.ts (1 errors) ====
55
class Foo {}
66

77
for (using foo of []) {
@@ -16,4 +16,8 @@ usingDeclarationsInForOfShadowing.ts(12,7): error TS2481: Cannot initialize oute
1616
var baz = 42;
1717
~~~
1818
!!! error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'.
19-
}
19+
}
20+
21+
==== tslib.d.ts (0 errors) ====
22+
export declare function __addDisposableResource<T>(env: any, value: T, async: boolean): T;
23+
export declare function __disposeResources(env: any): void;

tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2022).js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//// [tests/cases/conformance/statements/VariableStatements/usingDeclarations/usingDeclarationsInForOfShadowing.ts] ////
22

3-
//// [usingDeclarationsInForOfShadowing.ts]
3+
//// [main.ts]
44
class Foo {}
55

66
for (using foo of []) {
@@ -13,9 +13,13 @@ for (using bar of []) {
1313

1414
for (using baz of []) {
1515
var baz = 42;
16-
}
16+
}
17+
18+
//// [tslib.d.ts]
19+
export declare function __addDisposableResource<T>(env: any, value: T, async: boolean): T;
20+
export declare function __disposeResources(env: any): void;
1721

18-
//// [usingDeclarationsInForOfShadowing.js]
22+
//// [main.js]
1923
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
2024
if (value !== null && value !== void 0) {
2125
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");

tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es5).errors.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
usingDeclarationsInForOfShadowing.ts(12,7): error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'.
1+
main.ts(12,7): error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'.
22

33

4-
==== usingDeclarationsInForOfShadowing.ts (1 errors) ====
4+
==== main.ts (1 errors) ====
55
class Foo {}
66

77
for (using foo of []) {
@@ -16,4 +16,8 @@ usingDeclarationsInForOfShadowing.ts(12,7): error TS2481: Cannot initialize oute
1616
var baz = 42;
1717
~~~
1818
!!! error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'.
19-
}
19+
}
20+
21+
==== tslib.d.ts (0 errors) ====
22+
export declare function __addDisposableResource<T>(env: any, value: T, async: boolean): T;
23+
export declare function __disposeResources(env: any): void;

tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es5).js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//// [tests/cases/conformance/statements/VariableStatements/usingDeclarations/usingDeclarationsInForOfShadowing.ts] ////
22

3-
//// [usingDeclarationsInForOfShadowing.ts]
3+
//// [main.ts]
44
class Foo {}
55

66
for (using foo of []) {
@@ -13,9 +13,13 @@ for (using bar of []) {
1313

1414
for (using baz of []) {
1515
var baz = 42;
16-
}
16+
}
17+
18+
//// [tslib.d.ts]
19+
export declare function __addDisposableResource<T>(env: any, value: T, async: boolean): T;
20+
export declare function __disposeResources(env: any): void;
1721

18-
//// [usingDeclarationsInForOfShadowing.js]
22+
//// [main.js]
1923
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
2024
if (value !== null && value !== void 0) {
2125
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");

tests/baselines/reference/usingDeclarationsInForOfShadowing(target=esnext).errors.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
usingDeclarationsInForOfShadowing.ts(12,7): error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'.
1+
main.ts(12,7): error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'.
22

33

4-
==== usingDeclarationsInForOfShadowing.ts (1 errors) ====
4+
==== main.ts (1 errors) ====
55
class Foo {}
66

77
for (using foo of []) {
@@ -16,4 +16,8 @@ usingDeclarationsInForOfShadowing.ts(12,7): error TS2481: Cannot initialize oute
1616
var baz = 42;
1717
~~~
1818
!!! error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'.
19-
}
19+
}
20+
21+
==== tslib.d.ts (0 errors) ====
22+
export declare function __addDisposableResource<T>(env: any, value: T, async: boolean): T;
23+
export declare function __disposeResources(env: any): void;

tests/baselines/reference/usingDeclarationsInForOfShadowing(target=esnext).js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//// [tests/cases/conformance/statements/VariableStatements/usingDeclarations/usingDeclarationsInForOfShadowing.ts] ////
22

3-
//// [usingDeclarationsInForOfShadowing.ts]
3+
//// [main.ts]
44
class Foo {}
55

66
for (using foo of []) {
@@ -13,9 +13,13 @@ for (using bar of []) {
1313

1414
for (using baz of []) {
1515
var baz = 42;
16-
}
16+
}
17+
18+
//// [tslib.d.ts]
19+
export declare function __addDisposableResource<T>(env: any, value: T, async: boolean): T;
20+
export declare function __disposeResources(env: any): void;
1721

18-
//// [usingDeclarationsInForOfShadowing.js]
22+
//// [main.js]
1923
class Foo {
2024
}
2125
for (using foo of []) {

0 commit comments

Comments
 (0)