forked from babel/babel
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow redeclaration of loop variable in body (babel#11088)
- Loading branch information
1 parent
5727f03
commit 87d20e3
Showing
13 changed files
with
83 additions
and
4 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
5 changes: 5 additions & 0 deletions
5
...test/fixtures/for-of-as-array/for-of-partial-redeclaration-in-body-array-pattern/input.js
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,5 @@ | ||
for (const [head, ...tail] of array) { | ||
const head = 1; | ||
console.log(tail); | ||
console.log(head); | ||
} |
8 changes: 8 additions & 0 deletions
8
...est/fixtures/for-of-as-array/for-of-partial-redeclaration-in-body-array-pattern/output.js
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,8 @@ | ||
for (let _i = 0, _array = array; _i < _array.length; _i++) { | ||
const [head, ...tail] = _array[_i]; | ||
{ | ||
const head = 1; | ||
console.log(tail); | ||
console.log(head); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...est/fixtures/for-of-as-array/for-of-partial-redeclaration-in-body-object-pattern/input.js
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,5 @@ | ||
for (const [type, ...rest] of array) { | ||
const type = 1; | ||
console.log(rest); | ||
console.log(type); | ||
} |
8 changes: 8 additions & 0 deletions
8
...st/fixtures/for-of-as-array/for-of-partial-redeclaration-in-body-object-pattern/output.js
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,8 @@ | ||
for (let _i = 0, _array = array; _i < _array.length; _i++) { | ||
const [type, ...rest] = _array[_i]; | ||
{ | ||
const type = 1; | ||
console.log(rest); | ||
console.log(type); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...-for-of/test/fixtures/for-of-as-array/for-of-redeclaration-in-body-array-pattern/input.js
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,6 @@ | ||
for (const [head, ...tail] of array) { | ||
const head = 1; | ||
let tail; | ||
console.log(tail); | ||
console.log(head); | ||
} |
9 changes: 9 additions & 0 deletions
9
...for-of/test/fixtures/for-of-as-array/for-of-redeclaration-in-body-array-pattern/output.js
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 @@ | ||
for (let _i = 0, _array = array; _i < _array.length; _i++) { | ||
const [head, ...tail] = _array[_i]; | ||
{ | ||
const head = 1; | ||
let tail; | ||
console.log(tail); | ||
console.log(head); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...for-of/test/fixtures/for-of-as-array/for-of-redeclaration-in-body-object-pattern/input.js
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,6 @@ | ||
for (const {type, ...rest} of array) { | ||
const type = 1; | ||
let rest; | ||
console.log(rest); | ||
console.log(type); | ||
} |
12 changes: 12 additions & 0 deletions
12
...or-of/test/fixtures/for-of-as-array/for-of-redeclaration-in-body-object-pattern/output.js
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 @@ | ||
for (let _i = 0, _array = array; _i < _array.length; _i++) { | ||
const { | ||
type, | ||
...rest | ||
} = _array[_i]; | ||
{ | ||
const type = 1; | ||
let rest; | ||
console.log(rest); | ||
console.log(type); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...ugin-transform-for-of/test/fixtures/for-of-as-array/for-of-redeclaration-in-body/input.js
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,3 @@ | ||
for (const elm of array) { | ||
const elm = 2; | ||
} |
6 changes: 6 additions & 0 deletions
6
...gin-transform-for-of/test/fixtures/for-of-as-array/for-of-redeclaration-in-body/output.js
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,6 @@ | ||
for (let _i = 0, _array = array; _i < _array.length; _i++) { | ||
const elm = _array[_i]; | ||
{ | ||
const elm = 2; | ||
} | ||
} |
File renamed without changes.
File renamed without changes.