> Le 4 déc. 2015 à 18:31, Andrea Giammarchi <andrea.giammar...@gmail.com> a > écrit : > > > async works with old code, old code cannot be promoted to async one. All I am > trying to explain is that I'd love to give well known, de-facto standard, > universally used APIs the ability to behave, for real, asynchronously > whenever the future of the language is available. > > How bad is that? > > Regards >
I think that the only place where you can safely provide a promise when a value was previously expected, is when you are in tail-position inside an async function (as part of either `await` or `return`). The "tail-position" restriction is bad for your case, because it is easy to switch between tail- and non-tail-position by refactoring, and thus switching semantics unexpectedly. Given that sync and async code may behave differently (race conditions...), picking randomly (because of unreliable guess) one semantics or the other is going to make it more difficult to debug. —Claude _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss