Skip to content

Commit

Permalink
Merge pull request #4093 from alubbe/betteryieldcompilation
Browse files Browse the repository at this point in the history
Remove unnecessary brackets and empty spaces around yield
  • Loading branch information
jashkenas committed Sep 14, 2015
2 parents d1c6db4 + b1ef5a9 commit da23a2f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
14 changes: 11 additions & 3 deletions lib/coffee-script/nodes.js

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

6 changes: 4 additions & 2 deletions src/nodes.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -1837,9 +1837,11 @@ exports.Op = class Op extends Base
else if @first.expression?
parts.push @first.expression.compileToFragments o, LEVEL_OP
else
parts.push [@makeCode "(#{op} "]
parts.push [@makeCode "("] if o.level >= LEVEL_PAREN
parts.push [@makeCode op]
parts.push [@makeCode " "] if @first.base?.value isnt ''
parts.push @first.compileToFragments o, LEVEL_OP
parts.push [@makeCode ")"]
parts.push [@makeCode ")"] if o.level >= LEVEL_PAREN
@joinFragmentArrays parts, ''

compilePower: (o) ->
Expand Down

0 comments on commit da23a2f

Please sign in to comment.