Skip to content

Commit

Permalink
Bug fix - rspivak#28
Browse files Browse the repository at this point in the history
  • Loading branch information
rspivak authored and acatton committed Jan 26, 2015
1 parent 2d9a65c commit edddd9e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CREDIT
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ Bug reports
- Michał Bartoszkiewicz https://github.com/embe
- Hasan Yasin Öztürk https://github.com/hasanyasin
- David K. Hess https://github.com/davidkhess
- Robert Cadena https://github.com/rcadena
- Robert Cadena https://github.com/rcadena
- rivol https://github.com/rivol
2 changes: 1 addition & 1 deletion src/slimit/tests/test_minifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ def assertMinified(self, source, expected):
$.hello = 'world';
}(jQuery));
""",
"(function($){$.hello='world';}(jQuery);)"),
"(function($){$.hello='world';}(jQuery));"),
]


Expand Down
6 changes: 5 additions & 1 deletion src/slimit/visitors/minvisitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,11 @@ def visit_BracketAccessor(self, node):
return s

def visit_FunctionCall(self, node):
s = '%s(%s)' % (self.visit(node.identifier),
template = '%s(%s)'
if getattr(node, '_parens', False):
template = '(%s)' % template

s = template % (self.visit(node.identifier),
','.join(self.visit(arg) for arg in node.args))
return s

Expand Down

0 comments on commit edddd9e

Please sign in to comment.