[Constructor] vs [NamedConstructor]

Hi,

I have two questions about these two extended attributes:

1. Can an interface have both Constructor and NamedConstructor
extended attributes?

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?

[Constructor,
 Constructor(in float radius)]
interface Circle {
  attribute float r;
  attribute float cx;
  attribute float cy;
  readonly attribute float circumference;
};

and

[NamedConstructor=Circle,
 NamedConstructor=Circle(in float radius)]
interface Circle {
  attribute float r;
  attribute float cx;
  attribute float cy;
  readonly attribute float circumference;
};

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.

Thanks.

-- 
Dimitry Golubovsky

Anywhere on the Web

Received on Friday, 2 October 2009 16:47:27 UTC