- From: Boris Zbarsky <bzbarsky@MIT.EDU>
- Date: Mon, 31 Oct 2011 20:51:32 -0400
- To: 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. > We'll need ES 6 proxies to get the working .length thing today. Not ideal. I think we should just start assuming ES 6 proxies or equivalent mechanism. It's needed for all sorts of stuff and UAs are implementing it anyway. If we want to avoid assuming it, we could just specify things in terms of ES5 internal classes and hooks. -Boris
Received on Tuesday, 1 November 2011 01:12:07 UTC