Re: [Futures] accept/resolve/reject on a resolver don't have clearly defined behavior if no value is passed
Boris Zbarsky <[email protected]>
| Newsgroups | gmane.comp.web.dom.general |
|---|---|
| Message-ID | <[email protected]> |
On 6/6/13 7:12 AM, Anne van Kesteren wrote:
> The behavior we want is equivalent to:
>
> function accept(value) { ... }
> accept()
>
> Which will result in value being undefined.
Sure, but the question is what arguments.length ends up being. That's
the only difference between "missing argument" and "argument explicitly
passed as undefined" in JS.
If we plan to always pass explicit undefined to callbacks when we were
accepted with no value, then we should make the callbacks take a
non-optional "any", since they will in fact always get one.
-Boris