Skip to content

fix(aot): @HostBinding/@HostListener on static or private members should be excluded #544

Description

@Brooooooklyn

Follow-up found while reviewing #539 / #543.

Problem

OXC's extract_host_bindings_in / extract_host_listeners_in (crates/oxc_angular_compiler/src/directive/property_decorators.rs, ~lines 1558-1650) collect @HostBinding/@HostListener members without checking member.isStatic or EcmaScriptPrivate access. ngtsc's filterToMembersWithDecorator (packages/compiler-cli/src/ngtsc/reflection/src/typescript.ts:621) excludes static members, so @HostBinding() static x / @HostListener('c') static m() are ignored upstream but produce host: { properties: { x: 'x' } } bindings in OXC.

Expected

Skip r#static and PropertyKey::PrivateIdentifier members when collecting host bindings/listeners, matching the upstream filter.

References

  • Upstream: packages/compiler-cli/src/ngtsc/reflection/src/typescript.ts (filterToMembersWithDecorator, !member.isStatic)
  • OXC: crates/oxc_angular_compiler/src/directive/property_decorators.rs (extract_host_bindings_in, extract_host_listeners_in)

No activity

Activity on this issue will appear here.

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