mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
refactor(core): Guard assertion with ngDevMode (#53764)
`assertDefined` is always guarded elsewhere PR Close #53764
This commit is contained in:
parent
bc81440b25
commit
7b2b0f40e2
2 changed files with 2 additions and 2 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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, '-');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue