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: if/else case with no dependencies #3514

Closed
wants to merge 1 commit into from

Conversation

J-IN
Copy link

@J-IN J-IN commented Sep 6, 2019

Related to : #3505

Adds an additional check to #3478 to deal with this case :

{#if "Eva".startsWith('E')}
eee
{:else}
rrr
{/if}

that generate this code :

if ((show_if == null) || ) show_if = !!("Eva".startsWith('E') == true)

This fix now generate the following when there are no dependencies :

if ((show_if == null) || false) show_if = !!("Eva".startsWith('E') == true)

@codecov-io
Copy link

codecov-io commented Sep 6, 2019

Codecov Report

Merging #3514 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3514   +/-   ##
=======================================
  Coverage   50.25%   50.25%           
=======================================
  Files           1        1           
  Lines         197      197           
=======================================
  Hits           99       99           
  Misses         98       98

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cc10714...6069462. Read the comment docs.

@Rich-Harris
Copy link
Member

thank you! there's actually a more complete fix that avoids generating unnecessary code, so I'll close this in favour of #3518

@Rich-Harris Rich-Harris closed this Sep 6, 2019
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.

3 participants