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 missing final label #10883

Merged
merged 2 commits into from
Sep 13, 2016
Merged

Fix missing final label #10883

merged 2 commits into from
Sep 13, 2016

Conversation

rbuckton
Copy link
Member

The generator transformer tries to avoid emitting an unnecessary final return statement if it would be otherwise unreachable. However, the detection logic for this case did not account for the possibility of a preceding break instruction pointing to the final label. This expands on the detection logic for this case.

Fixes #10876

@rbuckton
Copy link
Member Author

CC: @mhegazy, @yuit

@mhegazy
Copy link
Contributor

mhegazy commented Sep 13, 2016

Unit test?

@rbuckton
Copy link
Member Author

@mhegazy, added the case from the referenced issue.

@DanielRosenwasser
Copy link
Member

In the future, adding the test first helps get a before/after picture in the baselines. I usually don't bring it up, but I think it's arguably more important when it comes to the async/await emit.

@mhegazy
Copy link
Contributor

mhegazy commented Sep 13, 2016

👍

@rbuckton rbuckton merged commit 7e33955 into master Sep 13, 2016
@rbuckton rbuckton deleted the fix10876 branch September 13, 2016 17:10
@vladima
Copy link
Contributor

vladima commented Sep 13, 2016

👍

@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.

5 participants