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

n-api: ensure in-module exceptions are propagated #19537

Commits on Mar 23, 2018

  1. n-api: ensure in-module exceptions are propagated

    Whenever we call into an addon, whether it is for a callback, for
    module init, or for async work-related reasons, we should make sure
    that
    
    * the last error is cleared,
    * the scopes before the call are the same as after, and
    * if an exception was thrown and captured inside the module, then it is
      re-thrown after the call.
    
    Therefore we should call into the module in a unified fashion. This
    change introduces the macro NAPI_CALL_INTO_MODULE() which should be
    used whenever invoking a callback provided by the module.
    
    Fixes: nodejs#19437
    Gabriel Schulhof committed Mar 23, 2018
    Configuration menu
    Copy the full SHA
    5c15524 View commit details
    Browse the repository at this point in the history