clone icon indicating copy to clipboard operation
clone copied to clipboard

ES5 property attributes are not preserved

Open mbrowne opened this issue 7 years ago • 0 comments

Consider the following example:

var o = {};
Object.defineProperty(o, 'foo', {enumerable:true, writable:false, value:'f'});
var o2 = clone(o);

console.log(Object.getOwnPropertyDescriptor(o2, 'foo'));

The property descriptor on the copied object specifies the property as writable even though the original property wasn't writable.

mbrowne avatar Mar 04 '17 05:03 mbrowne