Skip to content

Commit

Permalink
fix(ivy): reordering how root is acquired (angular#25470)
Browse files Browse the repository at this point in the history
PR Close angular#25470
  • Loading branch information
benlesh authored and FrederikSchlemmer committed Jan 3, 2019
1 parent de2693d commit fb1734e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/core/src/render3/ng_dev_mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit fb1734e

Please sign in to comment.