Skip to content

Commit

Permalink
Disable envification warning if Function.name is not supported
Browse files Browse the repository at this point in the history
Fixes #1311
  • Loading branch information
gaearon committed Jan 29, 2016
1 parent 0fed607 commit e2e14d2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import warning from './utils/warning'
*/
function isCrushed() {}

if (isCrushed.name !== 'isCrushed' && process.env.NODE_ENV !== 'production') {
if (
process.env.NODE_ENV !== 'production' &&
setInterval.name === 'setInterval' &&

This comment has been minimized.

Copy link
@justin808

justin808 Jan 31, 2016

@gaearon This change of referencing setInterval broke server rendering for https://github.com/shakacode/react_on_rails/ as running this code through execjs fails because setInterval is not defined, per this [FAQ for execjs]( (https://github.com/sstephenson/execjs#faq).

I'll polyfill this for now, but I recommend that you change the line to:

setInterval && setInterval.name === 'setInterval'

References:

isCrushed.name !== 'isCrushed'
) {
warning(
'You are currently using minified code outside of NODE_ENV === \'production\'. ' +
'This means that you are running a slower development build of Redux. ' +
Expand Down

0 comments on commit e2e14d2

Please sign in to comment.