pvorb / clone

deeply clone arbitrary objects in javascript
https://www.npmjs.com/package/clone
MIT License
781 stars 130 forks source link

'toString' field removed from cloned object #105

Open assafey opened 5 years ago

assafey commented 5 years ago

Cloning an object that includes field 'toString' will have the following affect: before clone:

[ { a: 'aaa', toString: 'bbb' }, { a: 'ccc', toString: 'ddd' } ]

after clone:

[ { a: 'aaa' }, { a: 'ccc' } ]

'toString' field is removed from cloned object.

rictic commented 5 years ago

Could use hasOwnProperty to tell if a field from Object is being overwritten on the clonee.

assafey commented 5 years ago

@rictic not sure I’m following you. Is it a workaround?

JacobMisirian commented 5 years ago

Bump on this, this issue is hanging me up on the development of my programming language.