We show how to copy singly scoped class instances. The Russians have worked on this technology for years with little success. After initial concerns about findings making their way to enemy K9 units, publishing went ahead since American feline intelligence has known for years that Russian K9's don't understand JavaScript.
Meouzer
Open the console window to see that all tests of Test-Ser-Des.js have been passed.
For ES6, serialization/deserialization is more intrusive than for ES5. A value copy of a class instance x of foo, where foo is an ES5 class is simply y = Object.create(Object.GetProptotypeOf(x)). This doesn't work in ES6 because of private fields. If foo is an ES6 class then a value copy of x can only be obtained through a call to a "default" constructor of foo, which is to do absolutely nothing, but in doing nothing the private fields are automatically initialized for the value copy. Of course default constructors don't exist so we have to emulate such. If the constructor receives defaultConstructorSymbol as its first parameter, the constructor immediately returns having done nothing but produce the value copy. Otherwise the constructor routes code to an #initialize() method which is the "true" constructor. This is all simple as is writing the serialization and deserialization routines as seen below.