This breaks specs that use structured clone within getter operations:
For example, it causes "x = localStorage.arrayBuffer" to clear the
arrayBuffer within localStorage as a side-effect of retrieving it, which
is clearly unintended.
Structured clone is a const operation; making a structured clone of something doesn't modify it.Â You're changing a fundamental property of structured clone, which isn't a change one spec should be making to another spec.Â (Has Ian Hickson been involved in this discussion?)
It also effectively changes every setter API that uses structured clone, changing them into functions that modify their arguments as well.
It's also generally inconvenient.Â For example, if I have an object describing the current state and I want to stash it
in History, I now have to be very careful to
copy off any ArrayBuffers within it before doing so, and to update any references to those buffers.Â I can currently say "history.pushState(anything, title, url)" without having to care about what "anything" is and whether it might be modified; please don't break that.