Skip to content

Fix down-level emit for captured loop variable in async function#15144

Merged
rbuckton merged 1 commit into
masterfrom
fix14357
Apr 12, 2017
Merged

Fix down-level emit for captured loop variable in async function#15144
rbuckton merged 1 commit into
masterfrom
fix14357

Conversation

@rbuckton
Copy link
Copy Markdown
Contributor

After adding --downlevelIteration support, the generators transformer now always emits a yield* with a call to __values. While this is fine for cases where the yielded expression is an array or when running in a host environment with Symbol.iterator, this change breaks the case where we synthesize a yield* in an async function that contains a block-scoped variable captured in a loop body.

As there is only one case in the transforms where this case can occur, I've added an EmitFlags flag to opt out of the new behavior for this one case.

Fixes #14357

@rbuckton
Copy link
Copy Markdown
Contributor Author

I'll also need to cherry-pick this into release-2.3 once it is merged.

@rbuckton rbuckton merged commit 60e056a into master Apr 12, 2017
@rbuckton
Copy link
Copy Markdown
Contributor Author

This has been merged into release-2.3 as well.

@rbuckton rbuckton deleted the fix14357 branch April 12, 2017 18:14
@microsoft microsoft locked and limited conversation to collaborators Jun 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants