-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove error for using 'for...of' in ES3/ES5
- Loading branch information
1 parent
b38743c
commit 5b46f5f
Showing
51 changed files
with
1,043 additions
and
578 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
tests/cases/conformance/statements/for-ofStatements/ES5For-of1.ts(1,1): error TS2482: 'for...of' statements are only available when targeting ECMAScript 6 or higher. | ||
tests/cases/conformance/statements/for-ofStatements/ES5For-of1.ts(2,5): error TS2304: Cannot find name 'console'. | ||
|
||
|
||
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of1.ts (1 errors) ==== | ||
for (var v of ['a', 'b', 'c']) { | ||
~~~ | ||
!!! error TS2482: 'for...of' statements are only available when targeting ECMAScript 6 or higher. | ||
console.log(v); | ||
~~~~~~~ | ||
!!! error TS2304: Cannot find name 'console'. | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of14.ts === | ||
for (const v of []) { | ||
>v : any | ||
>[] : undefined[] | ||
|
||
var x = v; | ||
>x : any | ||
>v : any | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of15.ts === | ||
for (let v of []) { | ||
>v : any | ||
>[] : undefined[] | ||
|
||
v; | ||
>v : any | ||
|
||
for (const v of []) { | ||
>v : any | ||
>[] : undefined[] | ||
|
||
var x = v; | ||
>x : any | ||
>v : any | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of16.ts === | ||
for (let v of []) { | ||
>v : any | ||
>[] : undefined[] | ||
|
||
v; | ||
>v : any | ||
|
||
for (let v of []) { | ||
>v : any | ||
>[] : undefined[] | ||
|
||
var x = v; | ||
>x : any | ||
>v : any | ||
|
||
v++; | ||
>v++ : number | ||
>v : any | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of18.ts === | ||
for (let v of []) { | ||
>v : any | ||
>[] : undefined[] | ||
|
||
v; | ||
>v : any | ||
} | ||
for (let v of []) { | ||
>v : any | ||
>[] : undefined[] | ||
|
||
v; | ||
>v : any | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of19.ts === | ||
for (let v of []) { | ||
>v : any | ||
>[] : undefined[] | ||
|
||
v; | ||
>v : any | ||
|
||
function foo() { | ||
>foo : () => void | ||
|
||
for (const v of []) { | ||
>v : any | ||
>[] : undefined[] | ||
|
||
v; | ||
>v : any | ||
} | ||
} | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of2.ts === | ||
for (var v of []) { | ||
>v : any | ||
>[] : undefined[] | ||
|
||
var x = v; | ||
>x : any | ||
>v : any | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
tests/cases/conformance/statements/for-ofStatements/ES5For-of20.ts(1,1): error TS2482: 'for...of' statements are only available when targeting ECMAScript 6 or higher. | ||
tests/cases/conformance/statements/for-ofStatements/ES5For-of20.ts(4,15): error TS1155: 'const' declarations must be initialized | ||
|
||
|
||
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of20.ts (1 errors) ==== | ||
for (let v of []) { | ||
~~~ | ||
!!! error TS2482: 'for...of' statements are only available when targeting ECMAScript 6 or higher. | ||
let v; | ||
for (let v of [v]) { | ||
const v; | ||
~ | ||
!!! error TS1155: 'const' declarations must be initialized | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of21.ts === | ||
for (let v of []) { | ||
>v : any | ||
>[] : undefined[] | ||
|
||
for (let _i of []) { } | ||
>_i : any | ||
>[] : undefined[] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
tests/cases/conformance/statements/for-ofStatements/ES5For-of22.ts(1,1): error TS2482: 'for...of' statements are only available when targeting ECMAScript 6 or higher. | ||
tests/cases/conformance/statements/for-ofStatements/ES5For-of22.ts(3,5): error TS2304: Cannot find name 'console'. | ||
|
||
|
||
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of22.ts (1 errors) ==== | ||
for (var x of [1, 2, 3]) { | ||
~~~ | ||
!!! error TS2482: 'for...of' statements are only available when targeting ECMAScript 6 or higher. | ||
let _a = 0; | ||
console.log(x); | ||
~~~~~~~ | ||
!!! error TS2304: Cannot find name 'console'. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
tests/cases/conformance/statements/for-ofStatements/ES5For-of23.ts(1,1): error TS2482: 'for...of' statements are only available when targeting ECMAScript 6 or higher. | ||
tests/cases/conformance/statements/for-ofStatements/ES5For-of23.ts(3,5): error TS2304: Cannot find name 'console'. | ||
|
||
|
||
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of23.ts (1 errors) ==== | ||
for (var x of [1, 2, 3]) { | ||
~~~ | ||
!!! error TS2482: 'for...of' statements are only available when targeting ECMAScript 6 or higher. | ||
var _a = 0; | ||
console.log(x); | ||
~~~~~~~ | ||
!!! error TS2304: Cannot find name 'console'. | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of26.ts === | ||
for (var [a = 0, b = 1] of [2, 3]) { | ||
>a : number | ||
>b : number | ||
>[2, 3] : number[] | ||
|
||
a; | ||
>a : number | ||
|
||
b; | ||
>b : number | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.