When building a promise with a dynamic array of dependencies, this array
can sometimes be empty. This behavior was currently not specified. We
expect this promise to return an empty array, which would be consistent
with the return value for multiple input dependencies (an array with one
result per input promise).
There is one other case when this situation (no task, no dependencies)
can happen: external promise resolution using a Writer object, e.g.
through Restify::Promise.fulfilled. To differentiate these cases, we
explicitly check for one or more empty arrays being passed in.
When building a promise with a dynamic array of dependencies, this array can sometimes be empty. This behavior was currently not specified. We expect this promise to return an empty array, which would be consistent with the return value for multiple input dependencies (an array with one result per input promise).
There is one other case when this situation (no task, no dependencies) can happen: external promise resolution using a
Writer
object, e.g. throughRestify::Promise.fulfilled
. To differentiate these cases, we explicitly check for one or more empty arrays being passed in.