await on synchronous functions

Dean Landolt dean at
Thu Jul 23 14:06:43 UTC 2015

On Thu, Jul 23, 2015 at 9:06 AM, Andreas Rossberg <rossberg at>

> On 17 July 2015 at 23:39, Mark S. Miller <erights at> wrote:
>> On Fri, Jul 17, 2015 at 10:41 AM, Andrea Giammarchi <
>> andrea.giammarchi at> wrote:
>>> If I might, if there's one thing that has never particularly shone in
>>> JS, that is consistency.
>>> I see only two possibilities here: 1) it throws with non Promises 2) it
>>> "Promisify" anything that's not a Promise as if it was a
>>> `Promise.resolve(1)` ... but since there's too much magic in the second
>>> point, I'd rather stick with the first one.
>> Definitely #2. Had #1 been proposed, async/await never would have
>> achieved consensus.
> Wait, what?? Oh no, please don't bake that sloppy craze deeper into the
> language! Implicit conversions are Not Good.

Out of curiosity, can you give an example of the Not Good parts? ISTM the
`await` prefix is more of an explicit cast than an implicit conversation,
and other than the very small timing gap in how throws are handled I
pointed out a few days ago, I can't think of any situations where a throw
would make more sense than casting values to promises.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list