Repository navigation
Commit 7b5812b
committed
fix(compiler): use top-level module bindings in ambient-read classifier
isUnwitnessedAmbientRead used _moduleBoundNames, which collects every
binding from every scope in the module (including nested function
parameters and locals). A sibling function parameter named 'location'
would incorrectly shadow the host global, causing @for rows reading
location.pathname to keep PURE and stay stale after navigation.
Replace with _moduleTopLevelBoundNames that collects only top-level
module-scope bindings (declarations, function/class names, imports),
so nested parameters in sibling functions no longer mask globals.
The existing _moduleBoundNames set is retained for
setupCanScheduleSelfUpdate, where the conservative all-scopes check
is intentionally correct.1 parent 4004610 commit 7b5812b
2 files changed
Lines changed: 41 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5218 | 5218 | | |
5219 | 5219 | | |
5220 | 5220 | | |
| 5221 | + | |
| 5222 | + | |
| 5223 | + | |
| 5224 | + | |
| 5225 | + | |
| 5226 | + | |
| 5227 | + | |
| 5228 | + | |
| 5229 | + | |
| 5230 | + | |
| 5231 | + | |
| 5232 | + | |
| 5233 | + | |
| 5234 | + | |
| 5235 | + | |
| 5236 | + | |
| 5237 | + | |
| 5238 | + | |
| 5239 | + | |
| 5240 | + | |
| 5241 | + | |
| 5242 | + | |
| 5243 | + | |
| 5244 | + | |
| 5245 | + | |
| 5246 | + | |
| 5247 | + | |
| 5248 | + | |
| 5249 | + | |
| 5250 | + | |
| 5251 | + | |
| 5252 | + | |
5221 | 5253 | | |
5222 | 5254 | | |
5223 | 5255 | | |
| |||
5635 | 5667 | | |
5636 | 5668 | | |
5637 | 5669 | | |
5638 | | - | |
| 5670 | + | |
5639 | 5671 | | |
5640 | 5672 | | |
5641 | 5673 | | |
| |||
10477 | 10509 | | |
10478 | 10510 | | |
10479 | 10511 | | |
| 10512 | + | |
| 10513 | + | |
| 10514 | + | |
10480 | 10515 | | |
10481 | 10516 | | |
10482 | 10517 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
216 | 221 | | |
217 | 222 | | |
218 | 223 | | |
| |||
0 commit comments