Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map and Set do not truly deep copy #9

Closed
GrosSacASac opened this issue Jan 10, 2020 · 3 comments
Closed

Map and Set do not truly deep copy #9

GrosSacASac opened this issue Jan 10, 2020 · 3 comments

Comments

@GrosSacASac
Copy link

let original = new Map([["a", {}]])
let c = klona(original)

c.get("a").x = 7
original.get("a").x // 7 oups

@lukeed
Copy link
Owner

lukeed commented Jan 10, 2020

Thank you, good catch 👍

@lukeed lukeed closed this as completed in dd79cb1 Jan 10, 2020
@GrosSacASac
Copy link
Author

Don't close yet, there is still an issue with Map keys, which can be anything including objects and must be klonad to void sharing variables pointers

@lukeed
Copy link
Owner

lukeed commented Jan 11, 2020

Ah, right! I never use them that way.

klonad

😂

lukeed added a commit that referenced this issue Jan 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants