summaryrefslogtreecommitdiff
path: root/src/node_api.h
diff options
context:
space:
mode:
authorMichael Dawson <michael_dawson@ca.ibm.com>2017-12-12 19:37:40 -0500
committerMichael Dawson <michael_dawson@ca.ibm.com>2018-02-05 17:10:19 -0500
commita5553971859366c1171e86e8ef52d61017a3eb67 (patch)
tree4f406bad270656302ef512417c5ff0a0af25d9b0 /src/node_api.h
parentc2b9048ac8934d205d53d5a194cf9428987acfe3 (diff)
downloadnode-new-a5553971859366c1171e86e8ef52d61017a3eb67.tar.gz
n-api: add methods to open/close callback scope
Add support for the following methods; napi_open_callback_scope napi_close_callback_scope These are needed when running asynchronous methods directly using uv. PR-URL: https://github.com/nodejs/node/pull/18089 Fixes: https://github.com/nodejs/node/issues/15604 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/node_api.h')
-rw-r--r--src/node_api.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/node_api.h b/src/node_api.h
index c752705169..e9b3645e40 100644
--- a/src/node_api.h
+++ b/src/node_api.h
@@ -424,6 +424,14 @@ NAPI_EXTERN napi_status napi_escape_handle(napi_env env,
napi_value escapee,
napi_value* result);
+NAPI_EXTERN napi_status napi_open_callback_scope(napi_env env,
+ napi_value resource_object,
+ napi_async_context context,
+ napi_callback_scope* result);
+
+NAPI_EXTERN napi_status napi_close_callback_scope(napi_env env,
+ napi_callback_scope scope);
+
// Methods to support error handling
NAPI_EXTERN napi_status napi_throw(napi_env env, napi_value error);
NAPI_EXTERN napi_status napi_throw_error(napi_env env,