webidl icon indicating copy to clipboard operation
webidl copied to clipboard

Consider disallowing multiple `[LegacyFactoryFunction]` identifiers per interface

Open ExE-Boss opened this issue 5 years ago • 4 comments

Currently, the following is allowed:

[LegacyFactoryFunction=A(),
 LegacyFactoryFunction=B(optional DOMString src),
 LegacyFactoryFunction=C(optional long width, optional long height)]
interface MultipleLegacyFactoryFunctionInterface {};

But it’s not used anywhere, and Chromium’s WebIDL processor doesn’t support it, and WebIDL2JS doesn’t intend to support it either (https://github.com/jsdom/webidl2js/pull/213#issuecomment-621277733).


This doesn’t intend to deprecate overloaded [LegacyFactoryFunction]s, which share the same identifier:

[LegacyFactoryFunction=Overloaded(),
 LegacyFactoryFunction=Overloaded(optional DOMString src),
 LegacyFactoryFunction=Overloaded(optional long width, optional long height)]
interface OverloadedLegacyFactoryFunctionInterface {};

See also

ExE-Boss avatar Apr 29 '20 16:04 ExE-Boss

Do we need overloaded though? HTML doesn't use it.

annevk avatar Apr 30 '20 04:04 annevk

Right, I think we should pare down LegacyFactoryFunction to the minimum, probably.

domenic avatar Apr 30 '20 13:04 domenic

Neither Blink nor Gecko allows multiple NamedConstructors either.

TimothyGu avatar Apr 30 '20 16:04 TimothyGu

We should in fact deprecate overloaded [LegacyFactoryFunction]s since nothing uses them and nothing will do so.

domenic avatar Mar 22 '21 00:03 domenic