Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: fix beforeExit not working with -e #8821

Merged
merged 1 commit into from
Oct 24, 2016
Merged

Commits on Oct 24, 2016

  1. lib: fix beforeExit not working with -e

    Commit 93a44d5 ("src: fix deferred events not working with -e") defers
    evaluation of the script to the next tick.
    
    A side effect of that change is that 'beforeExit' listeners run before
    the actual script.  'beforeExit' is emitted when the event loop is
    empty but process.nextTick() does not ref the event loop.
    
    Fix that by using setImmediate().  Because it is implemented in terms
    of a uv_check_t handle, it interacts with the event loop properly.
    
    Fixes: nodejs#8534
    PR-URL: nodejs#8821
    Reviewed-By: Colin Ihrig <[email protected]>
    bnoordhuis committed Oct 24, 2016
    Configuration menu
    Copy the full SHA
    c5b07d4 View commit details
    Browse the repository at this point in the history