Permalink
Browse files

add more test cases. more fixups to the scoping system.

  • Loading branch information...
maxtaco committed Dec 14, 2011
1 parent d4fe65b commit e90ffb380aa5ae339c083760fe85d4920ac6ae61
Showing with 17 additions and 2 deletions.
  1. +6 −2 lib/coffee-script/nodes.js
  2. +2 −0 src/nodes.coffee
  3. +9 −0 test/tame.coffee

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

Oops, something went wrong.
View
@@ -1481,11 +1481,13 @@ exports.Code = class Code extends Base
code += '(' + vars.join(', ') + ') {'
unless @tamegen
+ stored_tamed_scope = o.tamed_scope
o.tamed_scope = if @tameNodeFlag then o.scope else null
>>>>>>> betteR! gotta run, but close!
code += "\n#{ @body.compileWithDeclarations o }\n#{@tab}" unless @body.isEmpty()
code += '}'
+ o.tamed_scope = stored_tamed_scope
return @tab + code if @ctor
if @front or (o.level >= LEVEL_ACCESS) then "(#{code})" else code
View
@@ -201,3 +201,12 @@ atest "AT variable works in an await (2)", (cb) ->
o = new MyClass
await o.run defer()
cb(o.getVal() == 10, {})
+
+atest "loops respect autocbs", (cb) ->
+ ok = false
+ bar = (autocb) ->
+ for i in [0..10]
+ await delay defer()
+ ok = true
+ await bar defer()
+ cb(ok, {})

0 comments on commit e90ffb3

Please sign in to comment.