W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2014

[webidl] Stringifiers should allow optional arguments

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 8 Jul 2014 22:49:00 -0700
Message-ID: <CAAWBYDC_uKFzW1PNr7sE=0fguKwxk=hLki9DWQeKOQcpa=zj5w@mail.gmail.com>
To: "public-script-coord@w3.org" <public-script-coord@w3.org>
Right now, webidl mandates that stringifier methods must not take any
arguments.  There's no rationale given, but I presume it's because
stringifiers are ordinarily called automatically by the language,
without any arguments.

This seems like too strong a restriction; all that's actually required
is that all stringifier args must be marked optional.  As well, the
restriction means you can't express existing stringifiers, such as
Number#toString, using the WebIDL stringifier abstraction, as they
allow optional args.

So, I think the restriction on stringifier args should be loosened to
only require that all args be marked optional.

Received on Wednesday, 9 July 2014 05:49:47 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:22 UTC