Created
February 27, 2011 03:18
-
-
Save codahale/845874 to your computer and use it in GitHub Desktop.
This file contains 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
~/Downloads/node-v0.4.1> less pop-stack.js | |
function doAThing(i) { | |
console.log("Iter " + i); | |
doAThing(i + 1); | |
} | |
doAThing(1); // this should be good | |
~/Downloads/node-v0.4.1> ./node pop-stack.js | |
Iter 1 | |
Iter 2 | |
... | |
Iter 676 | |
Iter 677 | |
Iter | |
node.js:116 | |
throw e; // process.nextTick error, or 'error' event on first tick | |
^ | |
undefined |
process.nextTick is deprecated, use setImmediate instead
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try
process.nextTick(function () { doAThing(i+i); })
instead?And yeah, after seeing more on twitter, it's kind of despairingly silly to have to do this.