Repository navigation
Commit 6256940
committed
fix(codemod): walk through container nodes in declaredBeforeUse hoist check
The runs check for function-like nodes only looked at the immediate
parent, missing parenthesized IIFEs (whose parent is
ParenthesizedExpression, not CallExpression) and methods/arrows nested
inside object or array arguments of a call.
Walk up through ParenthesizedExpression, PropertyAssignment,
ObjectLiteralExpression, ArrayLiteralExpression, and SpreadElement
before checking whether the ancestor is a call whose callee or
argument the function is.1 parent 34b5e90 commit 6256940
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
863 | 863 | | |
864 | 864 | | |
865 | 865 | | |
866 | | - | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
867 | 877 | | |
868 | 878 | | |
869 | | - | |
| 879 | + | |
870 | 880 | | |
871 | 881 | | |
872 | 882 | | |
| |||
0 commit comments