joyent/node — pull request #7209 by indutny (2014-02-28 13:28:12+00:00)
Title: node: invoke `beforeExit` again if loop was active

When `setImmediate(cb)` is called in `beforeExit` event handler the
consequent `uv_run(..., UV_RUN_NOWAIT)` may return `0`, even if there
was some active handles at start.

Fixes simple/test-beforeexit-event.js.

cc @saghul @bnoordhuis