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: Sync with back-compat changes #12674

Closed
wants to merge 1 commit into from

Commits on Apr 26, 2017

  1. n-api: Sync with back-compat changes

    Background: To enable N-API support for node versions back to v4, the
    N-API code can also be built as an external addon. To make maintenance
    easier, a single codebase needs to support both built-in and external
    scenarios, along with Node versions >= 4 (and corresponding V8
    versions).
    
    This change includes several minor fixes to avoid using node
    internal APIs and support older V8 versions:
      - Expand node::arraysize
      - In the CHECK_ENV() macro, return an error code instead of calling
        node::FatalError(). This is more consistent with how other invalid
        arguments to N-API functions are handled.
      - In v8impl::SetterCallbackWrapper::SetReturnValue(), do nothing
        instead of calling node::FatalError(). This is more consistent
        with JavaScript setter callbacks, where any returned value is
        silently ignored.
      - When queueing async work items, get the uv default loop instead of
        getting the loop from node::Environment::GetCurrent(). Currently
        that returns the same loop anyway. If/when node supports multiple
        environments, it should have a public API for getting the
        environment & event loop, and we can update this implementation
        then.
      - Use v8::Maybe::FromJust() instead of the newer alias ToChecked()
    
    These changes were copied directly from
    nodejs/node-addon-api@c7d4df4
    where they were reviewed as part of
    nodejs/node-addon-api#25
    jasongin committed Apr 26, 2017
    Configuration menu
    Copy the full SHA
    0341910 View commit details
    Browse the repository at this point in the history