Clarify the use of 'using' as a variable reference expression in for loop conditions
There are currently two tests which show the fallback behaviour of `using` as variable identifiers
https://github.com/tc39/test262/blob/dc0a3516b0192a05861a08909ed7cff4fe615843/test/language/statements/using/syntax/using-invalid-arraybindingpattern-does-not-break-element-access.js#L11-L15
https://github.com/tc39/test262/blob/dc0a3516b0192a05861a08909ed7cff4fe615843/test/language/statements/await-using/syntax/await-using-invalid-arraybindingpattern-does-not-break-element-access.js#L15-L17
---
I was looking whether there were similar tests for the `for (using x of|in ...)` feature [but I could not find anything](https://github.com/search?q=repo%3Atc39%2Ftest262+%22for+%28using%22&type=code).
Running two on Safari (so webkit). The following parses as variable `using`
```javascript
for (using = 0; using < 2; using += 1) console.log(0, using)
```
This next case parses **if and only it is inside a async function**
```javascript
for (await using; using < 4; using += 1) console.log(1, using)
```
I haven't looked at the specification. It might be consulting that before adding tests for these. I can add a PR once details are known.
2 条评论