promise resolution did not handle the case where the resolution value passed directly to resolve() was itself a promise.  Handling that case also allowed when() to be refactored to be slightly smaller
promise resolution did not handle the case where the resolution value passed directly to resolve() was itself a promise.  Handling that case also allowed when() to be refactored to be slightly smaller

SourcePointUSA/when,rwaldron/when.js,DJDNS/when.js,tkirda/when,frank-weindel/when,tkirda/when,stevage/when,petkaantonov/when,anthonyvia/when,caporta/when,icodeforlove/whenplus,frank-weindel/when,ning-github/when,mlennon3/when,caporta/when,anthonyvia/when,SourcePointUSA/when,mlennon3/when,ning-github/when,stevage/when