support for structuredClone

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
User avatar
szczelnybez
Apollo supporter
Apollo supporter
Posts: 34
Joined: 2021-01-20, 00:11

support for structuredClone

Unread post by szczelnybez » 2023-01-03, 12:53

First,
Happy New Year to everyone!

I was wondering if there are any plans for implementation of JS structuredClone() method in future PM releases. As for now, I understand there is no support for it.

Regards

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35474
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: support for structuredClone

Unread post by Moonchild » 2023-01-03, 13:09

There are currently no plans to implement this. Considering spotty support outside of (recent-ish) Chromium/Gecko it'll be a low priority consideration, but if anyone wants to contribute an implementation, by all means! :)
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
RealityRipple
Astronaut
Astronaut
Posts: 647
Joined: 2018-05-17, 02:34
Location: Los Berros Canyon, California
Contact:

Re: support for structuredClone

Unread post by RealityRipple » 2023-01-03, 17:17

Code: Select all

function structuredClone(x)
{
 return JSON.parse(JSON.stringify(x));
}
:D

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35474
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: support for structuredClone

Unread post by Moonchild » 2023-01-03, 19:06

Of course that doesn't address the "transfer" part of the spec for it, but yeah it's a crude workaround/implementation
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
RealityRipple
Astronaut
Astronaut
Posts: 647
Joined: 2018-05-17, 02:34
Location: Los Berros Canyon, California
Contact:

Re: support for structuredClone

Unread post by RealityRipple » 2023-01-03, 20:55

It was a joke, but you can't [code]sarcasm-ize code[/code], can you?

Locked