Skip to content

Do not render initializers of hoisted variables in dead branches - #2384

Merged
lukastaegert merged 2 commits into
masterfrom
fix-conditional-expression-rendering
Aug 7, 2018
Merged

Do not render initializers of hoisted variables in dead branches#2384
lukastaegert merged 2 commits into
masterfrom
fix-conditional-expression-rendering

Conversation

@lukastaegert

@lukastaegert lukastaegert commented Aug 7, 2018

Copy link
Copy Markdown
Member

This PR contains:

  • bugfix
  • feature
  • refactor
  • tests
  • documentation
  • metadata

Breaking Changes?

  • yes
  • no

If yes, please describe the breakage.

Please Describe Your Changes

Resolves #2381.

When hoisted variable declarations in dead branches of if statements are included, their initializers were not included with them (which is intended). The rendering logic did not account for that, though. This will check in variable declarators if the initializer is included and otherwise only render the variable name.

@guybedford

Copy link
Copy Markdown
Contributor

Nice!

@lukastaegert
lukastaegert merged commit 500d72e into master Aug 7, 2018
@lukastaegert
lukastaegert deleted the fix-conditional-expression-rendering branch August 7, 2018 18:32
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.

TypeError: Cannot read property 'start' of null

3 participants