W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2011

[whatwg] Media Stream API: What is the intended behaviour for undefined mandatory arguments?

From: Cameron McCormack <cam@mcc.id.au>
Date: Thu, 2 Jun 2011 11:14:28 +1200
Message-ID: <20110601231428.GA20347@wok.mcc.id.au>
Aryeh Gregor:
> But there's an open issue that says "Need to test how implementations
> actually behave when passed too few or too many arguments."  So I
> wouldn't assume the standard is right.  Maybe data would be useful on
> how different browsers behave here -- although I suspect that it will
> vary greatly from method to method.  I can tell you from experience
> that Gecko throws if you pass fewer than three arguments to
> document.execCommand().  It makes sense to me -- if we want the API to
> not throw if the argument is omitted, why isn't the argument optional?

It could be that the default coercion from undefined is acceptable, be
that throwing a TypeError, or being converted to false, etc.

Some months ago, after meeting with the TC39 folks, we came out with the
proposal to make Web IDL be relaxed, i.e. assume undefined for missing
arguments and allow additional arguments to be ignored, which I mailed
to public-script-coord, but I didn?t see any pushback on that.  Since
this is something that I want to resolve soon, it might be worth my
bringing it up on the list again.

At the very least, though, I want the behaviour of non-overloaded and
overloaded operations to be the same.  The current behaviour is
confusing.

-- 
Cameron McCormack ? http://mcc.id.au/
Received on Wednesday, 1 June 2011 16:14:28 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:06 UTC