@samitouri / QOS-React-2 / commits / 571edd85c2

Revert "Remove dependence on ES5 shams per #4189"

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