Closure-compiler: Add transpilation support for async and await

Created on 13 Jan 2016  路  9Comments  路  Source: google/closure-compiler

ES7 Work In Progress enhancement

Most helpful comment

It _may_ happen this quarter but I make no promises.

All 9 comments

FYI, we plan to support this, but it won't happen in Q1 for sure.

:+1:

It's also possible to transpile async/await to Promises like this:

In

async function test() {
  await db.destroy();
}

Out

function test() {
  return Promise.resolve().then(function () {
    return db.destroy();
  }).then(function () {});
}

_Source: https://github.com/marten-de-vries/kneden_

I specifically want the generator method - not promises. It is simply way too easy to swallow exceptions in non-trivial cases. See #1515

Is there are any progress on it?
Btw I am trying to _sell_ Closure Compiler (Google Traceur) to my team and without async/await it's a bit difficult with Babel nowadays :sweat_smile:

@metrofun Thanks, but FYI, Closure and Traceur are two different compilers :)

@Dominator008 My bad, I was sure Closure Compiler uses Traceur under the hood. Just to clarify then, I'm trying to _sell_ Closure Compiler ;)

It _may_ happen this quarter but I make no promises.

This missed the deadline for ES7 (== ES2016), so now the earliest this could be standardized is ES8.

Was this page helpful?
0 / 5 - 0 ratings