26 Commits

Author SHA1 Message Date
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
Matthias Mullie
2ee3b4ed70 Properly organize tests 2014-10-09 09:08:21 +02:00
Matthias Mullie
c4a59c904e Make code respect PSR-4 2014-10-09 08:56:14 +02:00
Matthias Mullie
cf9e90ba4a Use PSR4 autoloader; move code to src/ 2014-10-09 08:38:58 +02:00
Matthias Mullie
76734ac3f7 Add PHPUnit dist file, move test files around 2014-10-08 16:34:49 +02:00