Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compiler): correct confusion between field and property names #38685

Closed

Commits on Sep 3, 2020

  1. fix(compiler): correct confusion between field and property names

    The `R3TargetBinder` accepts an interface for directive metadata which
    declares types for `input` and `output` objects. These types convey the
    mapping between the property names for an input or output and the
    corresponding property name on the component class. Due to
    `R3TargetBinder`'s requirements, this mapping was specified with property
    names as keys and field names as values.
    
    However, because of duck typing, this interface was accidentally satisifed
    by the opposite mapping, of field names to property names, that was produced
    in other parts of the compiler. This form more naturally represents the data
    model for inputs.
    
    Rather than accept the field -> property mapping and invert it, this commit
    introduces a new abstraction for such mappings which is bidirectional,
    eliminating the ambiguous plain object type. This mapping uses new,
    unambiguous terminology ("class property name" and "binding property name")
    and can be used to satisfy both the needs of the binder as well as those of
    the template type-checker (field -> property).
    
    A new test ensures that the input/output metadata produced by the compiler
    during analysis is directly compatible with the binder via this unambiguous
    new interface.
    alxhub committed Sep 3, 2020
    Copy the full SHA
    54b551c View commit details
    Browse the repository at this point in the history