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

Fix captured block scope variables in downlevel async. #10890

Merged
merged 2 commits into from
Sep 13, 2016
Merged

Conversation

rbuckton
Copy link
Member

This PR adds the yield* support to __generator from #10106, and leverages the yield* transform to support our emit for captured block-scope loop variables when compiled inside of a down-level async function.

Fixes #10889

@@ -73,7 +73,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge

const generatorHelper = `
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (sent[0] === 1) throw sent[1]; return sent[1]; }, trys: [], stack: [] }, sent, f;
var _ = { label: 0, sent: function() { if (sent[0] === 1) throw sent[1]; return sent[1]; }, trys: [], stack: [] }, sent, y, f, v, r;
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add comment to generatorHelper to describe meanings of all variables

@mhegazy
Copy link
Contributor

mhegazy commented Sep 13, 2016

we will need to update the one in tslib as well.

@rbuckton rbuckton merged commit 02334d8 into master Sep 13, 2016
@rbuckton rbuckton deleted the fix10889 branch September 13, 2016 21:31
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 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