Re: Handling too few arguments in method calls

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
argument.

> 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