build(bazel): Turning on strictPropertyInitialization for Angular. (#24572)

All errors for existing fields have been detected and suppressed with a
`!` assertion.

Issue/24571 is tracking proper clean up of those instances.

One-line change required in ivy/compilation.ts, because it appears that
the new syntax causes tsickle emitted node to no longer track their
original sourceFiles.

PR Close #24572
This commit is contained in:
Rado Kirov
2018-06-18 16:38:33 -07:00
committed by Miško Hevery
parent 39c7769c9e
commit c95437f15d
189 changed files with 1273 additions and 632 deletions

View File

@ -1636,7 +1636,8 @@ const DEFAULT_COMPONENT_ID = '1';
]
})
class Cmp {
public exp: string|null;
// TODO(issue/24571): remove '!'.
public exp !: string | null;
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -2023,7 +2024,8 @@ const DEFAULT_COMPONENT_ID = '1';
})
class Cmp {
public exp: any;
public color: string|null;
// TODO(issue/24571): remove '!'.
public color !: string | null;
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -2456,7 +2458,8 @@ const DEFAULT_COMPONENT_ID = '1';
})
class Cmp {
exp: any = false;
event: AnimationEvent;
// TODO(issue/24571): remove '!'.
event !: AnimationEvent;
callback = (event: any) => { this.event = event; };
}
@ -2491,7 +2494,8 @@ const DEFAULT_COMPONENT_ID = '1';
})
class Cmp {
exp: any = false;
event: AnimationEvent;
// TODO(issue/24571): remove '!'.
event !: AnimationEvent;
callback = (event: any) => { this.event = event; };
}
@ -2546,8 +2550,10 @@ const DEFAULT_COMPONENT_ID = '1';
class Cmp {
exp1: any = false;
exp2: any = false;
event1: AnimationEvent;
event2: AnimationEvent;
// TODO(issue/24571): remove '!'.
event1 !: AnimationEvent;
// TODO(issue/24571): remove '!'.
event2 !: AnimationEvent;
// tslint:disable:semicolon
callback1 = (event: any) => { this.event1 = event; };
// tslint:disable:semicolon
@ -2608,8 +2614,10 @@ const DEFAULT_COMPONENT_ID = '1';
class Cmp {
exp1: any = false;
exp2: any = false;
event1: AnimationEvent;
event2: AnimationEvent;
// TODO(issue/24571): remove '!'.
event1 !: AnimationEvent;
// TODO(issue/24571): remove '!'.
event2 !: AnimationEvent;
callback1 = (event: any) => { this.event1 = event; };
callback2 = (event: any) => { this.event2 = event; };
}
@ -2713,7 +2721,8 @@ const DEFAULT_COMPONENT_ID = '1';
[style({'opacity': '0'}), animate(1000, style({'opacity': '1'}))])])],
})
class Cmp {
event: AnimationEvent;
// TODO(issue/24571): remove '!'.
event !: AnimationEvent;
@HostBinding('@myAnimation2')
exp: any = false;
@ -2747,7 +2756,8 @@ const DEFAULT_COMPONENT_ID = '1';
animations: [trigger('myAnimation', [])]
})
class Cmp {
exp: string;
// TODO(issue/24571): remove '!'.
exp !: string;
log: any[] = [];
callback = (event: any) => this.log.push(`${event.phaseName} => ${event.toState}`);
}
@ -2858,8 +2868,10 @@ const DEFAULT_COMPONENT_ID = '1';
})
class Cmp {
log: string[] = [];
exp1: string;
exp2: string;
// TODO(issue/24571): remove '!'.
exp1 !: string;
// TODO(issue/24571): remove '!'.
exp2 !: string;
cb(name: string, event: AnimationEvent) { this.log.push(name); }
}
@ -2936,7 +2948,8 @@ const DEFAULT_COMPONENT_ID = '1';
class Cmp {
log: string[] = [];
events: {[name: string]: any} = {};
exp: string;
// TODO(issue/24571): remove '!'.
exp !: string;
items: any = [0, 1, 2, 3];
cb(name: string, phase: string, event: AnimationEvent) {
@ -3263,8 +3276,10 @@ const DEFAULT_COMPONENT_ID = '1';
class Cmp {
disableExp = false;
exp = '';
startEvent: AnimationEvent;
doneEvent: AnimationEvent;
// TODO(issue/24571): remove '!'.
startEvent !: AnimationEvent;
// TODO(issue/24571): remove '!'.
doneEvent !: AnimationEvent;
}
TestBed.configureTestingModule({declarations: [Cmp]});

View File

@ -1049,7 +1049,8 @@ import {fakeAsync, flushMicrotasks} from '../../testing/src/fake_async';
])]
})
class Cmp {
public items: any[];
// TODO(issue/24571): remove '!'.
public items !: any[];
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -1129,7 +1130,8 @@ import {fakeAsync, flushMicrotasks} from '../../testing/src/fake_async';
})
class Cmp {
public exp: any;
public items: any[];
// TODO(issue/24571): remove '!'.
public items !: any[];
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -1349,7 +1351,8 @@ import {fakeAsync, flushMicrotasks} from '../../testing/src/fake_async';
})
class Cmp {
public exp: any;
public items: any[];
// TODO(issue/24571): remove '!'.
public items !: any[];
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -1401,7 +1404,8 @@ import {fakeAsync, flushMicrotasks} from '../../testing/src/fake_async';
})
class Cmp {
public exp: any;
public items: any[];
// TODO(issue/24571): remove '!'.
public items !: any[];
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -1463,7 +1467,8 @@ import {fakeAsync, flushMicrotasks} from '../../testing/src/fake_async';
class Cmp {
public exp1: any;
public exp2: any;
public items: any[];
// TODO(issue/24571): remove '!'.
public items !: any[];
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -1532,7 +1537,8 @@ import {fakeAsync, flushMicrotasks} from '../../testing/src/fake_async';
})
class Cmp {
public exp: any;
public items: any[];
// TODO(issue/24571): remove '!'.
public items !: any[];
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -1586,7 +1592,8 @@ import {fakeAsync, flushMicrotasks} from '../../testing/src/fake_async';
})
class Cmp {
public exp: any;
public items: any[];
// TODO(issue/24571): remove '!'.
public items !: any[];
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -2469,7 +2476,8 @@ import {fakeAsync, flushMicrotasks} from '../../testing/src/fake_async';
`
})
class Cmp {
public exp: boolean;
// TODO(issue/24571): remove '!'.
public exp !: boolean;
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -2648,7 +2656,8 @@ import {fakeAsync, flushMicrotasks} from '../../testing/src/fake_async';
`
})
class Cmp {
public exp: boolean;
// TODO(issue/24571): remove '!'.
public exp !: boolean;
public log: string[] = [];
callback(event: any) {
this.log.push(event.element.getAttribute('data-name') + '-' + event.phaseName);

View File

@ -138,7 +138,8 @@ import {TestBed} from '../../testing';
[transition('* => *', [style({height: '!'}), animate(1000, style({height: '*'}))])])]
})
class Cmp {
public exp: number;
// TODO(issue/24571): remove '!'.
public exp !: number;
public items = [0, 1, 2, 3, 4];
}
@ -358,7 +359,8 @@ import {TestBed} from '../../testing';
]
})
class Cmp {
public exp: string;
// TODO(issue/24571): remove '!'.
public exp !: string;
}
TestBed.configureTestingModule({declarations: [Cmp]});
@ -411,7 +413,8 @@ import {TestBed} from '../../testing';
]
})
class Cmp {
public exp: string;
// TODO(issue/24571): remove '!'.
public exp !: string;
public items: any[] = [];
}