Skip to content

Commit

Permalink
Remove parens from calls and function definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
puffnfresh committed Mar 31, 2012
1 parent e03ddb2 commit e09229e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/compile.js
Expand Up @@ -163,6 +163,11 @@ var compileNodeWithEnv = function(n, env, opts) {
return defs.join(";\n");
},
visitExpression: function() {
// No need to retain parenthesis for operations of higher
// precendence in JS
if(n.value instanceof nodes.Function || n.value instanceof nodes.Call) {
return compileNode(n.value);
}
return '(' + compileNode(n.value) + ')';
},
visitReplacement: function() {
Expand Down

0 comments on commit e09229e

Please sign in to comment.