src/JS.php
changed.
Other files ignored by Codecov
tests/js/JSTest.php
has changed.
209 | 209 | $placeholder = '/*'.$count.'*/'; |
|
210 | 210 | $minifier->extracted[$placeholder] = $match[0]; |
|
211 | 211 | ||
212 | - | return $placeholder; |
|
212 | + | return $placeholder . ($match[3] ? $match[2] . $match[3] : ''); |
|
213 | + | } |
|
214 | + | // should not remove the \n before a var|let etc. at this stage, because it could be a case like this: var a=1\n/*comment*/\nvar b=2; |
|
215 | + | if($match[3]) { |
|
216 | + | return $match[2] . $match[3]; |
|
213 | 217 | } |
|
214 | 218 | ||
215 | 219 | return ''; |
|
216 | 220 | }; |
|
217 | 221 | ||
218 | 222 | // multi-line comments |
|
219 | - | $this->registerPattern('/\n?\/\*(.*?)\*\/\n?/s', $callback); |
|
223 | + | $this->registerPattern('/\n?\/\*(.*?)\*\/(\n?)(var|let|const|enum|function|class|)/s', $callback); |
|
220 | 224 | ||
221 | 225 | // single-line comments |
|
222 | 226 | $this->registerPattern('/\/\/.*$/m', ''); |
Files | Complexity | Coverage |
---|---|---|
src | 120 | 99.56% |
Project Totals (3 files) | 120 | 99.56% |