# Native deep-clone algorithm?

**URL:** <https://es.discourse.group/t/native-deep-clone-algorithm/2020>\
**Category:** 💡 Ideas\
**Created:** [April 19, 2024, 3:38am UTC](https://es.discourse.group/t/native-deep-clone-algorithm/2020 "2024-04-19T03:38:47Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![aclaymore](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/aclaymore/32/501_2.png) [@aclaymore](https://es.discourse.group/u/aclaymore)\
**Post date:** [April 19, 2024, 6:20am UTC](https://es.discourse.group/t/native-deep-clone-algorithm/2020/2 "2024-04-19T06:20:24Z")

</div>

Related links:

> <https://github.com/tc39/ecma262/issues/2555>
>
> We reached consensus on the general idea of taking over maintainership of the st…ructured clone algorithm in the October 2021 TC39, pending a requested review by @erights of the concrete algorithm proposed to be refactored into ecma262.
> 
> The two algorithms proposed to be copied are \[StructuredSerializeInternal\](https://html.spec.whatwg.org/#structuredserializeinternal) and \[StructuredDeserialize\](https://html.spec.whatwg.org/#structureddeserialize).
> 
> For \[StructuredSerializeInternal\](https://html.spec.whatwg.org/#structuredserializeinternal):
> \- Steps 19 and 20 will be refactored out, as they deal with non-ES values.
> \- All occurrences of "throw a "\`DataCloneError\`" \`DOMException\`" will be changed to "throw a host-defined exception".
> 
> For \[StructuredDeserialize\](https://html.spec.whatwg.org/#structureddeserialize):
> \- Step 20 and all its substeps will be refactored out since it deals with non-ES values.
> \- All occurrences of "throw a "\`DataCloneError\`" \`DOMException\`" will be changed to "throw a host-defined exception".

> [@structuredClone() as ECMAScript standard](https://es.discourse.group/t/structuredclone-as-ecmascript-standard/1661):
>
> While [structuredClone()](https://developer.mozilla.org/en-US/docs/Web/API/structuredClone) is presumably not related to any API (such as the DOM, file system or other), why is it not part of ECMAScript? Is there anything that prevents such a function from being defined as an ECMAScript standard? Are there any plans to add this or a similar function to the ECMAScript standard?

---

_[View the full topic](https://es.discourse.group/t/native-deep-clone-algorithm/2020)._
