Closed mhofman closed 1 year ago
Feel free to adapt the spirit of these changes if you have a better way of expressing them, but I think it's important to allow nested
for-await-of
s, unless there's a reason we shouldn't.
Agreed and I thought that was allowed by this PR. I'll have to double check where things went wrong.
What's the status of this? Is it ready to merge? I'm looking forward it, helping reduce the effort to triage await safety. Thanks.
I need to publish a release.
I'm looking forward it, helping reduce the effort to triage await safety.
It is now released as of version 0.3.0
of the eslint-plugin.
According to @erights and @dtribble, an
await
in the top-level of afor-await-of
block is safe since there is always an interleaving point to both enter and exit the block. It's somewhat equivalent to the body of an async function.While working on this I realized we were not disallowing for-await-of statements where await expressions would be disallowed, so this PR fixes that as well.
Tested manually.