Property notation, for example, alters the content. If we've stripped
whitespace first, the transformations in propertynotation may no
longer be correct.
Fixed issue #133
1: some were not stripped agressively enough. E.g.:
return !0 -> return!0
2: some were stripped too aggressive. E.g.:
func()
{1+2}
Should not be joined on 1 line, since func() could be a function
call and {1+2} an unrelated piece of code
Fixes issue #130
- Fix contents of "tests\css\sample\convert_relative_path\source\absolute.css" to test @import without url();
- Change index in array of matches (Minify.php:321) to correctly replace empty strings.
- Fix JSTest data for cross-system compatibility;
- Update test-case for https://github.com/matthiasmullie/minify/issues/56 and perform fixes;
- Some code simplifications, remove some code duplicates;
- Ignore test samples for convenience of running tests;
- Update readme.
Previous one didn't sufficiently remove double semicolons.
This one should be too eager, but then restore them if they
were valid in a for loop.
Fixes#70
return is not guaranteed to be followed by a return value.
It could just be "return", followed by nothing (void return),
not even a semicolon, just line feed (ASI)
Whatever is next could, for example, be another operator.
We may just need ASI to kick in there, so keep the line feed
after return.
Fixes issue #54
"return" looks like it could be a variable of which ['x']
is a key. I've improved the code to also check for keywords.
If whatever preceeds it is one of the keywords, don't convert.
Fixes issue #44
I originally executed this on content where string had not yet been replaced.
Because this could cause false positives and match content inside strings, I
switched it to be executed after strings had been extracted.
However, this means those array key texts were also replaced, by something that
always looks like a valid variable. I've now moved that check to match the
extracted value, which we'll be replacing.