Remove dependence on ES5 shams per #4189
Docs not updated
David Greenspan committed
Sep 24, 2015 at 05:43 UTC
f95747b929d50227fe3fdf2a999b8fecc18cd21f
3 files changed
+9
-8
src/isomorphic/classic/element/ReactElement.js
+4
-2
@@ -109,8 +109,10 @@ var ReactElement = function(type, key, ref, self, source, owner, props) {
109
element._self = self;
110
element._source = source;
111
}
112
- Object.freeze(element.props);
113
- Object.freeze(element);
112
+ if (Object.freeze) {
113
+ Object.freeze(element.props);
114
+ Object.freeze(element);
115
+ }
116
}
117
118
return element;
src/renderers/dom/ReactDOM.js
+1
-5
@@ -98,16 +98,12 @@ if (__DEV__) {
98
Object.keys,
99
String.prototype.split,
100
String.prototype.trim,
101
-
102
- // shams
103
- Object.create,
104
- Object.freeze,
101
];
102
103
for (var i = 0; i < expectedFeatures.length; i++) {
104
if (!expectedFeatures[i]) {
105
console.error(
110
- 'One or more ES5 shim/shams expected by React are not available: ' +
106
+ 'One or more ES5 shims expected by React are not available: ' +
107
'https://fb.me/react-warning-polyfills'
108
);
109
break;
src/renderers/dom/client/syntheticEvents/SyntheticEvent.js
+4
-1
@@ -175,7 +175,10 @@ SyntheticEvent.Interface = EventInterface;
175
SyntheticEvent.augmentClass = function(Class, Interface) {
176
var Super = this;
177
178
- var prototype = Object.create(Super.prototype);
178
+ var E = function () {};
179
+ E.prototype = Super.prototype;
180
+ var prototype = new E();
181
+
182
assign(prototype, Class.prototype);
183
Class.prototype = prototype;
184
Class.prototype.constructor = Class;