dslomov/ecmascript-structured-clone

Give [[Clone]] hook to InternalStructuredClone?

Closed this issue · 4 comments

It seems it does not necessarily need memory as argument, but needs to be able to recursively invoke InternalStructuredClone. We could give it some kind of hook that already has memory and targetRealm preset.

What is the use case? (Which "implementation" of [[Clone]] needs to recurse?)

It seems bad not to provide the hooks to do the same we do ourselves. But also, ImageData.

Agreed with need for hooks, I just wanted a use case to validate the hooks :)

Since [[Clone]] is an internal algorithm, it has access to InternalStructuredClone already. (Perhaps if this becomes an API at some point we'd need a real hook, but also a design that's a lot more complicated.)