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: implement promise #14365

Closed
wants to merge 1 commit into from

Commits on Aug 24, 2017

  1. n-api: implement promise

    Promise is implemented as a pair of objects. `napi_create_promise()`
    returns both a JavaScript promise and a newly allocated "deferred" in
    its out-params. The deferred is linked to the promise such that the
    deferred can be passed to `napi_resolve_deferred()` or
    `napi_reject_deferred()` to reject/resolve the promise.
    
    `napi_is_promise()` can be used to check if a `napi_value` is a native
    promise - that is, a promise created by the underlying engine, rather
    than a pure JS implementation of a promise.
    
    PR-URL: nodejs#14365
    Gabriel Schulhof committed Aug 24, 2017
    Configuration menu
    Copy the full SHA
    b16ac9e View commit details
    Browse the repository at this point in the history