Closed ForbesLindesay closed 11 years ago
It would be a simple matter to remove the isFulfilled optimization.
Hmm, that would make Q.all unusable in QEJS because it makes the performance unbearable.
How about changing isFulfilled so that it's interoperable? We don't want to change isPromise
because other parts of the library already use that to mean 'is a Q promise'.
/**
* @returns whether the given object is a value or fulfilled
* promise.
*/
Q.isFulfilled = isFulfilled;
function isFulfilled(object) {
var val = valueOf(object);
return !(val && typeof val === 'object' && typeof val.then === 'function');
}
Thanks
It would be nice if
Q.all()
accepted any other promises-aplus promises.Ideally this would log
['foo']
but it actually logs the still unresolved promise.