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

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.

-Boris

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