mirror of
https://github.com/matthiasmullie/minify.git
synced 2025-02-24 20:52:37 +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);
|
$operators = array_combine($operators, $escaped);
|
||||||
|
|
||||||
// make sure + and - can't be mistaken for ++ and --, which are special
|
// make sure + and - can't be mistaken for ++ and --, which are special
|
||||||
$operators['+'] = '(?<!\+)\+(?!\+)';
|
$operators['+'] = '(?<!\+)\+(?!\s*\+)';
|
||||||
$operators['-'] = '(?<!\-)\-(?!\-)';
|
$operators['-'] = '(?<!\-)\-(?!\s*\-)';
|
||||||
|
|
||||||
return $operators;
|
return $operators;
|
||||||
}
|
}
|
||||||
|
@ -249,6 +249,16 @@ else statement',
|
|||||||
'alert("this is a test")',
|
'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
|
// add comment in between whitespace that needs to be stripped
|
||||||
$tests[] = array(
|
$tests[] = array(
|
||||||
'object
|
'object
|
||||||
|
Loading…
x
Reference in New Issue
Block a user