[whatwg] About the internal structured cloning algorithm
David Bruant
bruant at enseirb-matmeca.fr
Sat Jan 8 10:42:23 PST 2011
I have two distinct things to say about this algorithm.
First of all, at Step 5 :
"If input is an Array object or an Object object, then, for each
enumerable property in input, add a corresponding property to output
having the same name, and having a value created from invoking the
internal structured cloning algorithm recursively with the value of the
property as the "input" argument and memory as the "memory" argument.
The order of the properties in the input and output objects must be the
same.
Note : This does not walk the prototype chain."
This seems to be the description of the ECMAScript 5 Object.keys method
definition (ES5 section 15.2.3.14).
In ECMAScript 5, properties of an object which aren't on the prototype
chain are often (if not always) refered as "own properties".
And the Object.keys method returns all own enumerable property names.
Second of all, I am wondering if HTML5 is the right place to define such
an "algorithm". This seems to be extremely bound to ECMAScript (Date,
RegExp...). As such wouldn't WebIDL be a better place to define such an
algorithm ?
What's your opinion?
David
More information about the whatwg
mailing list