Skip to content

Instantly share code, notes, and snippets.

@hassy
Last active December 8, 2016 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hassy/c8148caf21c06d40104b39a7b7a03fde to your computer and use it in GitHub Desktop.
Save hassy/c8148caf21c06d40104b39a7b7a03fde to your computer and use it in GitHub Desktop.
Trigger an infinite loop in Node.js 6.8.1+
var i1 = setImmediate(function() {
console.log('i1 cb');
clearImmediate(i2);
clearImmediate(i3);
});
var i2 = setImmediate(function() {
console.log('i2 cb');
});
var i3 = setImmediate(function() {
console.log('i3 cb');
});
console.log('All set');
@hassy
Copy link
Author

hassy commented Dec 8, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment