diff --git a/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2015).errors.txt b/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2015).errors.txt index 53b53496d45..198c10b1b75 100644 --- a/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2015).errors.txt +++ b/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2015).errors.txt @@ -1,7 +1,7 @@ -usingDeclarationsInForOfShadowing.ts(12,7): error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'. +main.ts(12,7): error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'. -==== usingDeclarationsInForOfShadowing.ts (1 errors) ==== +==== main.ts (1 errors) ==== class Foo {} for (using foo of []) { @@ -16,4 +16,8 @@ usingDeclarationsInForOfShadowing.ts(12,7): error TS2481: Cannot initialize oute var baz = 42; ~~~ !!! error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'. - } \ No newline at end of file + } + +==== tslib.d.ts (0 errors) ==== + export declare function __addDisposableResource(env: any, value: T, async: boolean): T; + export declare function __disposeResources(env: any): void; \ No newline at end of file diff --git a/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2015).js b/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2015).js index e3df5affa54..f7b53c21cc4 100644 --- a/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2015).js +++ b/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2015).js @@ -1,6 +1,6 @@ //// [tests/cases/conformance/statements/VariableStatements/usingDeclarations/usingDeclarationsInForOfShadowing.ts] //// -//// [usingDeclarationsInForOfShadowing.ts] +//// [main.ts] class Foo {} for (using foo of []) { @@ -13,9 +13,13 @@ for (using bar of []) { for (using baz of []) { var baz = 42; -} +} -//// [usingDeclarationsInForOfShadowing.js] +//// [tslib.d.ts] +export declare function __addDisposableResource(env: any, value: T, async: boolean): T; +export declare function __disposeResources(env: any): void; + +//// [main.js] var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) { if (value !== null && value !== void 0) { if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); diff --git a/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2017).errors.txt b/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2017).errors.txt index 53b53496d45..198c10b1b75 100644 --- a/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2017).errors.txt +++ b/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2017).errors.txt @@ -1,7 +1,7 @@ -usingDeclarationsInForOfShadowing.ts(12,7): error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'. +main.ts(12,7): error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'. -==== usingDeclarationsInForOfShadowing.ts (1 errors) ==== +==== main.ts (1 errors) ==== class Foo {} for (using foo of []) { @@ -16,4 +16,8 @@ usingDeclarationsInForOfShadowing.ts(12,7): error TS2481: Cannot initialize oute var baz = 42; ~~~ !!! error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'. - } \ No newline at end of file + } + +==== tslib.d.ts (0 errors) ==== + export declare function __addDisposableResource(env: any, value: T, async: boolean): T; + export declare function __disposeResources(env: any): void; \ No newline at end of file diff --git a/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2017).js b/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2017).js index e3df5affa54..f7b53c21cc4 100644 --- a/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2017).js +++ b/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2017).js @@ -1,6 +1,6 @@ //// [tests/cases/conformance/statements/VariableStatements/usingDeclarations/usingDeclarationsInForOfShadowing.ts] //// -//// [usingDeclarationsInForOfShadowing.ts] +//// [main.ts] class Foo {} for (using foo of []) { @@ -13,9 +13,13 @@ for (using bar of []) { for (using baz of []) { var baz = 42; -} +} -//// [usingDeclarationsInForOfShadowing.js] +//// [tslib.d.ts] +export declare function __addDisposableResource(env: any, value: T, async: boolean): T; +export declare function __disposeResources(env: any): void; + +//// [main.js] var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) { if (value !== null && value !== void 0) { if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); diff --git a/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2022).errors.txt b/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2022).errors.txt index 53b53496d45..198c10b1b75 100644 --- a/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2022).errors.txt +++ b/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2022).errors.txt @@ -1,7 +1,7 @@ -usingDeclarationsInForOfShadowing.ts(12,7): error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'. +main.ts(12,7): error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'. -==== usingDeclarationsInForOfShadowing.ts (1 errors) ==== +==== main.ts (1 errors) ==== class Foo {} for (using foo of []) { @@ -16,4 +16,8 @@ usingDeclarationsInForOfShadowing.ts(12,7): error TS2481: Cannot initialize oute var baz = 42; ~~~ !!! error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'. - } \ No newline at end of file + } + +==== tslib.d.ts (0 errors) ==== + export declare function __addDisposableResource(env: any, value: T, async: boolean): T; + export declare function __disposeResources(env: any): void; \ No newline at end of file diff --git a/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2022).js b/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2022).js index e3df5affa54..f7b53c21cc4 100644 --- a/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2022).js +++ b/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es2022).js @@ -1,6 +1,6 @@ //// [tests/cases/conformance/statements/VariableStatements/usingDeclarations/usingDeclarationsInForOfShadowing.ts] //// -//// [usingDeclarationsInForOfShadowing.ts] +//// [main.ts] class Foo {} for (using foo of []) { @@ -13,9 +13,13 @@ for (using bar of []) { for (using baz of []) { var baz = 42; -} +} -//// [usingDeclarationsInForOfShadowing.js] +//// [tslib.d.ts] +export declare function __addDisposableResource(env: any, value: T, async: boolean): T; +export declare function __disposeResources(env: any): void; + +//// [main.js] var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) { if (value !== null && value !== void 0) { if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); diff --git a/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es5).errors.txt b/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es5).errors.txt index 53b53496d45..198c10b1b75 100644 --- a/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es5).errors.txt +++ b/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es5).errors.txt @@ -1,7 +1,7 @@ -usingDeclarationsInForOfShadowing.ts(12,7): error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'. +main.ts(12,7): error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'. -==== usingDeclarationsInForOfShadowing.ts (1 errors) ==== +==== main.ts (1 errors) ==== class Foo {} for (using foo of []) { @@ -16,4 +16,8 @@ usingDeclarationsInForOfShadowing.ts(12,7): error TS2481: Cannot initialize oute var baz = 42; ~~~ !!! error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'. - } \ No newline at end of file + } + +==== tslib.d.ts (0 errors) ==== + export declare function __addDisposableResource(env: any, value: T, async: boolean): T; + export declare function __disposeResources(env: any): void; \ No newline at end of file diff --git a/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es5).js b/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es5).js index c0a0e2db4ef..85ca43a0988 100644 --- a/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es5).js +++ b/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=es5).js @@ -1,6 +1,6 @@ //// [tests/cases/conformance/statements/VariableStatements/usingDeclarations/usingDeclarationsInForOfShadowing.ts] //// -//// [usingDeclarationsInForOfShadowing.ts] +//// [main.ts] class Foo {} for (using foo of []) { @@ -13,9 +13,13 @@ for (using bar of []) { for (using baz of []) { var baz = 42; -} +} -//// [usingDeclarationsInForOfShadowing.js] +//// [tslib.d.ts] +export declare function __addDisposableResource(env: any, value: T, async: boolean): T; +export declare function __disposeResources(env: any): void; + +//// [main.js] var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) { if (value !== null && value !== void 0) { if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); diff --git a/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=esnext).errors.txt b/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=esnext).errors.txt index 53b53496d45..198c10b1b75 100644 --- a/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=esnext).errors.txt +++ b/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=esnext).errors.txt @@ -1,7 +1,7 @@ -usingDeclarationsInForOfShadowing.ts(12,7): error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'. +main.ts(12,7): error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'. -==== usingDeclarationsInForOfShadowing.ts (1 errors) ==== +==== main.ts (1 errors) ==== class Foo {} for (using foo of []) { @@ -16,4 +16,8 @@ usingDeclarationsInForOfShadowing.ts(12,7): error TS2481: Cannot initialize oute var baz = 42; ~~~ !!! error TS2481: Cannot initialize outer scoped variable 'baz' in the same scope as block scoped declaration 'baz'. - } \ No newline at end of file + } + +==== tslib.d.ts (0 errors) ==== + export declare function __addDisposableResource(env: any, value: T, async: boolean): T; + export declare function __disposeResources(env: any): void; \ No newline at end of file diff --git a/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=esnext).js b/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=esnext).js index 04a612dbd67..2e74200a0d3 100644 --- a/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=esnext).js +++ b/tests/baselines/reference/usingDeclarationsInForOfShadowing(target=esnext).js @@ -1,6 +1,6 @@ //// [tests/cases/conformance/statements/VariableStatements/usingDeclarations/usingDeclarationsInForOfShadowing.ts] //// -//// [usingDeclarationsInForOfShadowing.ts] +//// [main.ts] class Foo {} for (using foo of []) { @@ -13,9 +13,13 @@ for (using bar of []) { for (using baz of []) { var baz = 42; -} +} -//// [usingDeclarationsInForOfShadowing.js] +//// [tslib.d.ts] +export declare function __addDisposableResource(env: any, value: T, async: boolean): T; +export declare function __disposeResources(env: any): void; + +//// [main.js] class Foo { } for (using foo of []) { diff --git a/tests/cases/conformance/statements/VariableStatements/usingDeclarations/usingDeclarationsInForOfShadowing.ts b/tests/cases/conformance/statements/VariableStatements/usingDeclarations/usingDeclarationsInForOfShadowing.ts index 2eafdebadd9..2a51a6231bd 100644 --- a/tests/cases/conformance/statements/VariableStatements/usingDeclarations/usingDeclarationsInForOfShadowing.ts +++ b/tests/cases/conformance/statements/VariableStatements/usingDeclarations/usingDeclarationsInForOfShadowing.ts @@ -1,8 +1,10 @@ // @target: esnext,es2022,es2017,es2015,es5 -// @module: esnext +// @module: commonjs // @lib: esnext +// @importHelpers: true // @noTypesAndSymbols: true +// @filename: main.ts class Foo {} for (using foo of []) { @@ -15,4 +17,8 @@ for (using bar of []) { for (using baz of []) { var baz = 42; -} \ No newline at end of file +} + +// @filename: tslib.d.ts +export declare function __addDisposableResource(env: any, value: T, async: boolean): T; +export declare function __disposeResources(env: any): void;