Skip to content

fix(aot): @HostListener on accessor fields is silently dropped #546

Description

@Brooooooklyn

Minor parity gap found while reviewing #544 / #545.

Problem

OXC's extract_host_listeners_in (crates/oxc_angular_compiler/src/directive/property_decorators.rs, ~line 1646) only matches ClassElement::MethodDefinition and ClassElement::PropertyDefinition, so a @HostListener on an accessor keyword field (accessor x = ...) or accessor handler is silently dropped. Upstream getMembersOfClass reflects TS accessor declarations as PropertyDeclarations, so filterToMembersWithDecorator sees them.

Expected

Include ClassElement::AccessorProperty in the host-listener element match (or document the divergence). Rare in practice.

References

  • Upstream: packages/compiler-cli/src/ngtsc/reflection/src/typescript.ts (reflectClassMember / getMembersOfClass — TS accessor is a PropertyDeclaration)
  • OXC: crates/oxc_angular_compiler/src/directive/property_decorators.rs (extract_host_listeners_in element match)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions