Skip to content

Commit 1e31acc

Browse files
committed
Deprecate downlevelIteration
1 parent 3fc1f26 commit 1e31acc

File tree

60 files changed

+681
-0
lines changed

Some content is hidden

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

60 files changed

+681
-0
lines changed

src/compiler/program.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4547,6 +4547,9 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
45474547
if (options.module === ModuleKind.None || options.module === ModuleKind.AMD || options.module === ModuleKind.UMD || options.module === ModuleKind.System) {
45484548
createDeprecatedDiagnostic("module", ModuleKind[options.module], /*useInstead*/ undefined, /*related*/ undefined);
45494549
}
4550+
if (options.downlevelIteration) {
4551+
createDeprecatedDiagnostic("downlevelIteration");
4552+
}
45504553
});
45514554
}
45524555

src/compiler/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7431,6 +7431,7 @@ export interface CompilerOptions {
74317431
disableSourceOfProjectReferenceRedirect?: boolean;
74327432
disableSolutionSearching?: boolean;
74337433
disableReferencedProjectLoad?: boolean;
7434+
/** @deprecated */
74347435
downlevelIteration?: boolean;
74357436
emitBOM?: boolean;
74367437
emitDecoratorMetadata?: boolean;

src/harness/evaluatorImpl.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export function evaluateTypeScript(source: string | { files: vfs.FileSet; rootFi
4141
module: ts.ModuleKind.CommonJS,
4242
strict: false,
4343
lib: ["lib.esnext.d.ts", "lib.dom.d.ts"],
44+
ignoreDeprecations: "6.0",
4445
...options,
4546
};
4647
const host = new fakes.CompilerHost(fs, compilerOptions);
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
2+
3+
4+
!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
5+
==== ES5For-of33.ts (0 errors) ====
6+
for (var v of ['a', 'b', 'c']) {
7+
console.log(v);
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
2+
3+
4+
!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
5+
==== ES5For-of33.ts (0 errors) ====
6+
for (var v of ['a', 'b', 'c']) {
7+
console.log(v);
8+
}

tests/baselines/reference/ES5For-of34(target=es2015).errors.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
12
ES5For-of34.ts(4,6): error TS2322: Type 'string' is not assignable to type 'number'.
23

34

5+
!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
46
==== ES5For-of34.ts (1 errors) ====
57
function foo() {
68
return { x: 0 };

tests/baselines/reference/ES5For-of34(target=es5).errors.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
12
ES5For-of34.ts(4,6): error TS2322: Type 'string' is not assignable to type 'number'.
23

34

5+
!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
46
==== ES5For-of34.ts (1 errors) ====
57
function foo() {
68
return { x: 0 };

tests/baselines/reference/ES5For-of35(target=es2015).errors.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
12
ES5For-of35.ts(1,13): error TS2339: Property 'x' does not exist on type 'Number'.
23
ES5For-of35.ts(1,23): error TS2339: Property 'y' does not exist on type 'Number'.
34

45

6+
!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
57
==== ES5For-of35.ts (2 errors) ====
68
for (const {x: a = 0, y: b = 1} of [2, 3]) {
79
~

tests/baselines/reference/ES5For-of35(target=es5).errors.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
12
ES5For-of35.ts(1,13): error TS2339: Property 'x' does not exist on type 'Number'.
23
ES5For-of35.ts(1,23): error TS2339: Property 'y' does not exist on type 'Number'.
34

45

6+
!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
57
==== ES5For-of35.ts (2 errors) ====
68
for (const {x: a = 0, y: b = 1} of [2, 3]) {
79
~

tests/baselines/reference/ES5For-of36(target=es2015).errors.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
12
ES5For-of36.ts(1,10): error TS2488: Type 'number' must have a '[Symbol.iterator]()' method that returns an iterator.
23

34

5+
!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
46
==== ES5For-of36.ts (1 errors) ====
57
for (let [a = 0, b = 1] of [2, 3]) {
68
~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)