1
0
Fork 0

Unbreak shallowCopy

This commit is contained in:
Alan Plum 2016-05-02 17:19:01 +02:00
parent 9d6e22f2a3
commit 4af0c67c5c
No known key found for this signature in database
GPG Key ID: 8ED72A9A323B6EFD
1 changed files with 1 additions and 23 deletions

View File

@ -37,17 +37,6 @@
////////////////////////////////////////////////////////////////////////////////
Object.defineProperty(Object.prototype, '_shallowCopy', {
set(value) {
if (this === Object.prototype) {
throw new TypeError(`Can not override Object.prototype._shallowCopy!`);
}
Object.defineProperty(this, '_shallowCopy', {
configurable: true,
enumerable: true,
writable: true,
value
});
},
get() {
var self = this;
return Object.prototype.propertyKeys.reduce(function (previous, key) {
@ -66,18 +55,7 @@ Object.defineProperty(Object.prototype, 'propertyKeys', {
return Object.keys(this).filter(function (key) {
return (key.charAt(0) !== '_' && key.charAt(0) !== '$');
});
},
set(value) {
if (this === Object.prototype) {
throw new TypeError(`Can not override Object.prototype.propertyKeys!`);
}
Object.defineProperty(this, 'propertyKeys', {
configurable: true,
enumerable: true,
writable: true,
value
});
},
}
});