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

[Constructor] vs [NamedConstructor]

From: Dimitry Golubovsky <golubovsky@gmail.com>
Date: Fri, 2 Oct 2009 12:46:47 -0400
Message-ID: <bcba51a0910020946g1eb73a95q361cd673126a0542@mail.gmail.com>
To: public-script-coord@w3.org
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

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