(
cls: Extract<Node, { type: "ClassDeclaration" | "ClassExpression" }>,
module: SourceModule,
ctx: ThisReadsContext
)
| 1873 | } |
| 1874 | |
| 1875 | const classExposesMembers = ( |
| 1876 | cls: Extract<Node, { type: "ClassDeclaration" | "ClassExpression" }>, |
| 1877 | module: SourceModule, |
| 1878 | ctx: ThisReadsContext |
| 1879 | ): boolean => { |
| 1880 | const clsBinding = |
| 1881 | cls.type === "ClassDeclaration" ? |
| 1882 | cls.id && module.scopes.bindingsById.get(cls.id) |
| 1883 | : (() => { |
| 1884 | const [op, parent] = operatorOf(cls) |
| 1885 | return ( |
| 1886 | parent?.type === "VariableDeclarator" && |
| 1887 | parent.init === op && |
| 1888 | parent.id.type === "Identifier" |
| 1889 | ) ? |
| 1890 | module.scopes.bindingsById.get(parent.id) |
| 1891 | : undefined |
| 1892 | })() |
| 1893 | if (!clsBinding || clsBinding.writes.length > 0) return true |
| 1894 | return classBindingExposes(clsBinding, module, ctx, new Set(), new Set()) |
| 1895 | } |
| 1896 | |
| 1897 | const classBindingExposes = ( |
| 1898 | binding: Binding, |
no test coverage detected