Skip to content

Commit

Permalink
rebuilt parser and rewrote the asserts wrapping loop in Cakefile usin…
Browse files Browse the repository at this point in the history
…g `do =>`
  • Loading branch information
satyr committed Oct 24, 2010
1 parent 9619fa6 commit abef3f5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Cakefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ task 'loc', 'count the lines of source code in the CoffeeScript compiler', ->
runTests = (CoffeeScript) ->
startTime = Date.now()
passedTests = failedTests = 0
wrap = (name, func) -> global[name] = -> ++passedTests; func arguments...
wrap name, func for all name, func of require 'assert'
for all name, func of require 'assert' then do (name, func) =>
global[name] = -> ++passedTests; func arguments...
global.eq = global.strictEqual
global.CoffeeScript = CoffeeScript
process.on 'exit', ->
Expand Down
2 changes: 1 addition & 1 deletion lib/nodes.js

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

2 changes: 1 addition & 1 deletion lib/parser.js

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

9 changes: 5 additions & 4 deletions src/nodes.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -889,14 +889,15 @@ exports.Code = class Code extends Base
# Short-circuit `traverseChildren` method to prevent it from crossing scope boundaries
# unless `crossScope` is `true`.
traverseChildren: (crossScope, func) -> super(crossScope, func) if crossScope

# Automatically calls the defined function.
do: ->
if @bound
@bound = no
new Call(new Value this, [new Accessor new Literal 'call']
[new Literal 'this'].concat this.params)
else new Call this, this.params
new Call new Value(this, [new Accessor new Literal 'call']),
[new Literal 'this'].concat this.params
else
new Call this

#### Param

Expand Down

0 comments on commit abef3f5

Please sign in to comment.