Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
129 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#### Fix missing parentheses on `async` inside `for..of` (#10781 by @fisker) | ||
|
||
<!-- prettier-ignore --> | ||
```jsx | ||
// Input | ||
for ((async) of []); | ||
|
||
// Prettier stable | ||
for (async of []); | ||
|
||
// Prettier stable (second format) | ||
SyntaxError: Unexpected token, expected "=>" (1:15) | ||
> 1 | for (async of []); | ||
|
||
// Prettier main | ||
for ((async) of []); | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`async-identifier.js [espree] format 1`] = ` | ||
"Unexpected token [ (6:23) | ||
4 | | ||
5 | async function f() { | ||
> 6 | for await (async of []); | ||
| ^ | ||
7 | for await ((async) of []); | ||
8 | for await ((foo) of async); | ||
9 | for await ((foo) of []) async;" | ||
`; | ||
exports[`async-identifier.js format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["babel", "flow", "typescript"] | ||
printWidth: 80 | ||
| printWidth | ||
=====================================input====================================== | ||
for ((async) of []); | ||
for ((foo) of async); | ||
for ((foo) of []) async; | ||
async function f() { | ||
for await (async of []); | ||
for await ((async) of []); | ||
for await ((foo) of async); | ||
for await ((foo) of []) async; | ||
} | ||
=====================================output===================================== | ||
for ((async) of []); | ||
for (foo of async); | ||
for (foo of []) async; | ||
async function f() { | ||
for await (async of []); | ||
for await (async of []); | ||
for await (foo of async); | ||
for await (foo of []) async; | ||
} | ||
================================================================================ | ||
`; |
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,10 @@ | ||
for ((async) of []); | ||
for ((foo) of async); | ||
for ((foo) of []) async; | ||
|
||
async function f() { | ||
for await (async of []); | ||
for await ((async) of []); | ||
for await ((foo) of async); | ||
for await ((foo) of []) async; | ||
} |
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 @@ | ||
run_spec(__dirname, ["babel", "flow", "typescript"], { | ||
errors: { espree: ["async-identifier.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
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