Matthias Mullie
13641aee3c
php-cs-fixer fixes
2016-01-06 16:44:12 -08:00
Matthias Mullie
31371a6a67
Strip empty else-statements
...
Fixes #91
2016-01-04 14:59:19 -08:00
Matthias Mullie
72c862d141
Improve check for invalid (too long) paths (which are likely content)
...
Fixes #90
2016-01-04 14:22:38 -08:00
Matthias Mullie
da03f6d13c
Don't strip double simicolons inside for
...
Fixes issue #89
2015-12-17 22:35:42 +01:00
Matthias Mullie
44cbb9c0f5
Add test for issue #66
2015-09-07 21:35:28 +02:00
Matthias Mullie
fe80dc7657
Alternative double-semicolon removal fix
...
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
2015-09-07 21:26:29 +02:00
Kait Todesk
f2f072ad54
Preserve for-loop semicolons when 2nd statement is empty
2015-09-07 12:05:27 +03:00
Matthias Mullie
bdbb91277b
php-cs-fixer
2015-09-05 21:49:18 +02:00
Matthias Mullie
c1b61592f4
Update cache repo location
2015-09-04 11:02:35 +02:00
Matthias Mullie
c7dcdc4934
Add test for issue #64
2015-08-20 16:32:14 +02:00
Matthias Mullie
ea809e7d06
Improve string-extraction regex
...
Fixes bug #58
2015-08-20 16:09:10 +02:00
Matthias Mullie
c37967744d
Recognize regular expressions after reserved words
...
Fixes issue #59
2015-08-19 16:48:35 +02:00
Matthias Mullie
76cf88faaa
Add test for issue #58
2015-08-19 16:20:20 +02:00
Matthias Mullie
4cf2880e51
Preserve newline immediately after regex
...
Fixes issue #56
2015-08-19 16:05:08 +02:00
Matthias Mullie
5497bea3d1
Don't collapse line feeds after "return"
...
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
2015-06-29 17:51:16 +02:00
Matthias Mullie
894928f067
Add test case for issue #53
2015-06-29 17:51:00 +02:00
Matthias Mullie
7d68b7da3b
Add tests for multibyte char paths
...
Meanwhile also made it possible to stub a path in the tests, and
stop writing out the minifier result.
2015-05-13 17:43:25 +02:00
Matthias Mullie
49a2aca294
Allow minified data to be written to cache
2015-05-05 16:43:08 +02:00
Matthias Mullie
90837a6886
Don't replace while
if it's part of a do-while
...
Fixes issue #50
2015-05-05 16:27:10 +02:00
Matthias Mullie
30a459229f
Add gzip method
...
Fixed #47
2015-04-07 15:47:36 +02:00
Matthias Mullie
2a70744313
Shorten while(true) to for(;;)
2015-04-07 15:35:03 +02:00
Matthias Mullie
ecd1a04d88
Allow for-loops with empty bodies
...
Fixed #42
2015-04-07 15:26:37 +02:00
Matthias Mullie
e15f77b7f6
Don't convert standalone arrays
...
"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
2015-03-12 16:11:36 +01:00
Matthias Mullie
0916262056
Don't override already restored data
...
Fixes issue #43
2015-03-10 10:01:13 +01:00
Matthias Mullie
d34af3d323
php-cs-fixer fixes
2015-03-06 13:17:33 +01:00
Matthias Mullie
22dbb726a0
Don't strip double semicolons before )
...
Fixes #40
2015-02-26 09:07:21 +01:00
Matthias Mullie
778c63c8eb
Don't replace reserved words by property notation
...
Fixes #41
2015-02-26 08:41:17 +01:00
Matthias Mullie
3528c67597
Get rid of any ; before }
...
Fixes issue #37
2015-02-16 21:12:33 +01:00
Matthias Mullie
434d0125e6
Fix coding standard violations
...
Thanks, php-cs-fixer
2015-02-12 13:34:50 +01:00
Matthias Mullie
5d1886a2ef
Add a newline between scripts being joined
...
Fixes issue #35
2015-02-06 11:14:06 +01:00
Matthias Mullie
471f982e63
Improve string extraction
...
Test to check if ending string delimiter is escaped was flawed.
2015-02-03 18:27:30 +01:00
Matthias Mullie
f54f58d8b1
Don't strip whitespace after ++ or --
2015-02-02 19:28:35 -08:00
Matthias Mullie
3acd3c3a9b
Don't eat \n following a single-line comment
...
It may be needed for ASI to kick in
2015-02-02 16:11:52 -08:00
Matthias Mullie
b0cd6f5e0a
Add test for issue #33
2015-02-02 15:29:57 -08:00
Matthias Mullie
09c6c5ef72
Shorten booleans: !0 and !1
2015-02-01 12:21:27 -08:00
Matthias Mullie
26271a6c4a
Also preserve backtick-encapsulated strings
...
Backticks can also be used for a string: it's a special
kind of string that allows string interpolation.
2015-01-24 18:24:47 -08:00
Matthias Mullie
8f12edd022
Fix propertyNotation forced on simple 1-key arrays
...
Fixes bug #31
2015-01-23 08:58:52 -08:00
Matthias Mullie
e2ee427f26
Fix propertyNotation regex
2015-01-11 17:39:46 +01:00
Matthias Mullie
8f38d48a38
Fix propertyNotation
...
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.
2015-01-09 11:19:24 +01:00
Matthias Mullie
9c160601ad
Replaces all occurrences of array['key'] by array.key
2014-12-31 16:07:08 +01:00
Matthias Mullie
7b5abfe181
Seperate JS files by ; & more thorough checking for ++ & --
2014-10-14 11:30:23 +02:00
Matthias Mullie
a2c2c1f01b
No longer move char by char
...
Let the regexes find, then only replace first match. This
makes us move in whole batches at once (though regexes will
become a bit slower, now having to match not just first char)
2014-10-13 10:10:47 +02:00
Matthias Mullie
07c1bd1e3a
Test common methods
...
Meanwhile also fix appending of multiple JS sources:
they should be split by line feed.
2014-10-12 22:27:53 +02:00
Matthias Mullie
c782c473f9
Improve test coverage for CSS minifier
2014-10-12 21:10:22 +02:00
Matthias Mullie
ed139866fe
Make 1 regex instead of a combination of regexes
...
And slightly fix it, adding test which it failed on:
numbers followed by var-like were incorrectly joined.
2014-10-12 19:41:32 +02:00
Matthias Mullie
f1b565bc99
Improve test coverage & remove redundant code
2014-10-12 17:42:22 +02:00
Matthias Mullie
98f9efd5fc
Fix SyntaxError: identifier starts immediately after numeric literal
2014-10-11 02:06:09 +02:00
Matthias Mullie
da1b6a195e
Don't remove space between a+ ++b
2014-10-10 08:38:39 +02:00
Matthias Mullie
9f6493e06e
Add test for multiple /
2014-10-10 08:18:47 +02:00
Matthias Mullie
ab4ff96048
Fix issue with finding (potentially escaped) regexes
2014-10-09 10:56:39 +02:00