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

Re: [webidl] Defining constructors on non-global objects?

From: Boris Zbarsky <bzbarsky@mit.edu>
Date: Fri, 05 Sep 2014 12:29:09 -0400
Message-ID: <5409E4D5.9030402@mit.edu>
To: Domenic Denicola <domenic@domenicdenicola.com>, "public-script-coord@w3.org" <public-script-coord@w3.org>
On 9/5/14, 10:00 AM, Domenic Denicola wrote:
>> If this is the API you want, then for the moment you can define an AmbientLight factory method that returns an object of the right type, and the "new" call above will work due to how "new" works in JS.  But the returned object won't be instanceof Sensor.AmbientLight, and won't have Sensor.AmbientLight as its .constructor
> I think it would be better not to do that.

To be clear, by "you" I meant "an implementor using one of the existing 
code generators".

I agree we should come up with a better answer here, spec it, and 
implement it.

Received on Friday, 5 September 2014 16:29:38 UTC

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