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.

This commit is contained in:
Geoff Greer 2016-06-22 14:32:40 -07:00
parent a5fdf3e18a
commit 76e59a25f4

View File

@ -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)