refactor(core): rename synthetic host property and listener instructions (#37145)

This commit updates synthetic host property and listener instruction names to better align with other instructions.
The `ɵɵupdateSyntheticHostBinding` instruction was renamed to `ɵɵsyntheticHostProperty` (to match the `ɵɵhostProperty`
instruction name) and `ɵɵcomponentHostSyntheticListener` was renamed to `ɵɵsyntheticHostListener` since this
instruction is generated for both Components and Directives (so 'component' is removed from the name).
This PR is a followup after PR #35568.

PR Close #37145
This commit is contained in:
Andrew Kushnir
2020-05-15 15:33:00 -07:00
parent eae13e42f3
commit d72b1e44c6
11 changed files with 34 additions and 34 deletions

View File

@ -32,11 +32,11 @@ export class Identifiers {
static select: o.ExternalReference = {name: 'ɵɵselect', moduleName: CORE};
static advance: o.ExternalReference = {name: 'ɵɵadvance', moduleName: CORE};
static updateSyntheticHostBinding:
o.ExternalReference = {name: 'ɵɵupdateSyntheticHostBinding', moduleName: CORE};
static syntheticHostProperty:
o.ExternalReference = {name: 'ɵɵsyntheticHostProperty', moduleName: CORE};
static componentHostSyntheticListener:
o.ExternalReference = {name: 'ɵɵcomponentHostSyntheticListener', moduleName: CORE};
static syntheticHostListener:
o.ExternalReference = {name: 'ɵɵsyntheticHostListener', moduleName: CORE};
static attribute: o.ExternalReference = {name: 'ɵɵattribute', moduleName: CORE};

View File

@ -640,7 +640,7 @@ function createHostBindingsFunction(
propertyBindings.push(instructionParams);
} else if (instruction === R3.attribute) {
attributeBindings.push(instructionParams);
} else if (instruction === R3.updateSyntheticHostBinding) {
} else if (instruction === R3.syntheticHostProperty) {
syntheticHostBindings.push(instructionParams);
} else {
updateStatements.push(o.importExpr(instruction).callFn(instructionParams).toStmt());
@ -657,7 +657,7 @@ function createHostBindingsFunction(
if (syntheticHostBindings.length > 0) {
updateStatements.push(
chainedInstruction(R3.updateSyntheticHostBinding, syntheticHostBindings).toStmt());
chainedInstruction(R3.syntheticHostProperty, syntheticHostBindings).toStmt());
}
// since we're dealing with directives/components and both have hostBinding
@ -738,7 +738,7 @@ function getBindingNameAndInstruction(binding: ParsedProperty):
// host bindings that have a synthetic property (e.g. @foo) should always be rendered
// in the context of the component and not the parent. Therefore there is a special
// compatibility instruction available for this purpose.
instruction = R3.updateSyntheticHostBinding;
instruction = R3.syntheticHostProperty;
} else {
instruction = R3.hostProperty;
}
@ -768,8 +768,7 @@ function createHostListeners(eventBindings: ParsedEvent[], name?: string): o.Sta
});
if (syntheticListeners.length > 0) {
instructions.push(
chainedInstruction(R3.componentHostSyntheticListener, syntheticListeners).toStmt());
instructions.push(chainedInstruction(R3.syntheticHostListener, syntheticListeners).toStmt());
}
if (listeners.length > 0) {