Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 4 commits into
base: iced2
Choose a base branch
from

Conversation

davidbau
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant