Closed
Conversation
alexlamsl
commented
Jan 31, 2017
lib/compress.js
Outdated
| || (self.operator == "+" | ||
| && (self.right.left.is_string(compressor) | ||
| || (self.left.is_string(compressor) | ||
| && self.right.right.is_string(compressor)))))) |
Collaborator
Author
There was a problem hiding this comment.
@kzc this practical joke has gotten seriously out of hand... any suggestions on improving readability would be greatly appreciated.
Contributor
There was a problem hiding this comment.
if (self.right instanceof AST_Binary
&& self.right.operator == self.operator
&& (self.operator == "&&"
|| self.operator == "||"
|| (self.operator == "+"
&& (self.right.left.is_string(compressor)
|| (self.left.is_string(compressor)
&& self.right.right.is_string(compressor))))))
{
kzc
reviewed
Jan 31, 2017
test/compress/concat-strings.js
Outdated
| 1 + 2 + ("3" + 4 + 5), | ||
| 1 + 2 + ("3" + 4 + "5"), | ||
| 1 + 2 + ("3" + "4" + 5), | ||
| 1 + 2 + ("3" + "4" + "5"), |
Contributor
There was a problem hiding this comment.
Ideally we don't want the test to be too long so it's easier to compare input: with expected:.
I'd break this concat_3 into four smaller tests.
kzc
reviewed
Jan 31, 2017
test/compress/concat-strings.js
Outdated
| 1 + "2" + ("3" + 4 + 5), | ||
| 1 + "2" + ("3" + 4 + "5"), | ||
| 1 + "2" + ("3" + "4" + 5), | ||
| 1 + "2" + ("3" + "4" + "5"), |
kzc
reviewed
Jan 31, 2017
test/compress/concat-strings.js
Outdated
| "1" + 2 + ("3" + 4 + 5), | ||
| "1" + 2 + ("3" + 4 + "5"), | ||
| "1" + 2 + ("3" + "4" + 5), | ||
| "1" + 2 + ("3" + "4" + "5"), |
Contributor
|
LGTM |
shuffle associative operations to minimise parentheses and aid other uglification efforts
cc07df1 to
ebd2d98
Compare
alexlamsl
added a commit
to alexlamsl/UglifyJS
that referenced
this pull request
Feb 11, 2017
Merged
alexlamsl
added a commit
to alexlamsl/UglifyJS
that referenced
this pull request
Feb 11, 2017
alexlamsl
added a commit
to alexlamsl/UglifyJS
that referenced
this pull request
Feb 18, 2017
shuffle associative operations to minimise parentheses and aid other uglification efforts closes mishoo#1454
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Born out of observation made in #301.
Tests in #1453 will need to update for more optimal results after this PR merges.