Skip to content

Commit

Permalink
refactor(core): Replace non-null assertion operator with property ini…
Browse files Browse the repository at this point in the history
…tialization (#39730)

Reuse the `noop` function from the common utilities

PR Close #39730
  • Loading branch information
kubk authored and atscott committed Nov 18, 2020
1 parent e4028ae commit 6fbe219
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
10 changes: 4 additions & 6 deletions packages/core/src/application_init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';


/**
Expand Down Expand Up @@ -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;
Expand Down
9 changes: 6 additions & 3 deletions packages/core/test/bundling/forms/bundle.golden_symbols.json
Original file line number Diff line number Diff line change
Expand Up @@ -626,9 +626,6 @@
{
"name": "VERSION"
},
{
"name": "ViewEngineTemplateRef"
},
{
"name": "VE_ViewContainerRef"
},
Expand All @@ -644,6 +641,9 @@
{
"name": "ViewEncapsulation"
},
{
"name": "ViewEngineTemplateRef"
},
{
"name": "ViewRef"
},
Expand Down Expand Up @@ -1397,6 +1397,9 @@
{
"name": "noop"
},
{
"name": "noop"
},
{
"name": "normalizeValidators"
},
Expand Down
9 changes: 6 additions & 3 deletions packages/core/test/bundling/router/bundle.golden_symbols.json
Original file line number Diff line number Diff line change
Expand Up @@ -845,9 +845,6 @@
{
"name": "VERSION"
},
{
"name": "ViewEngineTemplateRef"
},
{
"name": "VE_ViewContainerRef"
},
Expand All @@ -860,6 +857,9 @@
{
"name": "ViewEncapsulation"
},
{
"name": "ViewEngineTemplateRef"
},
{
"name": "ViewRef"
},
Expand Down Expand Up @@ -1721,6 +1721,9 @@
{
"name": "noop"
},
{
"name": "noop"
},
{
"name": "normalizeQueryParams"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/core/test/bundling/todo/bundle.golden_symbols.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@
{
"name": "TodoStore"
},
{
"name": "ViewEngineTemplateRef"
},
{
"name": "VE_ViewContainerRef"
},
Expand All @@ -152,6 +149,9 @@
{
"name": "ViewEncapsulation"
},
{
"name": "ViewEngineTemplateRef"
},
{
"name": "ViewRef"
},
Expand Down

0 comments on commit 6fbe219

Please sign in to comment.