W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2014

Re: Exposing constructors of readonly interfaces to web authors

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 10 Jul 2014 12:09:51 -0400
Message-ID: <53BEBACF.1050801@mit.edu>
To: Rik Cabanier <cabanier@gmail.com>, Domenic Denicola <domenic@domenicdenicola.com>
CC: "public-script-coord@w3.org" <public-script-coord@w3.org>
On 7/10/14, 10:55 AM, Rik Cabanier wrote:
> What if instead of interfaces, we just define them as dictionaries:

The JS reflection of a dictionary (what you get after converting a Web 
IDL dictionary to a JS value) is an object with some value properties.

>          Object.defineProperty(this.bounds, 'left', { enumerable:
>     true,get: function() {
>     return Math.min(Math.min(self.p1.x, self.p2.x), Math.min(self.p3.x,
>     self.p4.x));
>          } });

So that's not a dictionary.

Furthermore, why is it a good idea to have these getters on a 
per-instance basis instead of on a shared prototype?

-Boris
Received on Thursday, 10 July 2014 16:10:21 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:22 UTC