Closed rjbs closed 7 years ago
+1.
Though, if we just dcloned the two arguments, wouldn't that be enough to protect us in all cases?
Yeah, I tend to reach for dclone as a strategy of last resort because as I recall it's very slow. So, I considered this and decided against it, but it wasn't a very carefully considered thing, mostly habit.
Applied.
Right now, sort and filter might be autovivified from undef to [] and {} respectively. This preserves the original value.
If acting on the filters alters their contents rather than just promoting them, this is not enough, but we should be mapping new values into a new structure, not altering the input in place.
Tests for this are found in a downstream application.