Async Functions for ECMAScript
The introduction of Promises and Generators in ECMAScript presents an opportunity to dramatically improve the language-level model for writing asynchronous code in ECMAScript. The spec text can be found here.
This proposal is implemented in a regenerator which can compile ES5 code containing async and await down to vanilla ES5 to run in existing browsers and runtimes.
This repo contains a complete example using a large number of the features of the proposal. To run this example:
npm install
regenerator -r server.asyncawait.js | nodeDebatable Syntax & Semantics
Awaiting Non-Promise
When the value passed to await is a Promise, the completion of the async function is scheduled on completion of the Promise. For non-promises, behaviour aligns with Promise conversion rules according to the proposed semantic polyfill.
Surface syntax
Instead of async function/await, the following are options:
function^/awaitfunction!/yieldfunction!/awaitfunction^/yield

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
