-
Notifications
You must be signed in to change notification settings - Fork 49k
Closed
Description
Being able to use addons/update.js
with a prototype seems to be a goal of the addon according to this line:
Line 29 in 3eb3641
return copyProperties(new x.constructor(), x); |
Since we use object constructor instead of just {}
When updating an object with a prototype, the prototype is kept, as expected, but the copyProperties.js include prototype methods as object properties.
This is probably because of this loop:
react/src/vendor/core/copyProperties.js
Line 39 in 8a47813
for (var k in v) { |
See this http://jsfiddle.net/QVjLw/
I think the loop should be
for (var k in v) {
if ( v.hasOwnProperty(k) ) {
obj[k] = v[k];
}
}
Instead of
for (var k in v) {
obj[k] = v[k];
}
It would be nice to not pollute the object attributes with unnecessary methods and keep them in the prototype
Metadata
Metadata
Assignees
Labels
No labels