Repository navigation
Commit af380a4
committed
fix(compiler): detect hidden ref dependency in assignment destructuring
Assignment destructuring like `({ current } = ref)` was not detected as a
hidden dependency in effect setup, unlike the equivalent variable declarator
`const { current } = ref`.
Two gaps:
1. In classify (strong-effects.js), AssignmentExpression with an ObjectPattern
left side fell through to escaped, making isValueRef return false.
2. In the AssignmentExpression visitor (strong-mode.js), the ObjectPattern
branch did not check for hidden ref dependencies the way bindDeclaration
does for VariableDeclarator.
Add an AssignmentExpression case to classify that returns early (no escape)
when the left side is an ObjectPattern, and mirror bindDeclaration's
hiddenDependency check in the AssignmentExpression handler.1 parent af3044c commit af380a4
2 files changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
802 | 802 | | |
803 | 803 | | |
804 | 804 | | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
805 | 808 | | |
806 | 809 | | |
807 | 810 | | |
| |||
| 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 | + | |
5221 | 5235 | | |
5222 | 5236 | | |
5223 | 5237 | | |
| |||
0 commit comments