Re: Instance constructors

2011-10-11 Thread Brendan Eich
On Oct 11, 2011, at 5:43 AM, David Bruant wrote: > It gives me an idea for a proxy library which would be to pass a custom field > in a data descriptor indicating the type. The proxy would enforce the type > under the hood and either coerce silently or throw if the type is incorrect. The origin

Re: Instance constructors

2011-10-11 Thread Tom Van Cutsem
2011/10/11 Mark S. Miller > On Tue, Oct 11, 2011 at 11:43 AM, David Bruant wrote: > >> It gives me an idea for a proxy library which would be to pass a custom >> field in a data descriptor indicating the type. The proxy would enforce the >> type under the hood and either coerce silently or throw

Re: Instance constructors

2011-10-11 Thread Mark S. Miller
On Tue, Oct 11, 2011 at 11:43 AM, David Bruant wrote: > It gives me an idea for a proxy library which would be to pass a custom > field in a data descriptor indicating the type. The proxy would enforce the > type under the hood and either coerce silently or throw if the type is > incorrect. Tha

Re: Instance constructors

2011-10-11 Thread David Bruant
Le 11/10/2011 05:48, Cameron McCormack a écrit : On 24/09/11 8:35 AM, Allen Wirfs-Brock wrote: Regarding, WebIDL. It seems to me, that it just needs an extended attribute to specifies which attributes are instance attributes rather than prototype attributes. I think it only makes sense to ha

Re: Instance constructors

2011-10-10 Thread Cameron McCormack
On 24/09/11 8:35 AM, Allen Wirfs-Brock wrote: Regarding, WebIDL. It seems to me, that it just needs an extended attribute to specifies which attributes are instance attributes rather than prototype attributes. I think it only makes sense to have IDL attributes correspond to properties on th

Re: Instance constructors

2011-09-23 Thread David Bruant
Le 24/09/2011 00:35, Allen Wirfs-Brock a écrit : > let instance = Object.create(o); > instance.constructor(/* constructor args */) > > This assumes that the new instance will inherit "constructor" from its > prototype chain (possibly all the way to Object.prototype.constructor (.i.e. > Object). >

Re: Instance constructors

2011-09-23 Thread Allen Wirfs-Brock
let instance = Object.create(o); instance.constructor(/* constructor args */) This assumes that the new instance will inherit "constructor" from its prototype chain (possibly all the way to Object.prototype.constructor (.i.e. Object). If you are careful to always code your constructors to return

Instance constructors

2011-09-23 Thread David Bruant
Hi, Currently, WebIDL states (4.5.3): "There MUST exist an interface prototype object for every interface defined (...)