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

collapse consecutive if-statements with the same condition (#450) #460

Merged
merged 2 commits into from
Apr 10, 2017

Conversation

Rich-Harris
Copy link
Member

Ref #450. Adds a new addConditionalLine method to CodeBuilder which collapses things like this...

if ( foo ) {
  bar();
}

if ( foo ) {
  baz();
}

...into things like this:

if ( foo ) {
  bar();
  baz();
}

Only used inside recompute for now, but could probably be used elsewhere as well.

@Rich-Harris Rich-Harris merged commit 79c4563 into master Apr 10, 2017
@Rich-Harris Rich-Harris deleted the gh-450 branch April 10, 2017 19:17
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.

1 participant