Last active
November 1, 2015 23:24
-
-
Save triblondon/225357def9998c0492f7 to your computer and use it in GitHub Desktop.
Weird Node error when using mismatched setInterval vs clearTimeout
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
var timer; | |
function a() { | |
console.log('foo'); | |
// timer is an interval timer, but clear it as if it's a timeout timer | |
clearTimeout(timer); | |
} | |
timer = setInterval(a, 1000); | |
timer.unref(); | |
// Keep the loop going for 3 seconds | |
setTimeout(function() {}, 3000); |
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
foo | |
Assertion failed: (HandleWrap::IsAlive(wrap)), function Start, file ../src/timer_wrap.cc, line 74. | |
Abort trap: 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment