Skip to content

Fix missing final label#10883

Merged
rbuckton merged 2 commits into
masterfrom
fix10876
Sep 13, 2016
Merged

Fix missing final label#10883
rbuckton merged 2 commits into
masterfrom
fix10876

Conversation

@rbuckton
Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

CC: @mhegazy, @yuit

@mhegazy
Copy link
Copy Markdown
Contributor

mhegazy commented Sep 13, 2016

Unit test?

@rbuckton
Copy link
Copy Markdown
Contributor Author

@mhegazy, added the case from the referenced issue.

@DanielRosenwasser
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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