Skip to content

Commit

Permalink
Merge cfb695d into 9ba1b45
Browse files Browse the repository at this point in the history
  • Loading branch information
enricodias committed Apr 25, 2020
2 parents 9ba1b45 + cfb695d commit f4a300e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/JS.php
Expand Up @@ -209,7 +209,7 @@ protected function stripComments()
$this->registerPattern('/\/\*.*?\*\//s', '');

// single-line comments
$this->registerPattern('/\/\/.*$/m', '');
$this->registerPattern('/(\/\/)(?!i).*$/m', '');
}

/**
Expand Down
18 changes: 18 additions & 0 deletions tests/js/JSTest.php
Expand Up @@ -1324,6 +1324,24 @@ function someOtherFunction() {
'/^\[(x| )\](?=\s)/i',
);

// https://github.com/matthiasmullie/minify/issues/323
$tests[] = array(
'a = {
device: [
[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7)/i],
[/(sony)\s(tablet\s[ps])\sbuild\//i, /(sony)?(?:sgp.+)\sbuild\//i],
[/(?:sony)?(?:(?:(?:c|d)\d{4})|(?:so[-l].+))\sbuild\//i]
]
}',
'a={device:[[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7)/i],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[/(?:sony)?(?:(?:(?:c|d)\d{4})|(?:so[-l].+))\sbuild\//i]]}'
);

// https://github.com/matthiasmullie/minify/issues/329
$tests[] = array(
'test: [/\sedg\//i],',
'test:[/\sedg\//i],',
);

// known minified files to help doublecheck changes in places not yet
// anticipated in these tests
$files = glob(__DIR__.'/sample/minified/*.js');
Expand Down

0 comments on commit f4a300e

Please sign in to comment.