fix(core): initialize global ngDevMode without toplevel side effects (#32079)
Fix #31595 PR Close #32079
This commit is contained in:

committed by
Matias Niemelä

parent
a85eccd6ff
commit
5f095a501e
@ -20,6 +20,8 @@ export const NAMESPACE_URIS: {[ns: string]: string} = {
|
||||
};
|
||||
|
||||
const COMPONENT_REGEX = /%COMP%/g;
|
||||
const NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode;
|
||||
|
||||
export const COMPONENT_VARIABLE = '%COMP%';
|
||||
export const HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
|
||||
export const CONTENT_ATTR = `_ngcontent-${COMPONENT_VARIABLE}`;
|
||||
@ -221,7 +223,7 @@ class DefaultDomRenderer2 implements Renderer2 {
|
||||
}
|
||||
|
||||
setProperty(el: any, name: string, value: any): void {
|
||||
ngDevMode && checkNoSyntheticProp(name, 'property');
|
||||
NG_DEV_MODE && checkNoSyntheticProp(name, 'property');
|
||||
el[name] = value;
|
||||
}
|
||||
|
||||
@ -229,7 +231,7 @@ class DefaultDomRenderer2 implements Renderer2 {
|
||||
|
||||
listen(target: 'window'|'document'|'body'|any, event: string, callback: (event: any) => boolean):
|
||||
() => void {
|
||||
ngDevMode && checkNoSyntheticProp(event, 'listener');
|
||||
NG_DEV_MODE && checkNoSyntheticProp(event, 'listener');
|
||||
if (typeof target === 'string') {
|
||||
return <() => void>this.eventManager.addGlobalEventListener(
|
||||
target, event, decoratePreventDefault(callback));
|
||||
|
Reference in New Issue
Block a user