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

Re: [whatwg] [URL] DOM API Feedback

From: David Bruant <bruant.d@gmail.com>
Date: Mon, 19 Nov 2012 08:36:22 +0100
Message-ID: <50A9E176.2010906@gmail.com>
To: Anne van Kesteren <annevk@annevk.nl>
Cc: whatwg <whatwg@whatwg.org>
Le 19/11/2012 00:17, Anne van Kesteren a écrit :
> On Sun, Nov 18, 2012 at 11:34 PM, David Bruant <bruant.d@gmail.com> wrote:
>> I feel the URLQuery object could be a regular object. Or maybe an ES6 Map.
>> If not an ES6 Map, maybe its API could be mapped exactly to ES6 Map. It
>> would increase interoperability.
> It cannot be a regular object because it modifies an underlying
> string.
An ES6 proxy could do the trick here.

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

> And URLQuery represents
> an ordered list of key-value pairs so I'm not sure how close it can
> be.
"ordered list of key-value pairs"
=> Both objects and maps can be ordered list of key-value pairs (objects 
can be more with getters and setters, but we don't need to care about that)
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 which some content relies on, making it a de facto standard.


[1] http://wiki.ecmascript.org/doku.php?id=strawman:enumeration
Received on Monday, 19 November 2012 07:48:01 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:48 UTC