Re: Deprecating Future's .then()
Sean Hogan <[email protected]>
| Newsgroups | gmane.comp.web.dom.general |
|---|---|
| Message-ID | <[email protected]> |
On 6/06/13 10:56 AM, Tab Atkins Jr. wrote: > On Thu, Jun 6, 2013 at 9:51 AM, Sean Hogan <[email protected]> wrote: >> Should the spec continue to allow this behavior? >> >> or ... >> >> Should the resolve algorithm - which is currently infinite unwrap for >> accepted / fulfilled futures - also be infinite unwrap for rejected futures? > I'm satisfied with either behavior. It might be nice to have it > mirror the then/chain behavior, where it fully-unwraps or > single-unwraps as appropriate, but I'd likely be fine with both doing > single-unwrapping or both doing full-unwrapping. > > ~TJ > I think the most contentious behavior would be what to do with mixed sequences of accepted / rejected Futures. Should Future.accept( Future.reject ( Future.accept( true ) ) ) .then( function(val) { console.log( val ); } , function(err) { console.error( err ); }); behave the same as Future.reject( Future.accept( Future.reject ( Future.accept( true ) ) ) ) .then( function(val) { console.log( val ); } , function(err) { console.error( err ); }); Is it just a nonsense usage - most likely to be a programming error? If so, what is the best / noisiest way to fail?