(node *ast.Node)
| 1819 | } |
| 1820 | |
| 1821 | func (b *Binder) bindAssignmentTargetFlow(node *ast.Node) { |
| 1822 | switch node.Kind { |
| 1823 | case ast.KindArrayLiteralExpression: |
| 1824 | for _, e := range node.Elements() { |
| 1825 | if e.Kind == ast.KindSpreadElement { |
| 1826 | b.bindAssignmentTargetFlow(e.Expression()) |
| 1827 | } else { |
| 1828 | b.bindDestructuringTargetFlow(e) |
| 1829 | } |
| 1830 | } |
| 1831 | case ast.KindObjectLiteralExpression: |
| 1832 | for _, p := range node.Properties() { |
| 1833 | switch p.Kind { |
| 1834 | case ast.KindPropertyAssignment: |
| 1835 | b.bindDestructuringTargetFlow(p.Initializer()) |
| 1836 | case ast.KindShorthandPropertyAssignment: |
| 1837 | b.bindAssignmentTargetFlow(p.AsShorthandPropertyAssignment().Name()) |
| 1838 | case ast.KindSpreadAssignment: |
| 1839 | b.bindAssignmentTargetFlow(p.Expression()) |
| 1840 | } |
| 1841 | } |
| 1842 | default: |
| 1843 | if isNarrowableReference(node) { |
| 1844 | b.currentFlow = b.createFlowMutation(ast.FlowFlagsAssignment, b.currentFlow, node) |
| 1845 | } |
| 1846 | } |
| 1847 | } |
| 1848 | |
| 1849 | func (b *Binder) bindDestructuringTargetFlow(node *ast.Node) { |
| 1850 | if ast.IsBinaryExpression(node) && node.AsBinaryExpression().OperatorToken.Kind == ast.KindEqualsToken { |
no test coverage detected