Commit 8c39527
committed
fix: keep space between 'for' and 'await' regardless of spaceAfterForKeyword (#692)
`gen_for_of_stmt` emitted the configured space between the `for` keyword
and the next token *before* the `await` marker, then appended the literal
`"await "`. With `forOfStatement.spaceAfterForKeyword: false` that
produced `forawait (...)`, which is not valid syntax.
Always insert the space between `for` and `await`, and let the config
flag control the space between the keyword sequence and the open paren:
- spaceAfterForKeyword: true -> 'for await (...)' / 'for (...)'
- spaceAfterForKeyword: false -> 'for await(...)' / 'for(...)'1 parent f7dd1f3 commit 8c39527
2 files changed
Lines changed: 15 additions & 4 deletions
File tree
- src/generation
- tests/specs/statements/forOfStatement
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5137 | 5137 | | |
5138 | 5138 | | |
5139 | 5139 | | |
5140 | | - | |
5141 | | - | |
5142 | | - | |
5143 | 5140 | | |
5144 | 5141 | | |
5145 | | - | |
| 5142 | + | |
| 5143 | + | |
| 5144 | + | |
| 5145 | + | |
| 5146 | + | |
5146 | 5147 | | |
5147 | 5148 | | |
5148 | 5149 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
0 commit comments