Permalink
Browse files

fixed it! got class functions to bind properly

  • Loading branch information...
1 parent edd551c commit 33d5b70715966b9c441372bb847d819bdbfddfd3 @maxtaco committed Dec 8, 2011
Showing with 6 additions and 5 deletions.
  1. +3 −2 lib/coffee-script/nodes.js
  2. +2 −1 src/nodes.coffee
  3. +1 −2 test/tame.coffee

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -2450,7 +2450,8 @@ CpsCascade =
wrap: (statement, rest) ->
func = new Code [ new Param new Literal tame.const.k ], Block.wrap [ statement ]
- cont = new Code [], Block.wrap [ rest ]
+ block = Block.wrap [ rest ]
+ cont = new Code [], block, 'boundfunc'
call = new Call func, [ cont ]
new Block [ call ]
View
@@ -86,9 +86,8 @@ atest "parallel awaits with buggy classes", (cb) ->
constructor: ->
@val = 0
increment: (wait, i, cb) =>
- self = this
await setTimeout(defer(),wait)
- self.val += i
+ @val += i
cb()
getVal: -> @val

0 comments on commit 33d5b70

Please sign in to comment.