mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(core): Guard assertion with ngDevMode (#53764)
`assertDefined` is always guarded elsewhere PR Close #53764
This commit is contained in:
committed by
Jessica Janiuk
parent
bc81440b25
commit
7b2b0f40e2
@@ -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, '-');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user