cuthbertLab / music21j

Javascript port of music21 -- Toolkit for Computational Musicology
Other
147 stars 41 forks source link

Fix shallow copying by repeatAppend() #177

Open jacobtylerwalls opened 2 years ago

jacobtylerwalls commented 2 years ago

Fixes #176

mscuthbert commented 2 years ago

common.merge is designed to work on {} objects not [] array. Probably needs a line before the l. 143 if to ask if this[key] instanceof Array and then do a deep array copy.

mscuthbert commented 1 month ago

Now that it's 2024, I wonder if we should just be replacing 90% of these calls with structuredClone() and saying that anything beyond the top-level keys needs to be explicitly listed as having its own clone function or needs to be clonable with structuredClone...