coffee-script
coffee-script copied to clipboard
Support for Promise-style (ECMAScript-7-style) await
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.