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

Unit test to detect issue in 8d14efe for #126 that causes aggressive parenthesis removal, functional differences #330

Merged
merged 1 commit into from Oct 27, 2013

Conversation

markjaquith
Copy link
Contributor

Adds a unit test to test for aggressive parenthesis removal introduced in 8d14efe for #126 that causes functional changes.

In WordPress, we had this code (excerpted):

'style="width: '+( 10 + parseInt(f) )+'px"'

It used to minify like this:

'style="width: '+(10+parseInt(f))+'px"'

But in 2.4.1 it minifies as:

'style="width: 10'+parseInt(f)+'px"' (functionally different).

A fix for this is above my JS pay grade, but here's a unit test that catches the issue.

Add a unit test to test to test for aggressive parenthesis removal that causes functional changes.
rvanvelzen added a commit to rvanvelzen/UglifyJS2 that referenced this pull request Oct 26, 2013
When attempting to concat the left-side of the rhs, make sure the rhs is
a string.
mishoo added a commit that referenced this pull request Oct 27, 2013
mishoo added a commit that referenced this pull request Oct 27, 2013
Unit test to detect issue in 8d14efe for #126 that causes aggressive parenthesis removal, functional differences
@mishoo mishoo merged commit 8979579 into mishoo:master Oct 27, 2013
semteacher pushed a commit to semteacher/WordPress that referenced this pull request Oct 30, 2013
…isual editor.

Pulls some arithmetic outside of some string concatenation to avoid a nasty uglify.js regression: mishoo/UglifyJS#330.

props LucP.
fixes #25700 for trunk.

Built from https://develop.svn.wordpress.org/trunk@25921


git-svn-id: http://core.svn.wordpress.org/trunk@25880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
semteacher pushed a commit to semteacher/WordPress that referenced this pull request Oct 30, 2013
…isual editor.

Pulls some arithmetic outside of some string concatenation to avoid a nasty uglify.js regression: mishoo/UglifyJS#330.

Merges [25921] to the 3.7 branch.

props LucP.
fixes #25700.

Built from https://develop.svn.wordpress.org/branches/3.7@25922


git-svn-id: http://core.svn.wordpress.org/branches/3.7@25881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
gcorne pushed a commit to gcorne/develop.wordpress that referenced this pull request Jan 13, 2014
…isual editor.

Pulls some arithmetic outside of some string concatenation to avoid a nasty uglify.js regression: mishoo/UglifyJS#330.

props LucP.
fixes #25700 for trunk.


git-svn-id: http://develop.svn.wordpress.org/trunk@25921 602fd350-edb4-49c9-b593-d223f7449a82
bakulev pushed a commit to bakulev/word-test that referenced this pull request Dec 2, 2014
…isual editor.

Pulls some arithmetic outside of some string concatenation to avoid a nasty uglify.js regression: mishoo/UglifyJS#330.

props LucP.
fixes #25700 for trunk.

Built from https://develop.svn.wordpress.org/trunk@25921
bakulev pushed a commit to bakulev/word-test that referenced this pull request Dec 2, 2014
…isual editor.

Pulls some arithmetic outside of some string concatenation to avoid a nasty uglify.js regression: mishoo/UglifyJS#330.

Merges [25921] to the 3.7 branch.

props LucP.
fixes #25700.

Built from https://develop.svn.wordpress.org/branches/3.7@25922
mondi-webdigital pushed a commit to mondi-webdigital/prueba-wordpress that referenced this pull request Jan 14, 2016
…isual editor.

Pulls some arithmetic outside of some string concatenation to avoid a nasty uglify.js regression: mishoo/UglifyJS#330.

Merges [25921] to the 3.7 branch.

props LucP.
fixes #25700.

Built from https://develop.svn.wordpress.org/branches/3.7@25922
nylen pushed a commit to nylen/wordpress-develop-svn that referenced this pull request Feb 16, 2017
…isual editor.

Pulls some arithmetic outside of some string concatenation to avoid a nasty uglify.js regression: mishoo/UglifyJS#330.

props LucP.
fixes #25700 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@25921 602fd350-edb4-49c9-b593-d223f7449a82
kierzniak pushed a commit to friendsofwp/wordpress that referenced this pull request Jul 11, 2017
…isual editor.

Pulls some arithmetic outside of some string concatenation to avoid a nasty uglify.js regression: mishoo/UglifyJS#330.

Merges [25921] to the 3.7 branch.

props LucP.
fixes #25700.

Built from https://develop.svn.wordpress.org/branches/3.7@25922
fcc-machine-user pushed a commit to openfcci/wordpress that referenced this pull request Sep 22, 2017
…isual editor.

Pulls some arithmetic outside of some string concatenation to avoid a nasty uglify.js regression: mishoo/UglifyJS#330.

Merges [25921] to the 3.7 branch.

props LucP.
fixes #25700.

Built from https://develop.svn.wordpress.org/branches/3.7@25922


git-svn-id: http://core.svn.wordpress.org/branches/3.7@25881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
VenusPR added a commit to VenusPR/Wordpress_Richard that referenced this pull request Mar 9, 2023
…isual editor.

Pulls some arithmetic outside of some string concatenation to avoid a nasty uglify.js regression: mishoo/UglifyJS#330.

Merges [25921] to the 3.7 branch.

props LucP.
fixes #25700.

Built from https://develop.svn.wordpress.org/branches/3.7@25922


git-svn-id: http://core.svn.wordpress.org/branches/3.7@25881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.

None yet

2 participants