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
*/
import {isPromise} from '../src/util/lang';
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()
export class ApplicationInitStatus {
// TODO(issue/24571): remove '!'.
private resolve!: Function;
// TODO(issue/24571): remove '!'.
private reject!: Function;
private resolve = noop;
private reject = noop;
private initialized = false;
public readonly donePromise: Promise<any>;
public readonly done = false;

View File

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

View File

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

View File

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