W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2009

Re: [Constructor] vs [NamedConstructor]

From: Cameron McCormack <cam@mcc.id.au>
Date: Mon, 5 Oct 2009 00:58:12 -0700
To: Dimitry Golubovsky <golubovsky@gmail.com>
Cc: public-script-coord@w3.org
Message-ID: <20091005075812.GD11626@wok.mcc.id.au>
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

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:02 UTC