W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2009

Re: Handling too few arguments in method calls

From: Cameron McCormack <cam@mcc.id.au>
Date: Thu, 25 Jun 2009 17:31:38 +1000
To: public-webapps@w3.org
Message-ID: <20090625073138.GJ4736@arc.mcc.id.au>
Jonas Sicking:
> If we went with option 1, what is the effect of the [optional] flag?
> I.e. what is the difference between 1 and putting [optional] on all
> arguments?

The difference would be that without [optional] you’d be stuck with
however undefined gets type converted into whatever type the argument is
declared to be.  With [optional], you can just define in prose what
happens when you call that version of the operation without the

> I'd prefer to go with option 2, but use [optional] in more specs. This
> way we can in places where it really does not make sense to leave out
> an argument (such as for Node.appendChild) make that throw, while in
> cases where leaving arguments out can be dealt with using [optional].

I agree.

I’d like to know the opinion of any IE folks on the list.

> …
> An alternative way would be to go with option 2, but introduce a
> [required] keyword.

I’d rather option 1.

Cameron McCormack ≝ http://mcc.id.au/
Received on Thursday, 25 June 2009 07:32:16 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:12:54 UTC