Revert "Revert "Remove dependence on ES5 shams per #4189""

This commit is contained in:
Jim
2015-10-06 14:31:20 -07:00
parent 6446a45a00
commit fc043bb3a5
3 changed files with 9 additions and 8 deletions
@@ -109,8 +109,10 @@ var ReactElement = function(type, key, ref, self, source, owner, props) {
element._self = self;
element._source = source;
}
Object.freeze(element.props);
Object.freeze(element);
if (Object.freeze) {
Object.freeze(element.props);
Object.freeze(element);
}
}
return element;
+1 -5
View File
@@ -98,16 +98,12 @@ if (__DEV__) {
Object.keys,
String.prototype.split,
String.prototype.trim,
// shams
Object.create,
Object.freeze,
];
for (var i = 0; i < expectedFeatures.length; i++) {
if (!expectedFeatures[i]) {
console.error(
'One or more ES5 shim/shams expected by React are not available: ' +
'One or more ES5 shims expected by React are not available: ' +
'https://fb.me/react-warning-polyfills'
);
break;
@@ -175,7 +175,10 @@ SyntheticEvent.Interface = EventInterface;
SyntheticEvent.augmentClass = function(Class, Interface) {
var Super = this;
var prototype = Object.create(Super.prototype);
var E = function () {};
E.prototype = Super.prototype;
var prototype = new E();
assign(prototype, Class.prototype);
Class.prototype = prototype;
Class.prototype.constructor = Class;