Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print parentheses around identifier
let
where necessary
- Loading branch information
Showing
4 changed files
with
115 additions
and
3 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
31 changes: 31 additions & 0 deletions
31
packages/babel-generator/test/fixtures/edgecase/let-identifier/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,31 @@ | ||
/* ExpressionStatement */ | ||
let; | ||
\u006cet[x]; | ||
(let)[x]; | ||
a[let[x]]; | ||
|
||
/* ForStatement */ | ||
for (let;;); | ||
for (\u006cet[x];;); | ||
for ((let)[x];;); | ||
for (a[let[x]];;); | ||
|
||
/* ForInStatement */ | ||
for (let in {}); | ||
for (\u006cet[x] in {}); | ||
for ((let)[x] in {}); | ||
for (a[let[x]] in {}); | ||
|
||
/* ForOfStatement { await: false } */ | ||
for ((let) of []); | ||
for (\u006cet of []); | ||
for ((let)[x] of []); | ||
for (a[let] of []); | ||
|
||
/* ForOfStatement { await: true } */ | ||
async () => { | ||
for await ((let) of []); | ||
for await (\u006cet of []); | ||
for await ((let)[x] of []); | ||
for await (a[let] of []); | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/babel-generator/test/fixtures/edgecase/let-identifier/options.json
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,4 @@ | ||
{ | ||
"sourceType": "script", | ||
"strictMode": false | ||
} |
46 changes: 46 additions & 0 deletions
46
packages/babel-generator/test/fixtures/edgecase/let-identifier/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,46 @@ | ||
/* ExpressionStatement */ | ||
let; | ||
(let)[x]; | ||
(let)[x]; | ||
a[let[x]]; | ||
/* ForStatement */ | ||
|
||
for (let;;); | ||
|
||
for ((let)[x];;); | ||
|
||
for ((let)[x];;); | ||
|
||
for (a[let[x]];;); | ||
/* ForInStatement */ | ||
|
||
|
||
for (let in {}); | ||
|
||
for ((let)[x] in {}); | ||
|
||
for ((let)[x] in {}); | ||
|
||
for (a[let[x]] in {}); | ||
/* ForOfStatement { await: false } */ | ||
|
||
|
||
for ((let) of []); | ||
|
||
for ((let) of []); | ||
|
||
for ((let)[x] of []); | ||
|
||
for (a[let] of []); | ||
/* ForOfStatement { await: true } */ | ||
|
||
|
||
async () => { | ||
for await ((let) of []); | ||
|
||
for await ((let) of []); | ||
|
||
for await ((let)[x] of []); | ||
|
||
for await (a[let] of []); | ||
}; |