mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Revert "Remove dependence on ES5 shams per #4189"
This commit is contained in:
@@ -109,10 +109,8 @@ var ReactElement = function(type, key, ref, self, source, owner, props) {
|
||||
element._self = self;
|
||||
element._source = source;
|
||||
}
|
||||
if (Object.freeze) {
|
||||
Object.freeze(element.props);
|
||||
Object.freeze(element);
|
||||
}
|
||||
Object.freeze(element.props);
|
||||
Object.freeze(element);
|
||||
}
|
||||
|
||||
return element;
|
||||
|
||||
@@ -98,12 +98,16 @@ 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 shims expected by React are not available: ' +
|
||||
'One or more ES5 shim/shams expected by React are not available: ' +
|
||||
'https://fb.me/react-warning-polyfills'
|
||||
);
|
||||
break;
|
||||
|
||||
@@ -175,10 +175,7 @@ SyntheticEvent.Interface = EventInterface;
|
||||
SyntheticEvent.augmentClass = function(Class, Interface) {
|
||||
var Super = this;
|
||||
|
||||
var E = function () {};
|
||||
E.prototype = Super.prototype;
|
||||
var prototype = new E();
|
||||
|
||||
var prototype = Object.create(Super.prototype);
|
||||
assign(prototype, Class.prototype);
|
||||
Class.prototype = prototype;
|
||||
Class.prototype.constructor = Class;
|
||||
|
||||
Reference in New Issue
Block a user