fix(ivy): reordering how root is acquired (#25470)

PR Close #25470
This commit is contained in:
Ben Lesh 2018-08-13 17:12:34 -07:00
parent 4a4d6fb0e6
commit 97d8b5ed88
1 changed files with 4 additions and 2 deletions

View File

@ -37,9 +37,11 @@ declare global {
declare let global: any;
// NOTE: The order here matters: Checking window, then global, then self is important.
// checking them in another order can result in errors in some Node environments.
const __global: {ngDevMode: NgDevModePerfCounters | boolean} =
typeof window != 'undefined' && window || typeof self != 'undefined' && self ||
typeof global != 'undefined' && global;
typeof window != 'undefined' && window || typeof global != 'undefined' && global ||
typeof self != 'undefined' && self;
export function ngDevModeResetPerfCounters(): NgDevModePerfCounters {
// Make sure to refer to ngDevMode as ['ngDevMode'] for clousre.