Yield identifier value-nodes of a JS/TS object/array literal that are function-reference candidates: object property VALUES and shorthand properties (`{ handler }`), and array elements. Keys and inline methods are not references.
(coll_node)
| 1734 | |
| 1735 | |
| 1736 | def _js_dispatch_value_idents(coll_node): |
| 1737 | """Yield identifier value-nodes of a JS/TS object/array literal that are |
| 1738 | function-reference candidates: object property VALUES and shorthand properties |
| 1739 | (`{ handler }`), and array elements. Keys and inline methods are not references.""" |
| 1740 | if coll_node.type == "object": |
| 1741 | for c in coll_node.children: |
| 1742 | if c.type == "pair": |
| 1743 | val = c.child_by_field_name("value") |
| 1744 | if val is not None and val.type == "identifier": |
| 1745 | yield val |
| 1746 | elif c.type == "shorthand_property_identifier": |
| 1747 | yield c |
| 1748 | else: # array |
| 1749 | for el in coll_node.children: |
| 1750 | if el.type == "identifier": |
| 1751 | yield el |
| 1752 | |
| 1753 | |
| 1754 | def _resolve_name(node, source: bytes, config: LanguageConfig) -> str | None: |
no outgoing calls
no test coverage detected