Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/compiler/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4553,6 +4553,9 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro
if (options.module === ModuleKind.None || options.module === ModuleKind.AMD || options.module === ModuleKind.UMD || options.module === ModuleKind.System) {
createDeprecatedDiagnostic("module", ModuleKind[options.module], /*useInstead*/ undefined, /*related*/ undefined);
}
if (options.downlevelIteration !== undefined) {
createDeprecatedDiagnostic("downlevelIteration");
}
});
}

Expand Down
1 change: 1 addition & 0 deletions src/compiler/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7431,6 +7431,7 @@ export interface CompilerOptions {
disableSourceOfProjectReferenceRedirect?: boolean;
disableSolutionSearching?: boolean;
disableReferencedProjectLoad?: boolean;
/** @deprecated */
downlevelIteration?: boolean;
emitBOM?: boolean;
emitDecoratorMetadata?: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.


!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== ES5For-of33.ts (0 errors) ====
for (var v of ['a', 'b', 'c']) {
console.log(v);
}
2 changes: 2 additions & 0 deletions tests/baselines/reference/ES5For-of33(target=es5).errors.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.


!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
!!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== ES5For-of33.ts (0 errors) ====
for (var v of ['a', 'b', 'c']) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
ES5For-of34.ts(4,6): error TS2322: Type 'string' is not assignable to type 'number'.


!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== ES5For-of34.ts (1 errors) ====
function foo() {
return { x: 0 };
Expand Down
2 changes: 2 additions & 0 deletions tests/baselines/reference/ES5For-of34(target=es5).errors.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
ES5For-of34.ts(4,6): error TS2322: Type 'string' is not assignable to type 'number'.


!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
!!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== ES5For-of34.ts (1 errors) ====
function foo() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
ES5For-of35.ts(1,13): error TS2339: Property 'x' does not exist on type 'Number'.
ES5For-of35.ts(1,23): error TS2339: Property 'y' does not exist on type 'Number'.


!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== ES5For-of35.ts (2 errors) ====
for (const {x: a = 0, y: b = 1} of [2, 3]) {
~
Expand Down
2 changes: 2 additions & 0 deletions tests/baselines/reference/ES5For-of35(target=es5).errors.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
ES5For-of35.ts(1,13): error TS2339: Property 'x' does not exist on type 'Number'.
ES5For-of35.ts(1,23): error TS2339: Property 'y' does not exist on type 'Number'.


!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
!!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== ES5For-of35.ts (2 errors) ====
for (const {x: a = 0, y: b = 1} of [2, 3]) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
ES5For-of36.ts(1,10): error TS2488: Type 'number' must have a '[Symbol.iterator]()' method that returns an iterator.


!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== ES5For-of36.ts (1 errors) ====
for (let [a = 0, b = 1] of [2, 3]) {
~~~~~~~~~~~~~~
Expand Down
2 changes: 2 additions & 0 deletions tests/baselines/reference/ES5For-of36(target=es5).errors.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
ES5For-of36.ts(1,10): error TS2548: Type 'number' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator.


!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
!!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== ES5For-of36.ts (1 errors) ====
for (let [a = 0, b = 1] of [2, 3]) {
Expand Down
20 changes: 20 additions & 0 deletions tests/baselines/reference/ES5For-of37(target=es2015).errors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.


!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== ES5For-of37.ts (0 errors) ====
// https://github.com/microsoft/TypeScript/issues/30083

for (const i of [0, 1, 2, 3, 4]) {
try {
// Ensure catch binding for the following loop is reset per iteration:
for (const j of [1, 2, 3]) {
if (i === 2) {
throw new Error('ERR');
}
}
console.log(i);
} catch (err) {
console.log('E %s %s', i, err);
}
}
2 changes: 2 additions & 0 deletions tests/baselines/reference/ES5For-of37(target=es5).errors.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.


!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
!!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== ES5For-of37.ts (0 errors) ====
// https://github.com/microsoft/TypeScript/issues/30083
Expand Down
1 change: 1 addition & 0 deletions tests/baselines/reference/api/typescript.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7033,6 +7033,7 @@ declare namespace ts {
disableSourceOfProjectReferenceRedirect?: boolean;
disableSolutionSearching?: boolean;
disableReferencedProjectLoad?: boolean;
/** @deprecated */
downlevelIteration?: boolean;
emitBOM?: boolean;
emitDecoratorMetadata?: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.


!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== arrayLiteralSpreadES5iterable.ts (0 errors) ====
function f0() {
var a = [1, 2, 3];
var a1 = [...a];
var a2 = [1, ...a];
var a3 = [1, 2, ...a];
var a4 = [...a, 1];
var a5 = [...a, 1, 2];
var a6 = [1, 2, ...a, 1, 2];
var a7 = [1, ...a, 2, ...a];
var a8 = [...a, ...a, ...a];
}

function f1() {
var a = [1, 2, 3];
var b = ["hello", ...a, true];
var b: (string | number | boolean)[];
}

function f2() {
var a = [...[...[...[...[...[]]]]]];
var b = [...[...[...[...[...[5]]]]]];
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.


!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
!!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== arrayLiteralSpreadES5iterable.ts (0 errors) ====
function f0() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.


!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== asyncArrowFunction11_es5.ts (0 errors) ====
// https://github.com/Microsoft/TypeScript/issues/24722
class A {
b = async (...args: any[]) => {
await Promise.resolve();
const obj = { ["a"]: () => this }; // computed property name after `await` triggers case
};
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.


!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
!!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== asyncArrowFunction11_es5.ts (0 errors) ====
// https://github.com/Microsoft/TypeScript/issues/24722
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.


!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== blockScopedBindingsInDownlevelGenerator.ts (0 errors) ====
function* a() {
for (const i of [1,2,3]) {
(() => i)()
yield i
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function* a() {

yield i
>yield i : any
> : ^^^
>i : number
> : ^^^^^^
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.


!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
!!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== blockScopedBindingsInDownlevelGenerator.ts (0 errors) ====
function* a() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
destructuringArrayBindingPatternAndAssignment1ES5iterable.ts(43,6): error TS2493: Tuple type '[]' of length '0' has no element at index '0'.
destructuringArrayBindingPatternAndAssignment1ES5iterable.ts(44,8): error TS2493: Tuple type '[]' of length '0' has no element at index '0'.
destructuringArrayBindingPatternAndAssignment1ES5iterable.ts(44,18): error TS2493: Tuple type '[]' of length '0' has no element at index '0'.


!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== destructuringArrayBindingPatternAndAssignment1ES5iterable.ts (3 errors) ====
/* AssignmentPattern:
* ObjectAssignmentPattern
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
destructuringArrayBindingPatternAndAssignment4.ts(5,7): error TS2488: Type 'number[] | null' must have a '[Symbol.iterator]()' method that returns an iterator.


!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== destructuringArrayBindingPatternAndAssignment4.ts (1 errors) ====
// #35497

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
destructuringArrayBindingPatternAndAssignment4.ts(5,7): error TS2548: Type 'number[] | null' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator.


!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
!!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== destructuringArrayBindingPatternAndAssignment4.ts (1 errors) ====
// #35497
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
destructuringParameterDeclaration1ES5iterable.ts(12,4): error TS2345: Argument of type '[number, number, string[][], number]' is not assignable to parameter of type '[number, number, string[][]]'.
Source has 4 element(s) but target allows only 3.
destructuringParameterDeclaration1ES5iterable.ts(23,5): error TS7010: 'b5', which lacks return-type annotation, implicitly has an 'any' return type.
Expand Down Expand Up @@ -62,6 +63,7 @@ destructuringParameterDeclaration1ES5iterable.ts(95,25): error TS7031: Binding e
destructuringParameterDeclaration1ES5iterable.ts(95,32): error TS7031: Binding element 'any' implicitly has an 'any' type.


!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== destructuringParameterDeclaration1ES5iterable.ts (60 errors) ====
// A parameter declaration may specify either an identifier or a binding pattern.
// The identifiers specified in parameter declarations and binding patterns
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
destructuringParameterDeclaration3ES5iterable.ts(12,13): error TS7019: Rest parameter 'a' implicitly has an 'any[]' type.
destructuringParameterDeclaration3ES5iterable.ts(16,14): error TS7031: Binding element 'a' implicitly has an 'any' type.
destructuringParameterDeclaration3ES5iterable.ts(16,17): error TS7031: Binding element 'b' implicitly has an 'any' type.
Expand All @@ -13,6 +14,7 @@ destructuringParameterDeclaration3ES5iterable.ts(30,5): error TS2345: Argument o
Source has 2 element(s) but target requires 3.


!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== destructuringParameterDeclaration3ES5iterable.ts (11 errors) ====
// If the parameter is a rest parameter, the parameter type is any[]
// A type annotation for a rest parameter must denote an array type.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
destructuringParameterDeclaration3ES5iterable.ts(12,13): error TS7019: Rest parameter 'a' implicitly has an 'any[]' type.
destructuringParameterDeclaration3ES5iterable.ts(16,14): error TS7031: Binding element 'a' implicitly has an 'any' type.
Expand All @@ -14,6 +15,7 @@ destructuringParameterDeclaration3ES5iterable.ts(30,5): error TS2345: Argument o
Source has 2 element(s) but target requires 3.


!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
!!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== destructuringParameterDeclaration3ES5iterable.ts (11 errors) ====
// If the parameter is a rest parameter, the parameter type is any[]
Expand Down
Loading