File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ protected function extractRegex()
242242 (isset ($ match ['after ' ]) ? $ match ['after ' ] : '' );
243243 };
244244
245- $ pattern = '(?P<regex>\/.*?( ?<! \\\\)( \\\\\\\\)*\/[gimy]*)(?![0-9a-zA-Z\/]) ' ;
245+ $ pattern = '(?P<regex>\/(.| \\\\ )+?(( ?<! \\\\) \\\\\\\\)*\/[gimy]*)(?![0-9a-zA-Z\/]) ' ;
246246
247247 // a regular expression can only be followed by a few operators or some
248248 // of the RegExp methods (a `\` followed by a variable or value is
Original file line number Diff line number Diff line change @@ -1115,6 +1115,17 @@ function someOtherFunction() {
11151115 'if(!0||/^(https?:)?\/\//.test( \'xxx \'))alert(1) ' ,
11161116 );
11171117
1118+ // https://github.com/matthiasmullie/minify/issues/196
1119+ $ tests [] = array (
1120+ 'if ( true ) {
1121+ console.log(true);
1122+ // ...comment number 2 (something with dots?)
1123+ } else {
1124+ console.log(false);
1125+ } ' ,
1126+ 'if(!0){console.log(!0)}else{console.log(!1)} ' ,
1127+ );
1128+
11181129 // known minified files to help doublecheck changes in places not yet
11191130 // anticipated in these tests
11201131 $ files = glob (__DIR__ .'/sample/minified/*.js ' );
You can’t perform that action at this time.
0 commit comments