From cf4916bbd78d24eeb557272d61ddbc09b63f3e03 Mon Sep 17 00:00:00 2001 From: Giovanni Gaglione Date: Sun, 2 Feb 2020 01:26:30 +0100 Subject: [PATCH] fixed #77 --- src/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.js b/src/index.js index 9347a2a..b1780a2 100644 --- a/src/index.js +++ b/src/index.js @@ -38,6 +38,10 @@ const browserEnv = function () { // Copy what's left to the Node.js global scope .forEach(prop => { + // for fixing https://github.com/lukechilds/browser-env/issues/77 + if (['Infinity', 'NaN', 'undefined'].includes(prop)) { + return + } Object.defineProperty(global, prop, { configurable: true, get: () => window[prop]