mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(core): inline depPath in throwCyclicDependencyError to be dropped (#60084)
Inlines the `depPath` within the `throwCyclicDependencyError`, because it's not being tree-shaken in production. PR Close #60084
This commit is contained in:
@@ -16,10 +16,11 @@ import {stringifyForError} from './util/stringify_utils';
|
||||
|
||||
/** Called when directives inject each other (creating a circular dependency) */
|
||||
export function throwCyclicDependencyError(token: string, path?: string[]): never {
|
||||
const depPath = path ? `. Dependency path: ${path.join(' > ')} > ${token}` : '';
|
||||
throw new RuntimeError(
|
||||
RuntimeErrorCode.CYCLIC_DI_DEPENDENCY,
|
||||
ngDevMode ? `Circular dependency in DI detected for ${token}${depPath}` : token,
|
||||
ngDevMode
|
||||
? `Circular dependency in DI detected for ${token}${path ? `. Dependency path: ${path.join(' > ')} > ${token}` : ''}`
|
||||
: token,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user