Skip to content

Commit

Permalink
Remove dependence on ES5 shams per #4189
Browse files Browse the repository at this point in the history
Docs not updated
  • Loading branch information
dgreensp committed Oct 6, 2015
1 parent 870a15a commit f95747b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/isomorphic/classic/element/ReactElement.js
Expand Up @@ -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;
Expand Down
6 changes: 1 addition & 5 deletions src/renderers/dom/ReactDOM.js
Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion src/renderers/dom/client/syntheticEvents/SyntheticEvent.js
Expand Up @@ -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;
Expand Down

0 comments on commit f95747b

Please sign in to comment.