URLs / subclassing JavaScript

Anne van Kesteren annevk at annevk.nl
Mon Dec 17 06:56:46 PST 2012


On Mon, Dec 17, 2012 at 3:39 PM, David Bruant <bruant.d at gmail.com> wrote:
> Which part of the platform needs a sync Object.observe?

(Thanks for the reply.) I think nothing does per se, but it might make
manner more convenient.


> I don't understand what you mean by "types". And I also don't understand
> what you can't implement in pure ES6 in what you've described.

By types I mean e.g. constraining set() to just accept strings.

There's not a problem implementing this in ES6, I'm just wondering
what is considered better here. I'm getting kinda tired of the "IDL is
terrible and outside TC39 people design terrible APIs" sentiment so I
figured I'd just go and ask since this is a new API and can be
amended.


> I feel there are 2 different goals:
> * Being able at all to implement browser APIs in ECMAScript (which is close
> to being possible with Proxies. document.all being an exception).
> * Being able to conveniently implement browser APIs in ECMAScript (which may
> require the addition of a MultiMap) which is up for debate.

I feel there's another one too, "make it JavaScript-y", though this is
never described much in detail, although from what I got so far using
Proxies is not considered good practice. That's why the URLQuery API
has no getter/setter but instead has methods like get() and set().


-- 
http://annevankesteren.nl/


More information about the es-discuss mailing list