Skip to content

Navigation Menu

Sign in
Sign up

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

Open
davidbau wants to merge 4 commits into
maxtaco:iced2 from
davidbau:asyncassign
Open

Support for Promise-style (ECMAScript-7-style) await #147
davidbau wants to merge 4 commits into
maxtaco:iced2 from
davidbau:asyncassign

Conversation

@davidbau

@davidbau davidbau commented Jan 25, 2015

Copy link
Copy Markdown

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /