timers: minor _unrefActive fixes and improvements
authorJeremiah Senkpiel <fishrock123@rocketmail.com>
Thu, 27 Aug 2015 19:56:46 +0000 (15:56 -0400)
committerJeremiah Senkpiel <fishrock123@rocketmail.com>
Thu, 3 Sep 2015 21:46:24 +0000 (17:46 -0400)
commitf6b093343da915832c20bfbc040c7d6bef26f08c
tree0a429a85b372bbe851d1ece9f942ebf6c320ab19
parent403d7ee7d1a17c3bc7874febd6d83c0b6403db76
timers: minor _unrefActive fixes and improvements

This commit addresses most of the review comments in
https://github.com/nodejs/node/pull/2540, which are kept in this
separate commit so as to better preserve the prior two patches as they
landed in 0.12.

This commit:
- Fixes a bug with unrefActive timers and disposed domains.
- Fixes a bug with unrolling an unrefActive timer from another.
- Adds a test for both above bugs.
- Improves check logic, making it stricter, simpler, or both.
- Optimizes nicer with a smaller, separate function for the try/catch.

Fixes: https://github.com/nodejs/node-convergence-archive/issues/23
Ref: https://github.com/nodejs/node/issues/268
PR-URL: https://github.com/nodejs/node/pull/2540
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
lib/timers.js
test/parallel/test-timers-unref-active-unenrolled-disposed.js [new file with mode: 0644]