Skip to content

Commit 6fbe219

Browse files
kubkatscott
authored andcommitted
refactor(core): Replace non-null assertion operator with property initialization (#39730)
Reuse the `noop` function from the common utilities PR Close #39730
1 parent e4028ae commit 6fbe219

File tree

4 files changed

+19
-15
lines changed

4 files changed

+19
-15
lines changed

packages/core/src/application_init.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {isPromise} from '../src/util/lang';
10-
119
import {Inject, Injectable, InjectionToken, Optional} from './di';
10+
import {isPromise} from './util/lang';
11+
import {noop} from './util/noop';
1212

1313

1414
/**
@@ -37,10 +37,8 @@ export const APP_INITIALIZER = new InjectionToken<Array<() => void>>('Applicatio
3737
*/
3838
@Injectable()
3939
export class ApplicationInitStatus {
40-
// TODO(issue/24571): remove '!'.
41-
private resolve!: Function;
42-
// TODO(issue/24571): remove '!'.
43-
private reject!: Function;
40+
private resolve = noop;
41+
private reject = noop;
4442
private initialized = false;
4543
public readonly donePromise: Promise<any>;
4644
public readonly done = false;

packages/core/test/bundling/forms/bundle.golden_symbols.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -626,9 +626,6 @@
626626
{
627627
"name": "VERSION"
628628
},
629-
{
630-
"name": "ViewEngineTemplateRef"
631-
},
632629
{
633630
"name": "VE_ViewContainerRef"
634631
},
@@ -644,6 +641,9 @@
644641
{
645642
"name": "ViewEncapsulation"
646643
},
644+
{
645+
"name": "ViewEngineTemplateRef"
646+
},
647647
{
648648
"name": "ViewRef"
649649
},
@@ -1397,6 +1397,9 @@
13971397
{
13981398
"name": "noop"
13991399
},
1400+
{
1401+
"name": "noop"
1402+
},
14001403
{
14011404
"name": "normalizeValidators"
14021405
},

packages/core/test/bundling/router/bundle.golden_symbols.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -845,9 +845,6 @@
845845
{
846846
"name": "VERSION"
847847
},
848-
{
849-
"name": "ViewEngineTemplateRef"
850-
},
851848
{
852849
"name": "VE_ViewContainerRef"
853850
},
@@ -860,6 +857,9 @@
860857
{
861858
"name": "ViewEncapsulation"
862859
},
860+
{
861+
"name": "ViewEngineTemplateRef"
862+
},
863863
{
864864
"name": "ViewRef"
865865
},
@@ -1721,6 +1721,9 @@
17211721
{
17221722
"name": "noop"
17231723
},
1724+
{
1725+
"name": "noop"
1726+
},
17241727
{
17251728
"name": "normalizeQueryParams"
17261729
},

packages/core/test/bundling/todo/bundle.golden_symbols.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,6 @@
140140
{
141141
"name": "TodoStore"
142142
},
143-
{
144-
"name": "ViewEngineTemplateRef"
145-
},
146143
{
147144
"name": "VE_ViewContainerRef"
148145
},
@@ -152,6 +149,9 @@
152149
{
153150
"name": "ViewEncapsulation"
154151
},
152+
{
153+
"name": "ViewEngineTemplateRef"
154+
},
155155
{
156156
"name": "ViewRef"
157157
},

0 commit comments

Comments
 (0)