Repository navigation
Commit cb504a0
committed
fix(compiler): taint autoMemo locals from pattern sources, for-of/in declarations, and nested scopes
collectAutoMemoLocalHazards.feed now:
- checks the binding pattern (not just the RHS) for isDeferredRefRead and
containsImportedMemberRead, catching destructuring like
`const { current } = refObj` and `const { v = ref.current } = props`;
- collects free identifiers from pattern expression positions (defaults,
computed keys) so transitive tainting propagates through them;
The walk now:
- feeds for-of/in declarations (`for (const x of hazardous)`), which were
explicitly skipped when the LHS was a VariableDeclaration;
- feeds nested VariableDeclaration nodes anywhere in the body, not only
top-level ones.1 parent 16cfb6c commit cb504a0
1 file changed
Lines changed: 23 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4243 | 4243 | | |
4244 | 4244 | | |
4245 | 4245 | | |
4246 | | - | |
4247 | | - | |
4248 | | - | |
4249 | | - | |
| 4246 | + | |
| 4247 | + | |
| 4248 | + | |
| 4249 | + | |
| 4250 | + | |
| 4251 | + | |
| 4252 | + | |
4250 | 4253 | | |
4251 | 4254 | | |
4252 | | - | |
4253 | 4255 | | |
| 4256 | + | |
| 4257 | + | |
| 4258 | + | |
| 4259 | + | |
| 4260 | + | |
| 4261 | + | |
4254 | 4262 | | |
4255 | 4263 | | |
4256 | | - | |
| 4264 | + | |
| 4265 | + | |
4257 | 4266 | | |
4258 | 4267 | | |
4259 | 4268 | | |
| |||
4276 | 4285 | | |
4277 | 4286 | | |
4278 | 4287 | | |
4279 | | - | |
4280 | | - | |
4281 | | - | |
4282 | | - | |
4283 | | - | |
4284 | | - | |
| 4288 | + | |
| 4289 | + | |
| 4290 | + | |
| 4291 | + | |
| 4292 | + | |
| 4293 | + | |
| 4294 | + | |
| 4295 | + | |
4285 | 4296 | | |
4286 | 4297 | | |
4287 | 4298 | | |
| |||
0 commit comments