( newExpr: Node, module: SourceModule )
| 1837 | } |
| 1838 | |
| 1839 | const instanceExposesComputed = ( |
| 1840 | newExpr: Node, |
| 1841 | module: SourceModule |
| 1842 | ): boolean => { |
| 1843 | const [op, parent] = operatorOf(newExpr) |
| 1844 | if ( |
| 1845 | parent?.type === "MemberExpression" && |
| 1846 | parent.object === op && |
| 1847 | !isWriteTarget(parent) && |
| 1848 | staticMemberKeyOf(parent, module) === undefined && |
| 1849 | !isDirectCallMember(parent) |
| 1850 | ) |
| 1851 | return true |
| 1852 | if ( |
| 1853 | parent?.type === "VariableDeclarator" && |
| 1854 | parent.init === op && |
| 1855 | parent.id.type === "Identifier" |
| 1856 | ) { |
| 1857 | const binding = module.scopes.bindingsById.get(parent.id) |
| 1858 | if (!binding) return true |
| 1859 | for (const ref of binding.references) { |
| 1860 | if (ref.isWrite) continue |
| 1861 | const [refOp, refUse] = operatorOf(ref.id) |
| 1862 | if ( |
| 1863 | refUse?.type === "MemberExpression" && |
| 1864 | refUse.object === refOp && |
| 1865 | !isWriteTarget(refUse) && |
| 1866 | staticMemberKeyOf(refUse, module) === undefined && |
| 1867 | !isDirectCallMember(refUse) |
| 1868 | ) |
| 1869 | return true |
| 1870 | } |
| 1871 | } |
| 1872 | return false |
| 1873 | } |
| 1874 | |
| 1875 | const classExposesMembers = ( |
| 1876 | cls: Extract<Node, { type: "ClassDeclaration" | "ClassExpression" }>, |
no test coverage detected