refactor(core): Guard assertion with ngDevMode (#53764)

`assertDefined` is always guarded elsewhere

PR Close #53764
This commit is contained in:
Matthieu Riegler 2024-01-26 20:07:59 +01:00 committed by Jessica Janiuk
parent bc81440b25
commit 7b2b0f40e2
2 changed files with 2 additions and 2 deletions

View file

@ -20,7 +20,7 @@ export function throwCyclicDependencyError(token: string, path?: string[]): neve
const depPath = path ? `. Dependency path: ${path.join(' > ')} > ${token}` : '';
throw new RuntimeError(
RuntimeErrorCode.CYCLIC_DI_DEPENDENCY,
`Circular dependency in DI detected for ${token}${depPath}`);
ngDevMode ? `Circular dependency in DI detected for ${token}${depPath}` : token);
}
export function throwMixedMultiProviderError() {

View file

@ -25,7 +25,7 @@ let LOCALE_ID = DEFAULT_LOCALE_ID;
* @param localeId
*/
export function setLocaleId(localeId: string) {
assertDefined(localeId, `Expected localeId to be defined`);
ngDevMode && assertDefined(localeId, `Expected localeId to be defined`);
if (typeof localeId === 'string') {
LOCALE_ID = localeId.toLowerCase().replace(/_/g, '-');
}