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

Re: Handling too few arguments in method calls

From: Oliver Hunt <oliver@apple.com>
Date: Thu, 25 Jun 2009 11:29:00 -0700
Cc: public-webapps@w3.org
Message-Id: <D77E3721-C73A-453C-B24F-3A2661447FE8@apple.com>
To: Darin Adler <darin@apple.com>
There's also overloaded functions like (for example)  
CanvasRenderingContext2d.drawImage
void drawImage(in HTMLImageElement image, in float dx, in float dy,  
[Optional] in float dw, in float dh)
if I do drawImage(image, x, y, foo) is this under-provision for  
drawImage(image,x,y,foo,undefined) or over provision for  
drawImage(image,x,y) or is it an error?

Do we need an annotation to say something like
void drawImage(in HTMLImageElement image, in float dx, in float dy,  
[Optional 2] in float dw, in float dh)
(or something) that would say the next 2 arguments are optional, but  
both must be provided?

--Oliver

On Jun 25, 2009, at 10:58 AM, Darin Adler wrote:

> What about too many arguments, and ignoring extra ones? Is that  
> settled?
>
>    -- Darin
>
>
Received on Thursday, 25 June 2009 18:29:40 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:31 GMT