refactor(ivy): remove short instruction names as they provide no value (#25493)

PR Close #25493
This commit is contained in:
Miško Hevery
2018-08-14 16:48:58 -07:00
committed by Jason Aden
parent 92c8752d0a
commit 9ee6702fa9
30 changed files with 1059 additions and 1036 deletions

View File

@ -140,7 +140,7 @@ describe('mock_compiler', () => {
expectEmit(
result.source, `
// TODO: this comment should not be taken into account
$r3$T(0, "Hello!");
$r3$text(0, "Hello!");
// TODO: this comment should not be taken into account
`,
'todo comments should be ignored');

View File

@ -53,17 +53,17 @@ describe('compiler compliance', () => {
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$E(0, "div", $c1$);
$r3$s($c2$);
$r3$NS();
$r3$E(1, "svg");
$r3$Ee(2, "circle", $c3$);
$r3$.ɵe();
$r3$NH();
$r3$E(3, "p");
$r3$T(4, "test");
$r3$.ɵe();
$r3$.ɵe();
$r3$elementStart(0, "div", $c1$);
$r3$elementStyling($c2$);
$r3$namespaceSVG();
$r3$elementStart(1, "svg");
$r3$.ɵelement(2, "circle", $c3$);
$r3$.ɵelementEnd();
$r3$namespaceHTML();
$r3$elementStart(3, "p");
$r3$text(4, "test");
$r3$.ɵelementEnd();
$r3$.ɵelementEnd();
}
}
`;
@ -104,17 +104,17 @@ describe('compiler compliance', () => {
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$E(0, "div", $c1$);
$r3$s($c2$);
$r3$NM();
$r3$E(1, "math");
$r3$Ee(2, "infinity");
$r3$.ɵe();
$r3$NH();
$r3$E(3, "p");
$r3$T(4, "test");
$r3$.ɵe();
$r3$.ɵe();
$r3$elementStart(0, "div", $c1$);
$r3$elementStyling($c2$);
$r3$namespaceMathML();
$r3$elementStart(1, "math");
$r3$.ɵelement(2, "infinity");
$r3$.ɵelementEnd();
$r3$namespaceHTML();
$r3$elementStart(3, "p");
$r3$text(4, "test");
$r3$.ɵelementEnd();
$r3$.ɵelementEnd();
}
}
`;
@ -155,14 +155,14 @@ describe('compiler compliance', () => {
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$E(0, "div", $c1$);
$r3$s($c2$);
$r3$T(1, "Hello ");
$r3$E(2, "b");
$r3$T(3, "World");
$r3$.ɵe();
$r3$T(4, "!");
$r3$.ɵe();
$r3$elementStart(0, "div", $c1$);
$r3$elementStyling($c2$);
$r3$text(1, "Hello ");
$r3$elementStart(2, "b");
$r3$text(3, "World");
$r3$.ɵelementEnd();
$r3$text(4, "!");
$r3$.ɵelementEnd();
}
}
`;
@ -204,13 +204,13 @@ describe('compiler compliance', () => {
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$E(0, "div", $e0_attrs$);
$r3$T(1, "Hello ");
$r3$E(2, "b");
$r3$T(3, "World");
$r3$.ɵe();
$r3$T(4, "!");
$r3$.ɵe();
$r3$elementStart(0, "div", $e0_attrs$);
$r3$text(1, "Hello ");
$r3$elementStart(2, "b");
$r3$text(3, "World");
$r3$.ɵelementEnd();
$r3$text(4, "!");
$r3$.ɵelementEnd();
}
}
`;
@ -246,10 +246,10 @@ describe('compiler compliance', () => {
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
i0.ɵEC(0);
i0.ɵE(1, "span");
i0.ɵT(2, "in a ");
i0.ɵe();
i0.ɵT(3, "container");
i0.ɵelementStart(1, "span");
i0.ɵtext(2, "in a ");
i0.ɵelementEnd();
i0.ɵtext(3, "container");
i0.ɵeC();
}
}
@ -317,10 +317,10 @@ describe('compiler compliance', () => {
const template = `
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$Ee(0, "div");
$r3$.ɵelement(0, "div");
}
if (rf & 2) {
$r3$p(0, "id", $r3$.ɵb(ctx.id));
$r3$elementProperty(0, "id", $r3$.ɵbind(ctx.id));
}
}
`;
@ -362,15 +362,15 @@ describe('compiler compliance', () => {
const template = `
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$Ee(0, "div");
$r3$Pp(1,"pipe");
$r3$.ɵrS(10);
$r3$.ɵelement(0, "div");
$r3$.ɵpipe(1,"pipe");
$r3$.ɵreserveSlots(10);
}
if (rf & 2) {
$r3$p(0, "ternary", $r3$.ɵb((ctx.cond ? $r3$f1(6, _c0, ctx.a): _c1)));
$r3$p(0, "pipe", $r3$.ɵb($r3$.ɵpb3(1, 4, ctx.value, 1, 2)));
$r3$p(0, "and", $r3$.ɵb((ctx.cond && $r3$f1(8, _c0, ctx.b))));
$r3$p(0, "or", $r3$.ɵb((ctx.cond || $r3$f1(10, _c0, ctx.c))));
$r3$elementProperty(0, "ternary", $r3$.ɵbind((ctx.cond ? $r3$pureFunction1(6, _c0, ctx.a): _c1)));
$r3$elementProperty(0, "pipe", $r3$.ɵbind($r3$.ɵpipeBind3(1, 4, ctx.value, 1, 2)));
$r3$elementProperty(0, "and", $r3$.ɵbind((ctx.cond && $r3$pureFunction1(8, _c0, ctx.b))));
$r3$elementProperty(0, "or", $r3$.ɵbind((ctx.cond || $r3$pureFunction1(10, _c0, ctx.c))));
}
}
`;
@ -416,14 +416,14 @@ describe('compiler compliance', () => {
features: [$r3$.ɵPublicFeature],
template:function MyComponent_Template(rf,ctx){
if (rf & 1) {
$r3$E(0, "div");
$r3$s(_c0, _c1);
$r3$.ɵe();
$r3$elementStart(0, "div");
$r3$elementStyling(_c0, _c1);
$r3$.ɵelementEnd();
}
if (rf & 2) {
$r3$sp(0, 0, ctx.color);
$r3$cp(0, 0, ctx.error);
$r3$sa(0);
$r3$elementStylingProp(0, 0, ctx.color);
$r3$elementClassProp(0, 0, ctx.error);
$r3$elementStylingApply(0);
}
}
});
@ -469,7 +469,7 @@ describe('compiler compliance', () => {
features: [$r3$.ɵPublicFeature],
template: function ChildComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$T(0, "child-view");
$r3$text(0, "child-view");
}
}
});`;
@ -495,8 +495,8 @@ describe('compiler compliance', () => {
features: [$r3$.ɵPublicFeature],
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$Ee(0, "child", $c1$);
$r3$T(1, "!");
$r3$.ɵelement(0, "child", $c1$);
$r3$text(1, "!");
}
},
directives: [ChildComponent, SomeDirective]
@ -580,7 +580,7 @@ describe('compiler compliance', () => {
selectors: [["", "hostBindingDir", ""]],
factory: function HostBindingDir_Factory(t) { return new (t || HostBindingDir)(); },
hostBindings: function HostBindingDir_HostBindings(dirIndex, elIndex) {
$r3$p(elIndex, "id", $r3$.ɵb($r3$d(dirIndex).dirId));
$r3$elementProperty(elIndex, "id", $r3$.ɵbind($r3$loadDirective(dirIndex).dirId));
},
features: [$r3$.ɵPublicFeature]
});
@ -629,14 +629,14 @@ describe('compiler compliance', () => {
const $c2$ = ["if", ""];
function MyComponent_li_Template_2(rf, ctx) {
if (rf & 1) {
$r3$E(0, "li");
$r3$T(1);
$r3$.ɵe();
$r3$elementStart(0, "li");
$r3$text(1);
$r3$.ɵelementEnd();
}
if (rf & 2) {
const $myComp$ = $r3$x();
const $foo$ = $r3$.ɵr(1);
$r3$.ɵt(1, $r3$.ɵi2("", $myComp$.salutation, " ", $foo$, ""));
const $myComp$ = $r3$nextContext();
const $foo$ = $r3$.ɵreference(1);
$r3$.ɵtextBinding(1, $r3$.ɵinterpolation2("", $myComp$.salutation, " ", $foo$, ""));
}
}
@ -647,9 +647,9 @@ describe('compiler compliance', () => {
features: [$r3$.ɵPublicFeature],
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$E(0, "ul", null, $c1$);
$r3$C(2, MyComponent_li_Template_2, null, $c2$);
$r3$.ɵe();
$r3$elementStart(0, "ul", null, $c1$);
$r3$container(2, MyComponent_li_Template_2, null, $c2$);
$r3$.ɵelementEnd();
}
},
directives:[IfDirective]
@ -707,11 +707,11 @@ describe('compiler compliance', () => {
features: [$r3$.ɵPublicFeature],
template: function MyApp_Template(rf, ctx) {
if (rf & 1) {
$r3$Ee(0, "my-comp");
$r3$.ɵrS(2);
$r3$.ɵelement(0, "my-comp");
$r3$.ɵreserveSlots(2);
}
if (rf & 2) {
$r3$p(0, "names", $r3$.ɵb($r3$f1(2, $e0_ff$, ctx.customName)));
$r3$elementProperty(0, "names", $r3$.ɵbind($r3$pureFunction1(2, $e0_ff$, ctx.customName)));
}
},
directives: [MyComp]
@ -787,13 +787,13 @@ describe('compiler compliance', () => {
features: [$r3$.ɵPublicFeature],
template: function MyApp_Template(rf, ctx) {
if (rf & 1) {
$r3$Ee(0, "my-comp");
$r3$.ɵrS(10);
$r3$.ɵelement(0, "my-comp");
$r3$.ɵreserveSlots(10);
}
if (rf & 2) {
$r3$p(
$r3$elementProperty(
0, "names",
$r3$.ɵb($r3$fV(10, $e0_ff$, [ctx.n0, ctx.n1, ctx.n2, ctx.n3, ctx.n4, ctx.n5, ctx.n6, ctx.n7, ctx.n8])));
$r3$.ɵbind($r3$pureFunctionV(10, $e0_ff$, [ctx.n0, ctx.n1, ctx.n2, ctx.n3, ctx.n4, ctx.n5, ctx.n6, ctx.n7, ctx.n8])));
}
},
directives: [MyComp]
@ -849,11 +849,11 @@ describe('compiler compliance', () => {
features: [$r3$.ɵPublicFeature],
template: function MyApp_Template(rf, ctx) {
if (rf & 1) {
$r3$Ee(0, "object-comp");
$r3$.ɵrS(2);
$r3$.ɵelement(0, "object-comp");
$r3$.ɵreserveSlots(2);
}
if (rf & 2) {
$r3$p(0, "config", $r3$.ɵb($r3$f1(2, $e0_ff$, ctx.name)));
$r3$elementProperty(0, "config", $r3$.ɵbind($r3$pureFunction1(2, $e0_ff$, ctx.name)));
}
},
directives: [ObjectComp]
@ -915,13 +915,13 @@ describe('compiler compliance', () => {
features: [$r3$.ɵPublicFeature],
template: function MyApp_Template(rf, ctx) {
if (rf & 1) {
$r3$Ee(0, "nested-comp");
$r3$.ɵrS(7);
$r3$.ɵelement(0, "nested-comp");
$r3$.ɵreserveSlots(7);
}
if (rf & 2) {
$r3$p(
$r3$elementProperty(
0, "config",
$r3$.ɵb($r3$f2(7, $e0_ff_2$, ctx.name, $r3$f1(4, $e0_ff_1$, $r3$f1(2, $e0_ff$, ctx.duration)))));
$r3$.ɵbind($r3$pureFunction2(7, $e0_ff_2$, ctx.name, $r3$pureFunction1(4, $e0_ff_1$, $r3$pureFunction1(2, $e0_ff$, ctx.duration)))));
}
},
directives: [NestedComp]
@ -973,10 +973,10 @@ describe('compiler compliance', () => {
features: [$r3$.ɵPublicFeature],
template: function SimpleComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$.ɵpD();
$r3$E(0, "div");
$r3$P(1);
$r3$.ɵe();
$r3$.ɵprojectionDef();
$r3$elementStart(0, "div");
$r3$projection(1);
$r3$.ɵelementEnd();
}
}
});`;
@ -994,13 +994,13 @@ describe('compiler compliance', () => {
features: [$r3$.ɵPublicFeature],
template: function ComplexComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$.ɵpD($c1$, $c2$);
$r3$E(0, "div", $c3$);
$r3$P(1, 1);
$r3$.ɵe();
$r3$E(2, "div", $c4$);
$r3$P(3, 2);
$r3$.ɵe();
$r3$.ɵprojectionDef($c1$, $c2$);
$r3$elementStart(0, "div", $c3$);
$r3$projection(1, 1);
$r3$.ɵelementEnd();
$r3$elementStart(2, "div", $c4$);
$r3$projection(3, 2);
$r3$.ɵelementEnd();
}
}
});
@ -1060,16 +1060,16 @@ describe('compiler compliance', () => {
features: [$r3$.ɵPublicFeature],
viewQuery: function ViewQueryComponent_Query(rf, ctx) {
if (rf & 1) {
$r3$Q(0, SomeDirective, true);
$r3$query(0, SomeDirective, true);
}
if (rf & 2) {
var $tmp$;
($r3$.ɵqR(($tmp$ = $r3$.ɵld(0))) && (ctx.someDir = $tmp$.first));
($r3$.ɵqueryRefresh(($tmp$ = $r3$.ɵload(0))) && (ctx.someDir = $tmp$.first));
}
},
template: function ViewQueryComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$Ee(1, "div", $e0_attrs$);
$r3$.ɵelement(1, "div", $e0_attrs$);
}
},
directives: function () { return [SomeDirective]; }
@ -1124,22 +1124,22 @@ describe('compiler compliance', () => {
return new (t || ContentQueryComponent)();
},
contentQueries: function ContentQueryComponent_ContentQueries() {
$r3$Qr($r3$Q(null, SomeDirective, true));
$r3$Qr($r3$Q(null, SomeDirective, false));
$r3$.ɵregisterContentQuery($r3$query(null, SomeDirective, true));
$r3$.ɵregisterContentQuery($r3$query(null, SomeDirective, false));
},
contentQueriesRefresh: function ContentQueryComponent_ContentQueriesRefresh(dirIndex, queryStartIndex) {
const instance = $r3$d(dirIndex);
const instance = $r3$loadDirective(dirIndex);
var $tmp$;
($r3$.ɵqR(($tmp$ = $r3$ql(queryStartIndex))) && ($instance$.someDir = $tmp$.first));
($r3$.ɵqR(($tmp$ = $r3$ql((queryStartIndex + 1)))) && ($instance$.someDirList = $tmp$));
($r3$.ɵqueryRefresh(($tmp$ = $r3$.ɵloadQueryList(queryStartIndex))) && ($instance$.someDir = $tmp$.first));
($r3$.ɵqueryRefresh(($tmp$ = $r3$.ɵloadQueryList((queryStartIndex + 1)))) && ($instance$.someDirList = $tmp$));
},
features: [$r3$.ɵPublicFeature],
template: function ContentQueryComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$.ɵpD();
$r3$E(0, "div");
$r3$P(1);
$r3$.ɵe();
$r3$.ɵprojectionDef();
$r3$elementStart(0, "div");
$r3$projection(1);
$r3$.ɵelementEnd();
}
}
});`;
@ -1221,18 +1221,18 @@ describe('compiler compliance', () => {
features: [$r3$.ɵPublicFeature],
template: function MyApp_Template(rf, ctx) {
if (rf & 1) {
$r3$T(0);
$r3$Pp(1, "myPurePipe");
$r3$Pp(2, "myPipe");
$r3$E(3, "p");
$r3$T(4);
$r3$Pp(5, "myPipe");
$r3$.ɵe();
$r3$.ɵrS(15);
$r3$text(0);
$r3$.ɵpipe(1, "myPurePipe");
$r3$.ɵpipe(2, "myPipe");
$r3$elementStart(3, "p");
$r3$text(4);
$r3$.ɵpipe(5, "myPipe");
$r3$.ɵelementEnd();
$r3$.ɵreserveSlots(15);
}
if (rf & 2) {
$r3$.ɵt(0, $r3$.ɵi1("", $r3$.ɵpb2(1, 3, $r3$.ɵpb2(2, 6, ctx.name, ctx.size), ctx.size), ""));
$r3$.ɵt(4, $r3$.ɵi1("", $r3$.ɵpbV(5, 13 , $r3$f1(15, $c0$, ctx.name)), ""));
$r3$.ɵtextBinding(0, $r3$.ɵinterpolation1("", $r3$.ɵpipeBind2(1, 3, $r3$.ɵpipeBind2(2, 6, ctx.name, ctx.size), ctx.size), ""));
$r3$.ɵtextBinding(4, $r3$.ɵinterpolation1("", $r3$.ɵpipeBindV(5, 13 , $r3$pureFunction1(15, $c0$, ctx.name)), ""));
}
},
pipes: [MyPurePipe, MyPipe]
@ -1272,12 +1272,12 @@ describe('compiler compliance', () => {
features: [$r3$.ɵPublicFeature],
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$Ee(0, "input", null, $c1$);
$r3$T(2);
$r3$.ɵelement(0, "input", null, $c1$);
$r3$text(2);
}
if (rf & 2) {
const $user$ = $r3$.ɵr(1);
$r3$.ɵt(2, $r3$.ɵi1("Hello ", $user$.value, "!"));
const $user$ = $r3$.ɵreference(1);
$r3$.ɵtextBinding(2, $r3$.ɵinterpolation1("Hello ", $user$.value, "!"));
}
}
});
@ -1328,32 +1328,32 @@ describe('compiler compliance', () => {
const $c4$ = ["bar", ""];
function MyComponent_div_span_Template_2(rf, ctx) {
if (rf & 1) {
$r3$E(0, "span");
$r3$T(1);
$r3$.ɵe();
$r3$elementStart(0, "span");
$r3$text(1);
$r3$.ɵelementEnd();
}
if (rf & 2) {
$r3$x();
const $bar$ = $r3$.ɵr(4);
$r3$x();
const $foo$ = $r3$.ɵr(1);
const $baz$ = $r3$.ɵr(5);
$r3$.ɵt(1, $r3$.ɵi3("", $foo$, "-", $bar$, "-", $baz$, ""));
$r3$nextContext();
const $bar$ = $r3$.ɵreference(4);
$r3$nextContext();
const $foo$ = $r3$.ɵreference(1);
const $baz$ = $r3$.ɵreference(5);
$r3$.ɵtextBinding(1, $r3$.ɵinterpolation3("", $foo$, "-", $bar$, "-", $baz$, ""));
}
}
function MyComponent_div_Template_3(rf, ctx) {
if (rf & 1) {
$r3$E(0, "div");
$r3$T(1);
$r3$C(2, MyComponent_div_span_Template_2, null, $c2$);
$r3$Ee(3, "span", null, $c4$);
$r3$.ɵe();
$r3$elementStart(0, "div");
$r3$text(1);
$r3$container(2, MyComponent_div_span_Template_2, null, $c2$);
$r3$.ɵelement(3, "span", null, $c4$);
$r3$.ɵelementEnd();
}
if (rf & 2) {
const $bar$ = $r3$.ɵr(4);
$r3$x();
const $foo$ = $r3$.ɵr(1);
$r3$.ɵt(1, $r3$.ɵi2(" ", $foo$, "-", $bar$, " "));
const $bar$ = $r3$.ɵreference(4);
$r3$nextContext();
const $foo$ = $r3$.ɵreference(1);
$r3$.ɵtextBinding(1, $r3$.ɵinterpolation2(" ", $foo$, "-", $bar$, " "));
}
}
@ -1364,14 +1364,14 @@ describe('compiler compliance', () => {
features: [$r3$.ɵPublicFeature],
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$Ee(0, "div", null, $c1$);
$r3$T(2);
$r3$C(3, MyComponent_div_Template_3, null, $c2$);
$r3$Ee(4, "div", null, $c3$);
$r3$.ɵelement(0, "div", null, $c1$);
$r3$text(2);
$r3$container(3, MyComponent_div_Template_3, null, $c2$);
$r3$.ɵelement(4, "div", null, $c3$);
}
if (rf & 2) {
const $foo$ = $r3$.ɵr(1);
$r3$.ɵt(2, $r3$.ɵi1(" ", $foo$, " "));
const $foo$ = $r3$.ɵreference(1);
$r3$.ɵtextBinding(2, $r3$.ɵinterpolation1(" ", $foo$, " "));
}
},
directives:[IfDirective]
@ -1415,37 +1415,37 @@ describe('compiler compliance', () => {
function MyComponent_div_span_Template_3(rf, ctx) {
if (rf & 1) {
$i0$E(0, "span");
$i0$T(1);
$i0$.ɵe();
$i0$elementStart(0, "span");
$i0$text(1);
$i0$.ɵelementEnd();
}
if (rf & 2) {
const $item$ = $i0$x().$implicit;
const $foo$ = $i0$.ɵr(2);
$i0$.ɵt(1, $i0$.ɵi2(" ", $foo$, " - ", $item$, " "));
const $item$ = $i0$nextContext().$implicit;
const $foo$ = $i0$.ɵreference(2);
$i0$.ɵtextBinding(1, $i0$.ɵinterpolation2(" ", $foo$, " - ", $item$, " "));
}
}
function MyComponent_div_Template_0(rf, ctx) {
if (rf & 1) {
$i0$E(0, "div");
$i0$Ee(1, "div", null, $c1$);
$i0$C(3, MyComponent_div_span_Template_3, null, $c2$);
$i0$.ɵe();
$i0$elementStart(0, "div");
$i0$.ɵelement(1, "div", null, $c1$);
$i0$container(3, MyComponent_div_span_Template_3, null, $c2$);
$i0$.ɵelementEnd();
}
if (rf & 2) {
const $app$ = $i0$x();
$i0$p(3, "ngIf", $i0$.ɵb($app$.showing));
const $app$ = $i0$nextContext();
$i0$elementProperty(3, "ngIf", $i0$.ɵbind($app$.showing));
}
}
// ...
template:function MyComponent_Template(rf, ctx){
if (rf & 1) {
$i0$C(0, MyComponent_div_Template_0, null, $c0$);
$i0$container(0, MyComponent_div_Template_0, null, $c0$);
}
if (rf & 2) {
$i0$p(0, "ngForOf", $i0$.ɵb(ctx.items));
$i0$elementProperty(0, "ngForOf", $i0$.ɵbind(ctx.items));
}
}`;
@ -1517,12 +1517,12 @@ describe('compiler compliance', () => {
features: [$r3$.ɵPublicFeature],
template: function SimpleLayout_Template(rf, ctx) {
if (rf & 1) {
$r3$Ee(0, "lifecycle-comp");
$r3$Ee(1, "lifecycle-comp");
$r3$.ɵelement(0, "lifecycle-comp");
$r3$.ɵelement(1, "lifecycle-comp");
}
if (rf & 2) {
$r3$p(0, "name", $r3$.ɵb(ctx.name1));
$r3$p(1, "name", $r3$.ɵb(ctx.name2));
$r3$elementProperty(0, "name", $r3$.ɵbind(ctx.name1));
$r3$elementProperty(1, "name", $r3$.ɵbind(ctx.name2));
}
},
directives: [LifecycleComp]
@ -1631,10 +1631,10 @@ describe('compiler compliance', () => {
const $_c0$ = ["for","","forOf",""];
function MyComponent__svg_g_Template_1(rf, ctx) {
if (rf & 1) {
$r3$NS();
$r3$E(0,"g");
$r3$Ee(1,"circle");
$r3$.ɵe();
$r3$namespaceSVG();
$r3$elementStart(0,"g");
$r3$.ɵelement(1,"circle");
$r3$.ɵelementEnd();
}
}
@ -1645,12 +1645,12 @@ describe('compiler compliance', () => {
features: [$r3$.ɵPublicFeature],
template: function MyComponent_Template(rf, ctx){
if (rf & 1) {
$r3$NS();
$r3$E(0,"svg");
$r3$C(1,MyComponent__svg_g_Template_1,null,$_c0$);
$r3$.ɵe();
$r3$namespaceSVG();
$r3$elementStart(0,"svg");
$r3$container(1,MyComponent__svg_g_Template_1,null,$_c0$);
$r3$.ɵelementEnd();
}
if (rf & 2) { $r3$p(1,"forOf",$r3$.ɵb(ctx.items)); }
if (rf & 2) { $r3$elementProperty(1,"forOf",$r3$.ɵbind(ctx.items)); }
},
directives: function() { return [ForOfDirective]; }
});
@ -1705,13 +1705,13 @@ describe('compiler compliance', () => {
const $_c0$ = ["for","","forOf",""];
function MyComponent_li_Template_1(rf, ctx) {
if (rf & 1) {
$r3$E(0, "li");
$r3$T(1);
$r3$.ɵe();
$r3$elementStart(0, "li");
$r3$text(1);
$r3$.ɵelementEnd();
}
if (rf & 2) {
const $item$ = ctx.$implicit;
$r3$.ɵt(1, $r3$.ɵi1("", $item$.name, ""));
$r3$.ɵtextBinding(1, $r3$.ɵinterpolation1("", $item$.name, ""));
}
}
@ -1722,12 +1722,12 @@ describe('compiler compliance', () => {
features: [$r3$.ɵPublicFeature],
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$E(0, "ul");
$r3$C(1, MyComponent_li_Template_1, null, $_c0$);
$r3$.ɵe();
$r3$elementStart(0, "ul");
$r3$container(1, MyComponent_li_Template_1, null, $_c0$);
$r3$.ɵelementEnd();
}
if (rf & 2) {
$r3$p(1, "forOf", $r3$.ɵb(ctx.items));
$r3$elementProperty(1, "forOf", $r3$.ɵbind(ctx.items));
}
},
directives: function() { return [ForOfDirective]; }
@ -1783,32 +1783,32 @@ describe('compiler compliance', () => {
const $c1$ = ["for", "", "forOf", ""];
function MyComponent_li_li_Template_4(rf, ctx) {
if (rf & 1) {
$r3$E(0, "li");
$r3$T(1);
$r3$.ɵe();
$r3$elementStart(0, "li");
$r3$text(1);
$r3$.ɵelementEnd();
}
if (rf & 2) {
const $info$ = ctx.$implicit;
const $item$ = $r3$x().$implicit;
$r3$.ɵt(1, $r3$.ɵi2(" ", $item$.name, ": ", $info$.description, " "));
const $item$ = $r3$nextContext().$implicit;
$r3$.ɵtextBinding(1, $r3$.ɵinterpolation2(" ", $item$.name, ": ", $info$.description, " "));
}
}
function MyComponent_li_Template_1(rf, ctx) {
if (rf & 1) {
$r3$E(0, "li");
$r3$E(1, "div");
$r3$T(2);
$r3$.ɵe();
$r3$E(3, "ul");
$r3$C(4, MyComponent_li_li_Template_4, null, $c1$);
$r3$.ɵe();
$r3$.ɵe();
$r3$elementStart(0, "li");
$r3$elementStart(1, "div");
$r3$text(2);
$r3$.ɵelementEnd();
$r3$elementStart(3, "ul");
$r3$container(4, MyComponent_li_li_Template_4, null, $c1$);
$r3$.ɵelementEnd();
$r3$.ɵelementEnd();
}
if (rf & 2) {
const $item$ = ctx.$implicit;
$r3$.ɵt(2, $r3$.ɵi1("", IDENT.name, ""));
$r3$p(4, "forOf", $r3$.ɵb(IDENT.infos));
$r3$.ɵtextBinding(2, $r3$.ɵinterpolation1("", IDENT.name, ""));
$r3$elementProperty(4, "forOf", $r3$.ɵbind(IDENT.infos));
}
}
@ -1820,12 +1820,12 @@ describe('compiler compliance', () => {
features: [$r3$.ɵPublicFeature],
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$E(0, "ul");
$r3$C(1, MyComponent_li_Template_1, null, $c1$);
$r3$.ɵe();
$r3$elementStart(0, "ul");
$r3$container(1, MyComponent_li_Template_1, null, $c1$);
$r3$.ɵelementEnd();
}
if (rf & 2) {
$r3$p(1, "forOf", $r3$.ɵb(ctx.items));
$r3$elementProperty(1, "forOf", $r3$.ɵbind(ctx.items));
}
},
directives: function () { return [ForOfDirective]; }

View File

@ -39,12 +39,12 @@ describe('compiler compliance: bindings', () => {
const template = `
template:function MyComponent_Template(rf, $ctx$){
if (rf & 1) {
$i0$E(0, "div");
$i0$T(1);
$i0$.ɵe();
$i0$elementStart(0, "div");
$i0$text(1);
$i0$.ɵelementEnd();
}
if (rf & 2) {
$i0$.ɵt(1, $i0$.ɵi1("Hello ", $ctx$.name, ""));
$i0$.ɵtextBinding(1, $i0$.ɵinterpolation1("Hello ", $ctx$.name, ""));
}
}`;
const result = compile(files, angularFiles);
@ -75,10 +75,10 @@ describe('compiler compliance: bindings', () => {
const template = `
template:function MyComponent_Template(rf, $ctx$){
if (rf & 1) {
$i0$Ee(0, "a");
$i0$.ɵelement(0, "a");
}
if (rf & 2) {
$i0$p(0, "title", $i0$.ɵb($ctx$.title));
$i0$elementProperty(0, "title", $i0$.ɵbind($ctx$.title));
}
}`;
const result = compile(files, angularFiles);
@ -107,10 +107,10 @@ describe('compiler compliance: bindings', () => {
const template = `
template:function MyComponent_Template(rf, $ctx$){
if (rf & 1) {
$i0$Ee(0, "a");
$i0$.ɵelement(0, "a");
}
if (rf & 2) {
$i0$p(0, "title", $i0$.ɵi1("Hello ", $ctx$.name, ""));
$i0$elementProperty(0, "title", $i0$.ɵinterpolation1("Hello ", $ctx$.name, ""));
}
}`;
const result = compile(files, angularFiles);

View File

@ -49,13 +49,13 @@ describe('i18n support in the view compiler', () => {
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$T(1, $msg_1$);
$r3$text(1, $msg_1$);
$r3$T(3,"&");
$r3$text(3,"&");
$r3$T(5, $msg_2$);
$r3$text(5, $msg_2$);
$r3$T(7, $msg_2$);
$r3$text(7, $msg_2$);
}
}
@ -103,9 +103,9 @@ describe('i18n support in the view compiler', () => {
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$E(0, "div", $c1$);
$r3$T(1, $msg_2$);
$r3$.ɵe();
$r3$elementStart(0, "div", $c1$);
$r3$text(1, $msg_2$);
$r3$.ɵelementEnd();
}
}
`;
@ -148,7 +148,7 @@ describe('i18n support in the view compiler', () => {
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$Ee(0, "div", $c1$);
$r3$.ɵelement(0, "div", $c1$);
}
}
`;

View File

@ -43,12 +43,12 @@ describe('compiler compliance: listen()', () => {
const template = `
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$E(0, "div");
$r3$L("click", function MyComponent_Template_div_click_listener($event) {
$r3$elementStart(0, "div");
$r3$listener("click", function MyComponent_Template_div_click_listener($event) {
ctx.onClick($event);
return (1 == 2);
});
$r3$.ɵe();
$r3$.ɵelementEnd();
}
}
`;
@ -90,32 +90,32 @@ describe('compiler compliance: listen()', () => {
function MyComponent_div_Template_0(rf, ctx) {
if (rf & 1) {
const $s$ = $r3$.ɵgV();
$r3$E(0, "div");
$r3$E(1, "div");
$r3$L("click", function MyComponent_div_Template_0_div_click_listener($event) {
$r3$.ɵrV($s$);
const $comp$ = $r3$x();
const $s$ = $r3$.ɵgetCurrentView();
$r3$elementStart(0, "div");
$r3$elementStart(1, "div");
$r3$listener("click", function MyComponent_div_Template_0_div_click_listener($event) {
$r3$.ɵrestoreView($s$);
const $comp$ = $r3$nextContext();
return $comp$.onClick($comp$.foo);
});
$r3$.ɵe();
$r3$E(2, "button");
$r3$L("click", function MyComponent_div_Template_0_button_click_listener($event) {
$r3$.ɵrV($s$);
const $comp2$ = $r3$x();
$r3$.ɵelementEnd();
$r3$elementStart(2, "button");
$r3$listener("click", function MyComponent_div_Template_0_button_click_listener($event) {
$r3$.ɵrestoreView($s$);
const $comp2$ = $r3$nextContext();
return $comp2$.onClick2($comp2$.bar);
});
$r3$.ɵe();
$r3$.ɵe();
$r3$.ɵelementEnd();
$r3$.ɵelementEnd();
}
}
// ...
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$C(0, MyComponent_div_Template_0, null, $c0$);
$r3$container(0, MyComponent_div_Template_0, null, $c0$);
}
if (rf & 2) {
$i0$p(0, "ngIf", $i0$.ɵb(ctx.showing));
$i0$elementProperty(0, "ngIf", $i0$.ɵbind(ctx.showing));
}
}
`;
@ -156,14 +156,14 @@ describe('compiler compliance: listen()', () => {
features: [$r3$.ɵPublicFeature],
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$E(0, "button");
$r3$L("click", function MyComponent_Template_button_click_listener($event) {
const $user$ = $r3$.ɵr(3);
$r3$elementStart(0, "button");
$r3$listener("click", function MyComponent_Template_button_click_listener($event) {
const $user$ = $r3$.ɵreference(3);
return ctx.onClick($user$.value);
});
$r3$T(1, "Save");
$r3$.ɵe();
$r3$Ee(2, "input", null, $c0$);
$r3$text(1, "Save");
$r3$.ɵelementEnd();
$r3$.ɵelement(2, "input", null, $c0$);
}
}
});

View File

@ -112,7 +112,8 @@ describe('r3_view_compiler', () => {
}
};
const bV_call = `$r3$.ɵiV([" ",ctx.list[0]," ",ctx.list[1]," ",ctx.list[2]," ",ctx.list[3],
const bV_call =
`$r3$.ɵinterpolationV([" ",ctx.list[0]," ",ctx.list[1]," ",ctx.list[2]," ",ctx.list[3],
" ",ctx.list[4]," ",ctx.list[5]," ",ctx.list[6]," ",ctx.list[7]," ",ctx.list[8],
" "])`;
const result = compile(files, angularFiles);

View File

@ -42,13 +42,13 @@ describe('compiler compliance: styling', () => {
const template = `
template: function MyComponent_Template(rf, $ctx$) {
if (rf & 1) {
$r3$E(0, "div");
$r3$s(null, null, $r3$.ɵzss);
$r3$.ɵe();
$r3$elementStart(0, "div");
$r3$elementStyling(null, null, $r3$.ɵzss);
$r3$.ɵelementEnd();
}
if (rf & 2) {
$r3$sm(0, null, $ctx$.myStyleExp);
$r3$sa(0);
$r3$elementStylingMap(0, null, $ctx$.myStyleExp);
$r3$elementStylingApply(0);
}
}
`;
@ -96,16 +96,16 @@ describe('compiler compliance: styling', () => {
features: [$r3$.ɵPublicFeature],
template: function MyComponent_Template(rf, $ctx$) {
if (rf & 1) {
$r3$E(0, "div");
$r3$s(null, _c0, $r3$.ɵzss);
$r3$.ɵe();
$r3$elementStart(0, "div");
$r3$elementStyling(null, _c0, $r3$.ɵzss);
$r3$.ɵelementEnd();
}
if (rf & 2) {
$r3$sm(0, null, $ctx$.myStyleExp);
$r3$sp(0, 1, $ctx$.myWidth);
$r3$sp(0, 2, $ctx$.myHeight);
$r3$sa(0);
$r3$a(0, "style", $r3$.ɵb("border-width: 10px"), $r3$.ɵzs);
$r3$elementStylingMap(0, null, $ctx$.myStyleExp);
$r3$elementStylingProp(0, 1, $ctx$.myWidth);
$r3$elementStylingProp(0, 2, $ctx$.myHeight);
$r3$elementStylingApply(0);
$r3$elementAttribute(0, "style", $r3$.ɵbind("border-width: 10px"), $r3$.ɵzs);
}
}
});
@ -153,13 +153,13 @@ describe('compiler compliance: styling', () => {
features: [$r3$.ɵPublicFeature],
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
$r3$E(0, "div");
$r3$s(null, _c0, $r3$.ɵzss);
$r3$.ɵe();
$r3$elementStart(0, "div");
$r3$elementStyling(null, _c0, $r3$.ɵzss);
$r3$.ɵelementEnd();
}
if (rf & 2) {
$r3$sp(0, 0, ctx.myImage);
$r3$sa(0);
$r3$elementStylingProp(0, 0, ctx.myImage);
$r3$elementStylingApply(0);
}
}
});
@ -194,13 +194,13 @@ describe('compiler compliance: styling', () => {
const template = `
template: function MyComponent_Template(rf, $ctx$) {
if (rf & 1) {
$r3$E(0, "div");
$r3$s();
$r3$.ɵe();
$r3$elementStart(0, "div");
$r3$elementStyling();
$r3$.ɵelementEnd();
}
if (rf & 2) {
$r3$sm(0,$ctx$.myClassExp);
$r3$sa(0);
$r3$elementStylingMap(0,$ctx$.myClassExp);
$r3$elementStylingApply(0);
}
}
`;
@ -248,16 +248,16 @@ describe('compiler compliance: styling', () => {
features: [$r3$.ɵPublicFeature],
template: function MyComponent_Template(rf, $ctx$) {
if (rf & 1) {
$r3$E(0, "div");
$r3$s(_c0);
$r3$.ɵe();
$r3$elementStart(0, "div");
$r3$elementStyling(_c0);
$r3$.ɵelementEnd();
}
if (rf & 2) {
$r3$sm(0, $ctx$.myClassExp);
$r3$cp(0, 1, $ctx$.yesToApple);
$r3$cp(0, 2, $ctx$.yesToOrange);
$r3$sa(0);
$r3$a(0, "class", $r3$.ɵb("banana"));
$r3$elementStylingMap(0, $ctx$.myClassExp);
$r3$elementClassProp(0, 1, $ctx$.yesToApple);
$r3$elementClassProp(0, 2, $ctx$.yesToOrange);
$r3$elementStylingApply(0);
$r3$elementAttribute(0, "class", $r3$.ɵbind("banana"));
}
}
});
@ -302,13 +302,13 @@ describe('compiler compliance: styling', () => {
features: [$r3$.ɵPublicFeature],
template: function MyComponent_Template(rf, $ctx$) {
if (rf & 1) {
$r3$E(0, "div");
$r3$s(_c0, _c1);
$r3$.ɵe();
$r3$elementStart(0, "div");
$r3$elementStyling(_c0, _c1);
$r3$.ɵelementEnd();
}
if (rf & 2) {
$r3$a(0, "class", $r3$.ɵb("round"));
$r3$a(0, "style", $r3$.ɵb("height:100px"), $r3$.ɵzs);
$r3$elementAttribute(0, "class", $r3$.ɵbind("round"));
$r3$elementAttribute(0, "style", $r3$.ɵbind("height:100px"), $r3$.ɵzs);
}
}
});

View File

@ -54,60 +54,60 @@ describe('compiler compliance: template', () => {
function MyComponent_ul_li_div_Template_1(rf, ctx) {
if (rf & 1) {
const $s$ = $i0$.ɵgV();
$i0$E(0, "div");
$i0$L("click", function MyComponent_ul_li_div_Template_1_div_click_listener($event){
$i0$.ɵrV($s$);
const $s$ = $i0$.ɵgetCurrentView();
$i0$elementStart(0, "div");
$i0$listener("click", function MyComponent_ul_li_div_Template_1_div_click_listener($event){
$i0$.ɵrestoreView($s$);
const $inner$ = ctx.$implicit;
const $middle$ = $i0$x().$implicit;
const $outer$ = $i0$x().$implicit;
const $myComp$ = $i0$x();
const $middle$ = $i0$nextContext().$implicit;
const $outer$ = $i0$nextContext().$implicit;
const $myComp$ = $i0$nextContext();
return $myComp$.onClick($outer$, $middle$, $inner$);
});
$i0$T(1);
$i0$.ɵe();
$i0$text(1);
$i0$.ɵelementEnd();
}
if (rf & 2) {
const $inner1$ = ctx.$implicit;
const $middle1$ = $i0$x().$implicit;
const $outer1$ = $i0$x().$implicit;
const $myComp1$ = $i0$x();
$i0$p(0, "title", $i0$.ɵb($myComp1$.format($outer1$, $middle1$, $inner1$, $myComp1$.component)));
$i0$.ɵt(1, $i0$.ɵi1(" ", $myComp1$.format($outer1$, $middle1$, $inner1$, $myComp1$.component), " "));
const $middle1$ = $i0$nextContext().$implicit;
const $outer1$ = $i0$nextContext().$implicit;
const $myComp1$ = $i0$nextContext();
$i0$elementProperty(0, "title", $i0$.ɵbind($myComp1$.format($outer1$, $middle1$, $inner1$, $myComp1$.component)));
$i0$.ɵtextBinding(1, $i0$.ɵinterpolation1(" ", $myComp1$.format($outer1$, $middle1$, $inner1$, $myComp1$.component), " "));
}
}
function MyComponent_ul_li_Template_1(rf, ctx) {
if (rf & 1) {
$i0$E(0, "li");
$i0$C(1, MyComponent_ul_li_div_Template_1, null, _c0);
$i0$.ɵe();
$i0$elementStart(0, "li");
$i0$container(1, MyComponent_ul_li_div_Template_1, null, _c0);
$i0$.ɵelementEnd();
}
if (rf & 2) {
const $myComp2$ = $i0$x(2);
$i0$p(1, "ngForOf", $i0$.ɵb($myComp2$.items));
const $myComp2$ = $i0$nextContext(2);
$i0$elementProperty(1, "ngForOf", $i0$.ɵbind($myComp2$.items));
}
}
function MyComponent_ul_Template_0(rf, ctx) {
if (rf & 1) {
$i0$E(0, "ul");
$i0$C(1, MyComponent_ul_li_Template_1, null, _c0);
$i0$.ɵe();
$i0$elementStart(0, "ul");
$i0$container(1, MyComponent_ul_li_Template_1, null, _c0);
$i0$.ɵelementEnd();
}
if (rf & 2) {
const $outer2$ = ctx.$implicit;
$i0$p(1, "ngForOf", $i0$.ɵb($outer2$.items));
$i0$elementProperty(1, "ngForOf", $i0$.ɵbind($outer2$.items));
}
}
// ...
template:function MyComponent_Template(rf, ctx){
if (rf & 1) {
$i0$C(0, MyComponent_ul_Template_0, null, _c0);
$i0$container(0, MyComponent_ul_Template_0, null, _c0);
}
if (rf & 2) {
$i0$p(0, "ngForOf", $i0$.ɵb(ctx.items));
$i0$elementProperty(0, "ngForOf", $i0$.ɵbind(ctx.items));
}
}`;
@ -142,23 +142,23 @@ describe('compiler compliance: template', () => {
function MyComponent_span_Template_0(rf, ctx) {
if (rf & 1) {
$i0$E(0, "span");
$i0$T(1);
$i0$.ɵe();
$i0$elementStart(0, "span");
$i0$text(1);
$i0$.ɵelementEnd();
}
if (rf & 2) {
const $item$ = ctx.$implicit;
const $i$ = ctx.index;
$i0$.ɵt(1, $i0$.ɵi2(" ", $i$, " - ", $item$, " "));
$i0$.ɵtextBinding(1, $i0$.ɵinterpolation2(" ", $i$, " - ", $item$, " "));
}
}
// ...
template:function MyComponent_Template(rf, ctx){
if (rf & 1) {
$i0$C(0, MyComponent_span_Template_0, null, _c0);
$i0$container(0, MyComponent_span_Template_0, null, _c0);
}
if (rf & 2) {
$i0$p(0, "ngForOf", $i0$.ɵb(ctx.items));
$i0$elementProperty(0, "ngForOf", $i0$.ɵbind(ctx.items));
}
}`;
@ -196,37 +196,37 @@ describe('compiler compliance: template', () => {
function MyComponent_div_span_Template_1(rf, ctx) {
if (rf & 1) {
$i0$E(0, "span");
$i0$T(1);
$i0$.ɵe();
$i0$elementStart(0, "span");
$i0$text(1);
$i0$.ɵelementEnd();
}
if (rf & 2) {
const $div$ = $i0$x();
const $div$ = $i0$nextContext();
const $i$ = $div$.index;
const $item$ = $div$.$implicit;
$i0$.ɵt(1, $i0$.ɵi2(" ", $i$, " - ", $item$, " "));
$i0$.ɵtextBinding(1, $i0$.ɵinterpolation2(" ", $i$, " - ", $item$, " "));
}
}
function MyComponent_div_Template_0(rf, ctx) {
if (rf & 1) {
$i0$E(0, "div");
$i0$C(1, MyComponent_div_span_Template_1, null, $c1$);
$i0$.ɵe();
$i0$elementStart(0, "div");
$i0$container(1, MyComponent_div_span_Template_1, null, $c1$);
$i0$.ɵelementEnd();
}
if (rf & 2) {
const $app$ = $i0$x();
$i0$p(1, "ngIf", $i0$.ɵb($app$.showing));
const $app$ = $i0$nextContext();
$i0$elementProperty(1, "ngIf", $i0$.ɵbind($app$.showing));
}
}
// ...
template:function MyComponent_Template(rf, ctx){
if (rf & 1) {
$i0$C(0, MyComponent_div_Template_0, null, $c0$);
$i0$container(0, MyComponent_div_Template_0, null, $c0$);
}
if (rf & 2) {
$i0$p(0, "ngForOf", $i0$.ɵb(ctx.items));
$i0$elementProperty(0, "ngForOf", $i0$.ɵbind(ctx.items));
}
}`;
@ -265,47 +265,47 @@ describe('compiler compliance: template', () => {
const $c0$ = ["ngFor", "", "ngForOf", ""];
function MyComponent_div_div_div_Template_1(rf, ctx) {
if (rf & 1) {
$i0$E(0, "div");
$i0$T(1);
$i0$.ɵe();
$i0$elementStart(0, "div");
$i0$text(1);
$i0$.ɵelementEnd();
}
if (rf & 2) {
const $middle$ = $i0$x().$implicit;
const $myComp$ = $i0$x(2);
$i0$.ɵt(1, $i0$.ɵi2(" ", $middle$.value, " - ", $myComp$.name, " "));
const $middle$ = $i0$nextContext().$implicit;
const $myComp$ = $i0$nextContext(2);
$i0$.ɵtextBinding(1, $i0$.ɵinterpolation2(" ", $middle$.value, " - ", $myComp$.name, " "));
}
}
function MyComponent_div_div_Template_1(rf, ctx) {
if (rf & 1) {
$i0$E(0, "div");
$i0$C(1, MyComponent_div_div_div_Template_1, null, _c0);
$i0$.ɵe();
$i0$elementStart(0, "div");
$i0$container(1, MyComponent_div_div_div_Template_1, null, _c0);
$i0$.ɵelementEnd();
}
if (rf & 2) {
const $middle$ = ctx.$implicit;
$i0$p(1, "ngForOf", $i0$.ɵb($middle$.items));
$i0$elementProperty(1, "ngForOf", $i0$.ɵbind($middle$.items));
}
}
function MyComponent_div_Template_0(rf, ctx) {
if (rf & 1) {
$i0$E(0, "div");
$i0$C(1, MyComponent_div_div_Template_1, null, _c0);
$i0$.ɵe();
$i0$elementStart(0, "div");
$i0$container(1, MyComponent_div_div_Template_1, null, _c0);
$i0$.ɵelementEnd();
}
if (rf & 2) {
const $outer$ = ctx.$implicit;
$i0$p(1, "ngForOf", $i0$.ɵb($outer$.items));
$i0$elementProperty(1, "ngForOf", $i0$.ɵbind($outer$.items));
}
}
// ...
template:function MyComponent_Template(rf, ctx){
if (rf & 1) {
$i0$C(0, MyComponent_div_Template_0, null, _c0);
$i0$container(0, MyComponent_div_Template_0, null, _c0);
}
if (rf & 2) {
$i0$p(0, "ngForOf", $i0$.ɵb(ctx.items));
$i0$elementProperty(0, "ngForOf", $i0$.ɵbind(ctx.items));
}
}`;
@ -340,7 +340,7 @@ describe('compiler compliance: template', () => {
function Template_0(rf, ctx) {
if (rf & 1) {
$i0$T(0, " some-content ");
$i0$text(0, " some-content ");
}
}
@ -348,10 +348,10 @@ describe('compiler compliance: template', () => {
template: function MyComponent_Template(rf, ctx) {
if (rf & 1) {
$i0$C(0, Template_0, null, $c0$);
$i0$container(0, Template_0, null, $c0$);
}
if (rf & 2) {
$i0$p(0, "boundAttr", $i0$.ɵb(ctx.b));
$i0$elementProperty(0, "boundAttr", $i0$.ɵbind(ctx.b));
}
}`;

View File

@ -502,11 +502,11 @@ describe('ngtsc behavioral tests', () => {
expect(errorSpy).not.toHaveBeenCalled();
expect(exitCode).toBe(0);
const jsContents = getContents('test.js');
expect(jsContents).toContain(`i0.ɵQ(null, ["bar"], true, TemplateRef)`);
expect(jsContents).toContain(`i0.ɵQ(null, TemplateRef, false)`);
expect(jsContents).toContain(`i0.ɵQ(null, ["test2"], true)`);
expect(jsContents).toContain(`i0.ɵQ(0, ["accessor"], true)`);
expect(jsContents).toContain(`i0.ɵQ(1, ["test1"], true)`);
expect(jsContents).toContain(`i0.ɵquery(null, ["bar"], true, TemplateRef)`);
expect(jsContents).toContain(`i0.ɵquery(null, TemplateRef, false)`);
expect(jsContents).toContain(`i0.ɵquery(null, ["test2"], true)`);
expect(jsContents).toContain(`i0.ɵquery(0, ["accessor"], true)`);
expect(jsContents).toContain(`i0.ɵquery(1, ["test1"], true)`);
});
it('should handle queries that use forwardRef', () => {
@ -529,8 +529,8 @@ describe('ngtsc behavioral tests', () => {
expect(errorSpy).not.toHaveBeenCalled();
expect(exitCode).toBe(0);
const jsContents = getContents('test.js');
expect(jsContents).toContain(`i0.ɵQ(null, TemplateRef, true)`);
expect(jsContents).toContain(`i0.ɵQ(null, ViewContainerRef, true)`);
expect(jsContents).toContain(`i0.ɵquery(null, TemplateRef, true)`);
expect(jsContents).toContain(`i0.ɵquery(null, ViewContainerRef, true)`);
});
it('should generate host bindings for directives', () => {
@ -562,12 +562,18 @@ describe('ngtsc behavioral tests', () => {
expect(errorSpy).not.toHaveBeenCalled();
expect(exitCode).toBe(0);
const jsContents = getContents('test.js');
expect(jsContents).toContain(`i0.ɵp(elIndex, "attr.hello", i0.ɵb(i0.ɵd(dirIndex).foo));`);
expect(jsContents).toContain(`i0.ɵp(elIndex, "prop", i0.ɵb(i0.ɵd(dirIndex).bar));`);
expect(jsContents)
.toContain('i0.ɵp(elIndex, "class.someclass", i0.ɵb(i0.ɵd(dirIndex).someClass))');
expect(jsContents).toContain('i0.ɵd(dirIndex).onClick($event)');
expect(jsContents).toContain('i0.ɵd(dirIndex).onChange(i0.ɵd(dirIndex).arg)');
.toContain(
`i0.ɵelementProperty(elIndex, "attr.hello", i0.ɵbind(i0.ɵloadDirective(dirIndex).foo));`);
expect(jsContents)
.toContain(
`i0.ɵelementProperty(elIndex, "prop", i0.ɵbind(i0.ɵloadDirective(dirIndex).bar));`);
expect(jsContents)
.toContain(
'i0.ɵelementProperty(elIndex, "class.someclass", i0.ɵbind(i0.ɵloadDirective(dirIndex).someClass))');
expect(jsContents).toContain('i0.ɵloadDirective(dirIndex).onClick($event)');
expect(jsContents)
.toContain('i0.ɵloadDirective(dirIndex).onChange(i0.ɵloadDirective(dirIndex).arg)');
});
it('should correctly recognize local symbols', () => {