Commit 7a8b022
authored
Fix initializer of instance members that reference identifiers declared in the constructor
When public class fields are enabled, such cases throw a TS error similar to this.
```
third_party/javascript/angular_components/src/cdk/platform/platform.ts:37:29 - error TS2729: Property '_platformId' is used before its initialization.
37 isBrowser: boolean = this._platformId
~~~~~~~~~~~
third_party/javascript/angular_components/src/cdk/platform/platform.ts:87:15
87 constructor(@Inject(PLATFORM_ID) private _platformId: Object) {}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'_platformId' is declared here.
```
This error is fixed by moving the initializer of such class members into the constructor.
This is a no-op change
See go/lsc-fix-properties-used-before-initialization1 parent 31ef2f8 commit 7a8b022
File tree
1 file changed
+15
-13
lines changed- tensorboard/webapp/metrics/views/main_view
1 file changed
+15
-13
lines changedLines changed: 15 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
40 | 53 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 54 | + | |
53 | 55 | | |
0 commit comments