Created
December 14, 2013 01:44
-
-
Save maxbeatty/7954626 to your computer and use it in GitHub Desktop.
Keeping variables scoped for [step](https://github.com/creationix/step) calls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Step = require 'step' | |
Step( | |
-> | |
return 'mine' | |
(err, @scoped) -> | |
console.log '1', @scoped | |
return 'diff1' | |
(err, msg) -> | |
console.log '2', @scoped, msg | |
@ null, 'diff2' | |
(err, msg) -> | |
console.log '3', @scoped, msg | |
) | |
console.log 'gone', @scoped | |
### | |
$ coffee step-test.coffee | |
1 mine | |
2 mine diff1 | |
3 mine diff2 | |
gone undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment