-
Notifications
You must be signed in to change notification settings - Fork 43
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
Fix shallow copying by repeatAppend() #177
base: master
Are you sure you want to change the base?
Conversation
common.merge is designed to work on |
// music21.common.merge(ret[key], this[key]); | ||
ret[key] = this[key]; | ||
if (deep) { | ||
common.merge(ret[key], this[key] as any); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing this is not enough. Probably need to do something more like:
Split the section beginning:
for (const key in this) {
into its own method (common.cloneHelper?) (i.e. a function that doesn't use "this" but obj
or something like that). And then when encountering another dictionary/object, calling cloneHelper on that.
Now that it's 2024, I wonder if we should just be replacing 90% of these calls with |
Fixes #176