Skip to content

Commit

Permalink
stop trimming all trailing whitespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Mar 12, 2011
1 parent d957c43 commit b785585
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
6 changes: 2 additions & 4 deletions lib/nodes.js

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

8 changes: 1 addition & 7 deletions src/nodes.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ exports.Block = class Block extends Base
o.scope = new Scope null, this, null
o.level = LEVEL_TOP
code = @compileWithDeclarations o
code = code.replace TRAILING_WHITESPACE, ''
if o.bare then code else "(function() {\n#{code}\n}).call(this);\n"

# Compile the expressions body for the contents of a function, with
Expand Down Expand Up @@ -1669,8 +1668,7 @@ Closure =
return expressions if expressions.jumps()
func = new Code [], Block.wrap [expressions]
args = []
if (mentionsArgs = expressions.contains @literalArgs) or
( expressions.contains @literalThis)
if (mentionsArgs = expressions.contains @literalArgs) or expressions.contains @literalThis
meth = new Literal if mentionsArgs then 'apply' else 'call'
args = [new Literal 'this']
args.push new Literal 'arguments' if mentionsArgs
Expand Down Expand Up @@ -1741,10 +1739,6 @@ LEVEL_ACCESS = 6 # ...[0]
# Tabs are two spaces for pretty printing.
TAB = ' '

# Trim out all trailing whitespace, so that the generated code plays nice
# with Git.
TRAILING_WHITESPACE = /[ \t]+$/gm

IDENTIFIER = /^[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*$/
SIMPLENUM = /^[+-]?\d+$/

Expand Down

0 comments on commit b785585

Please sign in to comment.