Fix shallow copying by repeatAppend()#177
Fix shallow copying by repeatAppend()#177jacobtylerwalls wants to merge 5 commits intocuthbertLab:masterfrom
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.
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