Re: [Constructor] vs [NamedConstructor]

Dimitry Golubovsky:
> I have two questions about these two extended attributes:
> 
> 1. Can an interface have both Constructor and NamedConstructor
> extended attributes?

Yes.

> 2. Although NamedConstructor cannot have the same name as the
> interface it is defined on (4.2.4 ed. draft), are the following
> definitions semantically equivalent from implementation standpoint?
> 
> […]
> 
> while per 4.2.4 the latter must be rejected by the WebIDL compiler,
> but from the implementation standpoint it might be easier to convert
> the former into the latter internally and process both attributes
> uniformly.

They are a little different.  For example, constants on an interface
aren’t reflected as properties on a named constructor object.  Also,
[[HasInstance]] isn’t defined for named constructor objects.

-- 
Cameron McCormack ≝ http://mcc.id.au/

Received on Monday, 5 October 2009 07:58:45 UTC