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: tighten null-checking and clean up last error #12539

Closed

Commits on Apr 23, 2017

  1. n-api: tighten null-checking and clean up last error

    We left out null-checks for many of the parameters passed to our APIs.
    In particular, arguments of type `napi_value` were often accepted
    without a null-check, even though they should never be null.
    
    Additionally, many APIs simply returned `napi_ok` on success. This
    leaves in place an error that may have occurred in a previous N-API
    call. Others (those which perform `NAPI_PREAMBLE(env)` at the top)
    OTOH explicitly clear the last error before proceeding. With this
    modification all APIs explicitly clear the last error on success.
    
    Fixes nodejs/abi-stable-node#227
    Gabriel Schulhof committed Apr 23, 2017
    Configuration menu
    Copy the full SHA
    2aeadeb View commit details
    Browse the repository at this point in the history