Repository navigation
Commit 145f0b6
committed
fix(compiler): handle AwaitExpression in settled() to prevent false zero-delay classification
An AwaitExpression whose argument is an opaque promise (e.g. await load())
yields past paint, so it is not zero-delay. Previously, settled() fell
through to nonPromise() which correctly identifies await results as
non-thenables but does not answer whether evaluating the await completes
without yielding.
Add an explicit AwaitExpression case to settled() that recurses into the
argument. This makes settled(await load()) false when load() is opaque,
which prevents await (null ?? await load()) and await (true && await load())
from being misclassified as zero-delay awaits.1 parent 6f167ed commit 145f0b6
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
| 208 | + | |
207 | 209 | | |
208 | 210 | | |
209 | 211 | | |
| |||
0 commit comments