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

Do not await iterated value in for-await-of #24474

Merged
merged 2 commits into from
May 30, 2018
Merged

Do not await iterated value in for-await-of #24474

merged 2 commits into from
May 30, 2018

Conversation

rbuckton
Copy link
Member

This change more closely aligns with the specified for-await-of semantics, per 13.7.5.13, step 6.d-6.h. At no time during those steps is there an Await for nextValue.

Fixes #21115

Copy link
Member

@weswigham weswigham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functional tests ❤️

@rbuckton rbuckton merged commit 364fce3 into master May 30, 2018
@rbuckton rbuckton deleted the fix21115.2 branch May 30, 2018 00:54
case 0: return { value: 1, done: false };
case 1: return { value: Promise.resolve(2), done: false };
case 2: return { value: new Promise<number>(resolve => setTimeout(resolve, 100, 3)), done: false };
default: return { value: undefined: done: true };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a typo on this line: undefined: should be undefined,
Same in all other test cases below

ajafff added a commit to ajafff/TypeScript that referenced this pull request Jun 1, 2018
@rbuckton
Copy link
Member Author

rbuckton commented Jun 7, 2018

@mhegazy do you want this ported to release-2.9 as well?

@mhegazy
Copy link
Contributor

mhegazy commented Jun 7, 2018

yes please.

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.

Using for-await-of should resolve the Promise?
4 participants