diff options
author | Sampson Gao <sampsong@ca.ibm.com> | 2017-08-08 16:21:56 -0400 |
---|---|---|
committer | Michael Dawson <mdawson@devrus.com> | 2017-09-14 16:21:27 -0400 |
commit | 973c12f631c53a9833e0bcd11f5457ebec5269c4 (patch) | |
tree | 1fe815b2d1bb2f47d4f5b23d902635c3b4ae93df /doc/api/n-api.md | |
parent | 0c258bdc4040fcc4ab590fc80dbcd2182b4c74ae (diff) | |
download | android-node-v8-973c12f631c53a9833e0bcd11f5457ebec5269c4.tar.gz android-node-v8-973c12f631c53a9833e0bcd11f5457ebec5269c4.tar.bz2 android-node-v8-973c12f631c53a9833e0bcd11f5457ebec5269c4.zip |
n-api: napi_is_construct_call->napi_get_new_target
Remove napi_is_construct_call and introduce napi_get_new_target.
PR-URL: https://github.com/nodejs/node/pull/14698
Reviewed-By: Jason Ginchereau <jasongin@microsoft.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Kyle Farnung <kfarnung@microsoft.com>
Diffstat (limited to 'doc/api/n-api.md')
-rw-r--r-- | doc/api/n-api.md | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/doc/api/n-api.md b/doc/api/n-api.md index d039e92589..00bba55a4c 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -2928,25 +2928,24 @@ Returns `napi_ok` if the API succeeded. This method is used within a callback function to retrieve details about the call like the arguments and the `this` pointer from a given callback info. -### *napi_is_construct_call* +### *napi_get_new_target* <!-- YAML -added: v8.0.0 +added: REPLACEME --> ```C -napi_status napi_is_construct_call(napi_env env, - napi_callback_info cbinfo, - bool* result) +napi_status napi_get_new_target(napi_env env, + napi_callback_info cbinfo, + napi_value* result) ``` - `[in] env`: The environment that the API is invoked under. - `[in] cbinfo`: The callback info passed into the callback function. -- `[out] result`: Whether the native function is being invoked as -a constructor call. +- `[out] result`: The `new.target` of the constructor call. Returns `napi_ok` if the API succeeded. -This API checks if the the current callback was due to a -consructor call. +This API returns the `new.target` of the constructor call. If the current +callback is not a constructor call, the result is `nullptr`. ### *napi_new_instance* <!-- YAML |