use JavaScript::Minifier::XS qw(minify);
$minified = minify("
function a() {
return ( /\// ).test( url );
}");
say $minified;
Output:
function a(){return(};
There is similar code in the jquery mobile js (the isPath function uses that regex syntax) and the
XS minifier completely hoses it. It's not only different than the original but the syntax is also
invalid. I'm guessing it thinks \// is the start of a comment even though it's a valid regex.
A workaround for this specific syntax is to use
return new RexExp('/').test( url );
but at least in this case the source is an external dep, so it's not safe to go modifying it