Revert "Prevent the defineProperty being called when property already exists"

This reverts commit 3f6fe70f39a00e2b120ec07f3eea6a1194e924ce.
This commit is contained in:
Marak 2013-08-21 14:36:13 -07:00
parent d26602a2d7
commit c0bc636d4d

View File

@ -50,13 +50,11 @@ var addProperty = function (color, func) {
};
if (Object.defineProperty) {
if(!String.prototype.hasOwnProperty(color)) {
Object.defineProperty(String.prototype, color, {
get : func,
configurable: true,
enumerable: false
});
}
Object.defineProperty(String.prototype, color, {
get : func,
configurable: true,
enumerable: false
});
} else {
String.prototype.__defineGetter__(color, func);
}