@@ -2,6 +2,8 @@ import { ActionTypes } from './createStore'
22import isPlainObject from 'lodash/isPlainObject'
33import warning from './utils/warning'
44
5+ var NODE_ENV = typeof process !== 'undefined' ? process . env . NODE_ENV : 'development'
6+
57function getUndefinedStateErrorMessage ( key , action ) {
68 var actionType = action && action . type
79 var actionName = actionType && `"${ actionType . toString ( ) } "` || 'an action'
@@ -103,7 +105,7 @@ export default function combineReducers(reducers) {
103105 for ( var i = 0 ; i < reducerKeys . length ; i ++ ) {
104106 var key = reducerKeys [ i ]
105107
106- if ( process . env . NODE_ENV !== 'production' ) {
108+ if ( NODE_ENV !== 'production' ) {
107109 if ( typeof reducers [ key ] === 'undefined' ) {
108110 warning ( `No reducer provided for key "${ key } "` )
109111 }
@@ -115,7 +117,7 @@ export default function combineReducers(reducers) {
115117 }
116118 var finalReducerKeys = Object . keys ( finalReducers )
117119
118- if ( process . env . NODE_ENV !== 'production' ) {
120+ if ( NODE_ENV !== 'production' ) {
119121 var unexpectedKeyCache = { }
120122 }
121123
@@ -131,7 +133,7 @@ export default function combineReducers(reducers) {
131133 throw sanityError
132134 }
133135
134- if ( process . env . NODE_ENV !== 'production' ) {
136+ if ( NODE_ENV !== 'production' ) {
135137 var warningMessage = getUnexpectedStateShapeWarningMessage ( state , finalReducers , action , unexpectedKeyCache )
136138 if ( warningMessage ) {
137139 warning ( warningMessage )
0 commit comments