Revert "refactor(ivy): clean up (#23899)"
This reverts commit 856ee73464
.
This commit is contained in:
parent
31988a6ff9
commit
24ab0a7db0
|
@ -315,12 +315,12 @@ export class TemplateDefinitionBuilder implements t.Visitor<void>, LocalResolver
|
|||
this._creationCode.push(...i18nMessages);
|
||||
}
|
||||
|
||||
const isEmptyElement = element.outputs.length === 0 && element.children.length === 0;
|
||||
let isSelfClosingElement = element.outputs.length === 0 && element.children.length === 0;
|
||||
|
||||
|
||||
const implicit = o.variable(CONTEXT_NAME);
|
||||
|
||||
if (isEmptyElement) {
|
||||
if (isSelfClosingElement) {
|
||||
this.instruction(
|
||||
this._creationCode, element.sourceSpan, R3.element, ...trimTrailingNulls(parameters));
|
||||
} else {
|
||||
|
@ -377,7 +377,7 @@ export class TemplateDefinitionBuilder implements t.Visitor<void>, LocalResolver
|
|||
t.visitAll(this, element.children);
|
||||
}
|
||||
|
||||
if (!isEmptyElement) {
|
||||
if (!isSelfClosingElement) {
|
||||
// Finish element construction mode.
|
||||
this.instruction(
|
||||
this._creationCode, element.endSourceSpan || element.sourceSpan, R3.elementEnd);
|
||||
|
|
|
@ -133,12 +133,15 @@ describe('compiler compliance: template', () => {
|
|||
};
|
||||
|
||||
const template = `
|
||||
// ...
|
||||
template:function MyComponent_Template(rf: IDENT, $ctx$: IDENT){
|
||||
if (rf & 1) {
|
||||
$i0$.ɵEe(0,'div');
|
||||
}
|
||||
}`;
|
||||
|
||||
debugger;
|
||||
|
||||
const result = compile(files, angularFiles);
|
||||
|
||||
expectEmit(result.source, template, 'Incorrect template');
|
||||
|
|
Loading…
Reference in New Issue