Skip to content

Commit

Permalink
Fixed BinOp minification
Browse files Browse the repository at this point in the history
  • Loading branch information
rspivak committed May 9, 2011
1 parent 5968c5b commit 75f3382
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/slimit/visitors/minvisitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,12 @@ def visit_ForIn(self, node):
return s

def visit_BinOp(self, node):
if getattr(node, '_parens', False):
template = '(%s%s%s)'
if node.op in ('instanceof', 'in'):
template = '%s %s %s'
else:
template = '%s%s%s'
if getattr(node, '_parens', False):
template = '(%s)' % template
return template % (
self.visit(node.left), node.op, self.visit(node.right))

Expand Down

0 comments on commit 75f3382

Please sign in to comment.