Skip to content

Commit

Permalink
Merge pull request #5062 from facebook/revert-4959-no-shams
Browse files Browse the repository at this point in the history
Revert "Remove dependence on ES5 shams per #4189"
  • Loading branch information
jimfb committed Oct 6, 2015
2 parents 0b73099 + 571edd8 commit 6446a45
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
6 changes: 2 additions & 4 deletions src/isomorphic/classic/element/ReactElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 5 additions & 1 deletion src/renderers/dom/ReactDOM.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 1 addition & 4 deletions src/renderers/dom/client/syntheticEvents/SyntheticEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6446a45

Please sign in to comment.