Skip to content

Commit 35a83e0

Browse files
authored
Merge pull request #136 from tedious/revert-124-master
Revert "To identify coorect end of the regex"
2 parents 7cb41f8 + ba35b9d commit 35a83e0

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

src/JShrink/Minifier.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ protected function saveRegex()
626626
$this->echo($this->b);
627627

628628
while (($this->a = $this->getChar()) !== false) {
629-
if ($this->a === '/' && (preg_match('/g|\n|i|\)|\.|,|\s/', $this->peek()) === 1)) {
629+
if ($this->a === '/') {
630630
break;
631631
}
632632

tests/Resources/jshrink/input/regex_end_string.js

-3
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
function test(string){return(string||'').replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,'\\$1')}
1+
function test(string){return(string||'').replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,
2+
'\\$1'
3+
)
4+
}

tests/Resources/jshrink/output/regex_end_string.js

-1
This file was deleted.

0 commit comments

Comments
 (0)