From 1bb30147d36ea71e4cfa159594e4c3e63a9745ce Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Mon, 13 Aug 2018 19:39:18 -0700 Subject: [PATCH] fix(ivy): add typeof guard around ngDevMode for instances where we cannot set it in Node (#25475) PR Close #25475 --- packages/core/src/render3/definition.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/core/src/render3/definition.ts b/packages/core/src/render3/definition.ts index ead1db96c9..b332bcdb15 100644 --- a/packages/core/src/render3/definition.ts +++ b/packages/core/src/render3/definition.ts @@ -19,8 +19,10 @@ import {CssSelectorList, SelectorFlags} from './interfaces/projection'; const EMPTY: {} = {}; const EMPTY_ARRAY: any[] = []; -ngDevMode && Object.freeze(EMPTY); -ngDevMode && Object.freeze(EMPTY_ARRAY); +if (typeof ngDevMode !== 'undefined' && ngDevMode) { + Object.freeze(EMPTY); + Object.freeze(EMPTY_ARRAY); +} let _renderCompCount = 0; /**