W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

Re: QSA, the problem with ":scope", and naming

From: Charles Pritchard <chuck@jumis.com>
Date: Mon, 31 Oct 2011 18:32:00 -0700
Message-ID: <4EAF4C10.2010105@jumis.com>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
CC: public-webapps@w3.org
> On 10/31/11 7:25 PM, Alex Russell wrote:
>> For JS, it just means having a working ".length" property (in all the
>> ways that Arrays allow it to be used). Arrays are identical to other
>> objects in all other respects.
> No, they're not.  For example, off the top of my head, they get 
> serialized differently by JSON.stringify.  Note that this is based off 
> of the [[Class]] (ES5 section 15.12.3 definition of Str() item 10a).  
> So if you want your object to behave like an array for JSON 
> serialization, it needs to have the right [[Class]].
> I'd bet money there are other such things in ES5, for what it's worth.

Structured cloning fails for NodeList, same as postMessage, because of 
circular structure.  With .join, you get the .toString of the DOM Nodes. 
There is no JSON serialization for DOM elements.
Received on Tuesday, 1 November 2011 01:32:24 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:36 UTC