refactor(core): Replace non-null assertion operator with property initialization (#39730)

Reuse the `noop` function from the common utilities

PR Close #39730
This commit is contained in:
Egor 2019-12-07 14:20:26 +03:00 committed by atscott
parent e4028ae5c4
commit 6fbe21941d
4 changed files with 19 additions and 15 deletions

View File

@ -6,9 +6,9 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {isPromise} from '../src/util/lang';
import {Inject, Injectable, InjectionToken, Optional} from './di'; import {Inject, Injectable, InjectionToken, Optional} from './di';
import {isPromise} from './util/lang';
import {noop} from './util/noop';
/** /**
@ -37,10 +37,8 @@ export const APP_INITIALIZER = new InjectionToken<Array<() => void>>('Applicatio
*/ */
@Injectable() @Injectable()
export class ApplicationInitStatus { export class ApplicationInitStatus {
// TODO(issue/24571): remove '!'. private resolve = noop;
private resolve!: Function; private reject = noop;
// TODO(issue/24571): remove '!'.
private reject!: Function;
private initialized = false; private initialized = false;
public readonly donePromise: Promise<any>; public readonly donePromise: Promise<any>;
public readonly done = false; public readonly done = false;

View File

@ -626,9 +626,6 @@
{ {
"name": "VERSION" "name": "VERSION"
}, },
{
"name": "ViewEngineTemplateRef"
},
{ {
"name": "VE_ViewContainerRef" "name": "VE_ViewContainerRef"
}, },
@ -644,6 +641,9 @@
{ {
"name": "ViewEncapsulation" "name": "ViewEncapsulation"
}, },
{
"name": "ViewEngineTemplateRef"
},
{ {
"name": "ViewRef" "name": "ViewRef"
}, },
@ -1397,6 +1397,9 @@
{ {
"name": "noop" "name": "noop"
}, },
{
"name": "noop"
},
{ {
"name": "normalizeValidators" "name": "normalizeValidators"
}, },

View File

@ -845,9 +845,6 @@
{ {
"name": "VERSION" "name": "VERSION"
}, },
{
"name": "ViewEngineTemplateRef"
},
{ {
"name": "VE_ViewContainerRef" "name": "VE_ViewContainerRef"
}, },
@ -860,6 +857,9 @@
{ {
"name": "ViewEncapsulation" "name": "ViewEncapsulation"
}, },
{
"name": "ViewEngineTemplateRef"
},
{ {
"name": "ViewRef" "name": "ViewRef"
}, },
@ -1721,6 +1721,9 @@
{ {
"name": "noop" "name": "noop"
}, },
{
"name": "noop"
},
{ {
"name": "normalizeQueryParams" "name": "normalizeQueryParams"
}, },

View File

@ -140,9 +140,6 @@
{ {
"name": "TodoStore" "name": "TodoStore"
}, },
{
"name": "ViewEngineTemplateRef"
},
{ {
"name": "VE_ViewContainerRef" "name": "VE_ViewContainerRef"
}, },
@ -152,6 +149,9 @@
{ {
"name": "ViewEncapsulation" "name": "ViewEncapsulation"
}, },
{
"name": "ViewEngineTemplateRef"
},
{ {
"name": "ViewRef" "name": "ViewRef"
}, },