Skip to content

Commit

Permalink
don't fail on empty arguments (fixes #317)
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Oct 25, 2016
1 parent c382cf5 commit 59b596d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/parser/index.js
Expand Up @@ -1079,7 +1079,14 @@ function getFunctionArguments(scope) {
break;

case TokenType.Comma:
removeTrailingSpaces(argument.sequence);
if (argument) {
removeTrailingSpaces(argument.sequence);
} else {
args.insert(List.createItem({
type: 'Argument',
sequence: new List()
}));
}
scanner.next();
readSC();
argument = null;
Expand Down
4 changes: 4 additions & 0 deletions test/fixture/compress/issue/317.css
@@ -0,0 +1,4 @@
.test {
background: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, .2)), to(rgba(0, 0, 0, 0)));
-webkit-mask-box-image: -webkit-gradient(linear, left top, right top, color-stop(, rgba(0, 0, 0, 0)), color-stop(.5, rgba(0, 0, 0, .8)), color-stop(1, rgba(0, 0, 0, 0)))
}
1 change: 1 addition & 0 deletions test/fixture/compress/issue/317.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 59b596d

Please sign in to comment.