[Webkit-unassigned] [Bug 60622] getUserMedia() should not throw when successCallback is undefined or null

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 30 08:03:18 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=60622





--- Comment #2 from Adam Bergkvist <adam.bergkvist at ericsson.com>  2011-05-30 08:03:19 PST ---
(In reply to comment #1)
> (In reply to comment #0)
> > From the spec:
> > 
> > 4. If successCallback is null, abort these steps.
> 
> I think you're right on this.
> 
> Currently, createFunctionOnlyCallback has optional flags as its last parameter for both JSC and V8 bindings. To accept null you just need to add the appropriate flag there.
> 
> However, I disagree about undefined as mentioned in the bug title. Please correct me if I'm wrong, but I think that allowing undefined would mean that we consider valid to call the function with only one argument, which seems not to be the case.

Since variables passed as arguments can be null or undefined (as opposed to having a "real" value) they are usually handled the same. If one would like to prevent the function from being called with only one argument one would have to check the number of arguments actually passed. I think the current specification should be read as: the successCallback argument is mandatory for the function to do what it should do, and the errorCallback is optional for handling errors.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list