mirror of
https://github.com/matthiasmullie/minify.git
synced 2025-02-24 15:32:47 +01:00
Don't remove space between a+ ++b
This commit is contained in:
parent
30a742f9d5
commit
da1b6a195e
@ -335,8 +335,8 @@ class JS extends Minify
|
||||
$operators = array_combine($operators, $escaped);
|
||||
|
||||
// make sure + and - can't be mistaken for ++ and --, which are special
|
||||
$operators['+'] = '(?<!\+)\+(?!\+)';
|
||||
$operators['-'] = '(?<!\-)\-(?!\-)';
|
||||
$operators['+'] = '(?<!\+)\+(?!\s*\+)';
|
||||
$operators['-'] = '(?<!\-)\-(?!\s*\-)';
|
||||
|
||||
return $operators;
|
||||
}
|
||||
|
@ -249,6 +249,16 @@ else statement',
|
||||
'alert("this is a test")',
|
||||
);
|
||||
|
||||
// mix of ++ and +: three consecutive +es will be interpreted as ++ +
|
||||
$tests[] = array(
|
||||
'a++ +b',
|
||||
'a+++b',
|
||||
);
|
||||
$tests[] = array(
|
||||
'a+ ++b',
|
||||
'a+ ++b',
|
||||
);
|
||||
|
||||
// add comment in between whitespace that needs to be stripped
|
||||
$tests[] = array(
|
||||
'object
|
||||
|
Loading…
x
Reference in New Issue
Block a user