From 76e59a25f4657ff80553324ff3aa8e13f24e31a9 Mon Sep 17 00:00:00 2001 From: Geoff Greer Date: Wed, 22 Jun 2016 14:32:40 -0700 Subject: [PATCH] Don't erase NODE_ENV from environment. Atom sets this to 'production' earlier, but some code paths can cause it to be un-set. This degrades performance and sometimes crashes React. Fixes #12024. --- src/environment-helpers.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/environment-helpers.js b/src/environment-helpers.js index 5a9ef8e3a..f4224fbe4 100644 --- a/src/environment-helpers.js +++ b/src/environment-helpers.js @@ -72,7 +72,10 @@ function needsPatching (options = { platform: process.platform, env: process.env // underlying functionality. function clone (to, from) { for (var key in to) { - delete to[key] + // Don't erase NODE_ENV. Fixes #12024 + if (key !== 'NODE_ENV') { + delete to[key] + } } Object.assign(to, from)