W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2012

Re: [whatwg] [URL] DOM API Feedback

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 19 Nov 2012 08:38:49 -0500
Message-ID: <50AA3669.3040607@mit.edu>
To: whatwg@lists.whatwg.org
On 11/19/12 2:36 AM, David Bruant wrote:
> An ES6 proxy could do the trick here.

But then it's not a Map at all, right?  It's a proxy for maybe a Map, 
maybe something else.  In what sense would it be a Map at that point?

>> I suppose the same goes for ES6 Map.
> As Tab suggested, a Map subclass could certainly work

How close are "subclasses" to not being vaporware (both in spec and 
implementation terms)?  Speccing things in terms of vaporware makes them 
pretty hard to implement in actual implementations...  Doesn't mean we 
shouldn't do it, but I'm a bit wary of it, in general.

> The ordered part for objects wasn't true in ES5 (implementation specific
> order), but is considered for ES6 [1] since all web engines do the same
> order

Except they don't.  Here's a trivial example:

   var obj = {};
   obj["2"] = 5;
   obj["1"] = 0;

which is handled differently by different UAs.  The "same order" bit is 
only true for property names that don't look like array indices.  Per 
proposed spec you linked to, by the way, this will enumerate properties 
in the order "1" followed by "2".

Of course nothing really stops pages from using url parameters whose 
names look like array indices.  So if we want ordered here, we just 
can't use a object to do it.

-Boris
Received on Monday, 19 November 2012 15:41:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:11 GMT