fix(ivy): ensure [style] and [class] bindings are placed in the same instruction (#26126)

PR Close #26126
This commit is contained in:
Matias Niemelä
2018-09-26 23:14:24 -07:00
committed by Alex Rickabaugh
parent 9523991a9b
commit 7cf5807100
2 changed files with 57 additions and 14 deletions

View File

@ -549,21 +549,22 @@ export class TemplateDefinitionBuilder implements t.Visitor<void>, LocalResolver
const stylingInput = mapBasedStyleInput || mapBasedClassInput;
if (stylingInput) {
const params: o.Expression[] = [];
let value: AST;
if (mapBasedClassInput) {
value = mapBasedClassInput.value.visit(this._valueConverter);
} else if (mapBasedStyleInput) {
params.push(o.NULL_EXPR);
}
if (mapBasedStyleInput) {
value = mapBasedStyleInput.value.visit(this._valueConverter);
}
this.updateInstruction(stylingInput.sourceSpan, R3.elementStylingMap, () => {
params.push(this.convertPropertyBinding(implicit, value, true));
return [indexLiteral, ...params];
const params: o.Expression[] = [indexLiteral];
if (mapBasedClassInput) {
const mapBasedClassValue = mapBasedClassInput.value.visit(this._valueConverter);
params.push(this.convertPropertyBinding(implicit, mapBasedClassValue, true));
} else if (mapBasedStyleInput) {
params.push(o.NULL_EXPR);
}
if (mapBasedStyleInput) {
const mapBasedStyleValue = mapBasedStyleInput.value.visit(this._valueConverter);
params.push(this.convertPropertyBinding(implicit, mapBasedStyleValue, true));
}
return params;
});
}