Skip to content

Commit

Permalink
Fix /**/ bug and add test cases.
Browse files Browse the repository at this point in the history
This fixes tedious#40.
  • Loading branch information
tedivm committed Nov 11, 2014
1 parent 4c2c2ca commit 785733f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/JShrink/Minifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ protected function initialize($js, $options)
{
$this->options = array_merge(static::$defaultOptions, $options);
$js = str_replace("\r\n", "\n", $js);
$js = str_replace('/**/', '', $js);
$this->input = str_replace("\r", "\n", $js);

// We add a newline to the end of the script to make it easier to deal
Expand Down
3 changes: 3 additions & 0 deletions tests/Resources/jshrink/input/empty_comment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/**/
var test;
/**/
1 change: 1 addition & 0 deletions tests/Resources/jshrink/output/empty_comment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var test;

0 comments on commit 785733f

Please sign in to comment.