perf(ivy): remove unused argument in hostBindings function (#34969)

We had some logic for generating and passing in the `elIndex` parameter into the `hostBindings` function, but it wasn't actually being used for anything. The only place left that had a reference to it was the `StylingBuilder` and it only stored it without referencing it again.

PR Close #34969
This commit is contained in:
Kristiyan Kostadinov
2020-01-25 12:38:42 +01:00
committed by Andrew Kushnir
parent c7c7b20684
commit 71a3c7208f
13 changed files with 54 additions and 66 deletions

View File

@ -233,7 +233,7 @@ ivyEnabled && describe('render3 jit', () => {
const cmpDef = (Cmp as any).ɵcmp as ComponentDef<Cmp>;
expect(cmpDef.hostBindings).toBeDefined();
expect(cmpDef.hostBindings !.length).toBe(3);
expect(cmpDef.hostBindings !.length).toBe(2);
});
it('should compile @Pipes without errors', () => {

View File

@ -77,8 +77,7 @@ describe('event listeners', () => {
ɵɵtext(0, 'Some text');
}
},
hostBindings: function HostListenerDir_HostBindings(
rf: RenderFlags, ctx: any, elIndex: number) {
hostBindings: function HostListenerDir_HostBindings(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ɵɵlistener('custom', function() {
return ctx.onDocumentCustomEvent();
@ -102,8 +101,7 @@ describe('event listeners', () => {
static ɵdir = ɵɵdefineDirective({
type: GlobalHostListenerDir,
selectors: [['', 'hostListenerDir', '']],
hostBindings: function HostListenerDir_HostBindings(
rf: RenderFlags, ctx: any, elIndex: number) {
hostBindings: function HostListenerDir_HostBindings(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ɵɵlistener('custom', function() {
return ctx.onDocumentCustomEvent();
@ -537,8 +535,7 @@ describe('event listeners', () => {
ɵɵtext(0, 'Some text');
}
},
hostBindings: function HostListenerDir_HostBindings(
rf: RenderFlags, ctx: any, elIndex: number) {
hostBindings: function HostListenerDir_HostBindings(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ɵɵlistener('click', function() { return ctx.onClick(); });
}
@ -581,8 +578,7 @@ describe('event listeners', () => {
static ɵdir = ɵɵdefineDirective({
type: HostListenerDir,
selectors: [['', 'hostListenerDir', '']],
hostBindings: function HostListenerDir_HostBindings(
rf: RenderFlags, ctx: any, elIndex: number) {
hostBindings: function HostListenerDir_HostBindings(rf: RenderFlags, ctx: any) {
if (rf & RenderFlags.Create) {
ɵɵlistener('click', function() { return ctx.onClick(); });
}