planttheidea / fast-copy

A blazing fast deep object copier
MIT License
1.13k stars 31 forks source link

Objects used multiple times in source object are not copied correctly #27

Closed darkowic closed 4 years ago

darkowic commented 4 years ago

If a non-extensible object reference is used multiple times in the copied object, then the non-extensible object is still existing in the copied object. It's difficult to explain that - here is a reproduction case - https://codesandbox.io/s/fast-copy-non-extensible-bug-cv0vh

I checked the source code and looks like it is an issue with the cache. Maybe I will take a look at it.

darkowic commented 4 years ago

It is even worse - the whole object is the same

planttheidea commented 4 years ago

Thanks for the PR! This should be fixed as-of 2.0.5.

darkowic commented 4 years ago

@planttheidea you forgot to update CHANGELOG ;)

planttheidea commented 4 years ago

Ack sorry you're right. I'll make sure to do that tonight.

EDIT: forgot I can just edit through github. Updated!