Skip to content

fix(js): build abstract classes and class expressions as class nodes (#158) - #208

Merged
DaisukeYoda merged 1 commit into
mainfrom
fix/158-abstract-class-clones
Oct 15, 2026
Merged

DaisukeYoda merged 1 commit into
mainfrom
fix/158-abstract-class-clones

Conversation

@DaisukeYoda

Copy link
Copy Markdown
Member

Fixes #158.

The parser built only class_declaration as a class node. An abstract_class_declaration and a class expression fell through to the generic builder, so clone detection never offered them as class fragments.

Both forms now go through the class builder: an abstract class as NodeClass, and a class expression as NodeClassExpression. The class builder now also keeps type_parameters, so an import used only in a type parameter constraint or default is no longer reported as unused. This also applies to plain classes. The CFG builder treats a class expression like a class declaration.

Effects:

@DaisukeYoda
DaisukeYoda force-pushed the fix/158-abstract-class-clones branch from 0f169e2 to b4e87e4 Compare October 15, 2026 02:17
@DaisukeYoda
DaisukeYoda merged commit 146e4f6 into main Oct 15, 2026
4 checks passed
@DaisukeYoda
DaisukeYoda deleted the fix/158-abstract-class-clones branch October 15, 2026 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ts: abstract classes and class expressions are missing from clone detection

1 participant