Skip to content

Commit 0bb8924

Browse files
29naks2005alxhub
authored andcommitted
refactor(core): use getComponentDef in stringify_utils
- Use getComponentDef in debugStringifyTypeForError to clean up TODO - Remove outdated comment from stringify_utils
1 parent 009ca4b commit 0bb8924

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

packages/core/src/render3/util/stringify_utils.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import {Type} from '../../interface/type';
10-
import {NG_COMP_DEF} from '../fields';
10+
import {getComponentDef} from '../def_getters';
1111

1212
/**
1313
* Used for stringify render output in Ivy.
@@ -45,9 +45,8 @@ export function stringifyForError(value: any): string {
4545
* Important! This function contains a megamorphic read and should only be used for error messages.
4646
*/
4747
export function debugStringifyTypeForError(type: Type<any>): string {
48-
// TODO(pmvald): Do some refactoring so that we can use getComponentDef here without creating
49-
// circular deps.
50-
let componentDef = (type as any)[NG_COMP_DEF] || null;
48+
const componentDef = getComponentDef(type);
49+
5150
if (componentDef !== null && componentDef.debugInfo) {
5251
return stringifyTypeFromDebugInfo(componentDef.debugInfo);
5352
}

0 commit comments

Comments
 (0)