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

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