hoist-non-react-statics
Advanced tools
Comparing version 2.2.2 to 2.3.0
16
index.js
@@ -28,8 +28,8 @@ /** | ||
var defineProperty = Object.defineProperty; | ||
var getOwnPropertyNames = Object.getOwnPropertyNames; | ||
var getOwnPropertySymbols = Object.getOwnPropertySymbols; | ||
var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
var propIsEnumerable = Object.prototype.propertyIsEnumerable; | ||
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; | ||
var getPrototypeOf = Object.getPrototypeOf; | ||
var objectPrototype = getPrototypeOf && getPrototypeOf(Object); | ||
var getOwnPropertyNames = Object.getOwnPropertyNames; | ||
@@ -55,8 +55,6 @@ module.exports = function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { | ||
if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) { | ||
// Only hoist enumerables and non-enumerable functions | ||
if(propIsEnumerable.call(sourceComponent, key) || typeof sourceComponent[key] === 'function') { | ||
try { // Avoid failures from read-only properties | ||
targetComponent[key] = sourceComponent[key]; | ||
} catch (e) {} | ||
} | ||
var descriptor = getOwnPropertyDescriptor(sourceComponent, key); | ||
try { // Avoid failures from read-only properties | ||
defineProperty(targetComponent, key, descriptor); | ||
} catch (e) {} | ||
} | ||
@@ -63,0 +61,0 @@ } |
{ | ||
"name": "hoist-non-react-statics", | ||
"version": "2.2.2", | ||
"version": "2.3.0", | ||
"description": "Copies non-react specific statics from a child component to a parent component", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -35,2 +35,6 @@ # hoist-non-react-statics | ||
## Browser Support | ||
This package uses `Object.defineProperty` which has a broken implementation in IE8. In order to use this package in IE8, you will need a polyfill that fixes this method. | ||
## License | ||
@@ -37,0 +41,0 @@ This software is free to use under the Yahoo Inc. BSD license. |
7407
46
62