coffee-script icon indicating copy to clipboard operation
coffee-script copied to clipboard

Support for Promise-style (ECMAScript-7-style) await

Open davidbau opened this issue 10 years ago • 0 comments

This is just a preliminary demonstration of promise-style await, built as an extension of iced.

If fn is an async function that returns a Promise, then you can now say

await fn() or x = await fn()

Note that this mode only occurs when there is no "defer" inside the awaited expression. If a "defer" is present, the traditional iced-style await is done.

Unfinished items:

  • await fn() cannot be used in arbitrary expression context. You can only say "x = await fn()" as a statement.
  • although Promises have a clean mechanism for exceptions, this doesn't implement it.

davidbau avatar Jan 25 '15 14:01 davidbau