Tab Atkins Jr. (2014-09-12T16:44:50.000Z)
domenic at domenicdenicola.com (2014-09-17T22:19:20.986Z)
On Fri, Sep 12, 2014 at 8:14 AM, C. Scott Ananian <ecmascript at cscott.net> wrote: > This is exactly the same as the jquery example. No > implementation-introspection needed. You've got it right. `async function` solely makes the function return a Promise for its return value, rather than returning its return value normally; nothing magical goes on beyond that. There's absolutely no need to check if a function is "async-safe" or propagate an `async` on all functions up the call chain; you can just call the function normally and receive a Promise. You only need to make yourself `async` if you want to consume the value of an async function call directly, without having to go through the Promise indirection manually. Browsers will likely optimize cases where an async function call is immediately consumed by an await expression and do some pipelining or something, but that's behind-the-scenes optimization.
domenic at domenicdenicola.com (2014-09-17T22:19:14.052Z)
On Fri, Sep 12, 2014 at 8:14 AM, C. Scott Ananian <ecmascript at cscott.net> wrote: > This is exactly the same as the jquery example. No > implementation-introspection needed. You've got it right. `async function` solely makes the function return a Promise for its return value, rather than returning its return value normally; nothing magical goes on beyond that. There's absolutely no need to check if a function is "async-safe" or propagate an `async` on all functions up the call chain; you can just call the function normally and receive a Promise. You only need to make yourself `async` if you want to consume the value of an async function call directly, without having to go through the Promise indirection manually. Browsers will likely optimize cases where an async function call is immediately consumed by an await expression and do some pipelining or something, but that's behind-the-scenes optimization. ~TJ