diff --git a/src/browser/ui/React.js b/src/browser/ui/React.js index 29b7ed0098ec5..3482dd3237a6a 100644 --- a/src/browser/ui/React.js +++ b/src/browser/ui/React.js @@ -88,6 +88,34 @@ if (__DEV__) { 'Download the React DevTools for a better development experience: ' + 'http://fb.me/react-devtools' ); + + var expectedFeatures = [ + // shims + Array.isArray, + Array.prototype.every, + Array.prototype.forEach, + Array.prototype.indexOf, + Array.prototype.map, + Date.now, + Function.prototype.bind, + Object.keys, + String.prototype.split, + + // shams + Object.create, + Object.freeze + ]; + + for (var i in expectedFeatures) { + if (!expectedFeatures[i]) { + console.error( + 'One or more ES5 shim/shams expected by React are not available: ' + + 'http://facebook.github.io/react/docs/working-with-the-browser.html' + + '#polyfills-needed-to-support-older-browsers' + ); + break; + } + } } }