I proposed an enhanced definition for `async return` and `async throw` to
address this issue
in https://github.com/tc39/ecmascript-asyncawait/issues/38 – it didn’t get
accepted, however it is implemented in rodent
(see https://github.com/MatAtBread/nodent#exiting-async-functions-from-callbacks)
The conflation of assignment and awaiting is a bad idea. It leads to lots
of unnecessary temporary variables and makes anything but the simplest
expression involving more than one await/promise very ugly - akin to the
original syntax you're trying to avoid with inner variable declarations and
<
I'd also prefer this. Plus, one could use 'try' in an expression context as
a unary operator.
// z is undefined if a or a.b or a.b.c are undefined
z = try a.b.c ;
// x is undefined if a exists but b or c don't. It throws a ReferenceError
if a doesn't exist.
x = a.(try b.c) ;
I've
and resolve whether you
await them or not. If you want to handle exceptions, you need to call
.then and provide an error handler, but other than that it's totally ok to
not bother waiting for a promise.
On 19 Dec 2015, at 22:02, Mat At Bread > wrote:
Which is what I said, I hope. Use the
Which is what I said, I hope. Use the .then for top-level invitation.
Dimitry's example wouldn't resolve the Promise
On 19 December 2015 9:24:04 pm Fabrício Matté wrote:
@bread I see you are referencing Dmitry's sample, but why do you say it
won't work? AFAIK async functions return promises,
5 matches
Mail list logo