@@ -2,6 +2,8 @@ import { ActionTypes } from './createStore'
2
2
import isPlainObject from 'lodash/isPlainObject'
3
3
import warning from './utils/warning'
4
4
5
+ var NODE_ENV = typeof process !== 'undefined' ? process . env . NODE_ENV : 'development'
6
+
5
7
function getUndefinedStateErrorMessage ( key , action ) {
6
8
var actionType = action && action . type
7
9
var actionName = actionType && `"${ actionType . toString ( ) } "` || 'an action'
@@ -103,7 +105,7 @@ export default function combineReducers(reducers) {
103
105
for ( var i = 0 ; i < reducerKeys . length ; i ++ ) {
104
106
var key = reducerKeys [ i ]
105
107
106
- if ( process . env . NODE_ENV !== 'production' ) {
108
+ if ( NODE_ENV !== 'production' ) {
107
109
if ( typeof reducers [ key ] === 'undefined' ) {
108
110
warning ( `No reducer provided for key "${ key } "` )
109
111
}
@@ -115,7 +117,7 @@ export default function combineReducers(reducers) {
115
117
}
116
118
var finalReducerKeys = Object . keys ( finalReducers )
117
119
118
- if ( process . env . NODE_ENV !== 'production' ) {
120
+ if ( NODE_ENV !== 'production' ) {
119
121
var unexpectedKeyCache = { }
120
122
}
121
123
@@ -131,7 +133,7 @@ export default function combineReducers(reducers) {
131
133
throw sanityError
132
134
}
133
135
134
- if ( process . env . NODE_ENV !== 'production' ) {
136
+ if ( NODE_ENV !== 'production' ) {
135
137
var warningMessage = getUnexpectedStateShapeWarningMessage ( state , finalReducers , action , unexpectedKeyCache )
136
138
if ( warningMessage ) {
137
139
warning ( warningMessage )
0 commit comments