Re: Exposing constructors of readonly interfaces to web authors

On Sat, Jun 28, 2014 at 6:43 AM, Brendan Eich <brendan@secure.meer.net>
wrote:

> Dirk Schulze wrote:
>
>> DOMQuad is a new interface and indeed part of general layout efforts that
>> give authors more control and information over layout with JS. With the
>> described behavior, a live object is reasonable IMO.
>>
>
> This side of the discussion still seems to be missing the shared getters
> in prototype point, which is important. The (correct, compared to Rik's --
> thanks!) JS you sketched using Object.defineProperty makes getters *per
> instance*, with fresh getter function suites per instance -- and this is
> observable via ES5 introspection APIs. It's also way too costly for
> implementors to tolerate.


Can't we change the code so it always returns the same getters? ie instead
of creating a new {} and getter function, keep a reference of them in the
object and use them in Object.defineProperty. That way the object's
prototype will always have the same getters and it won't be very costly to
implement.

Received on Saturday, 28 June 2014 18:53:01 UTC