From c5ae39e401b11c2faa314a5c981ed86471051146 Mon Sep 17 00:00:00 2001 From: Jamen Marzonie Date: Thu, 8 Jun 2017 05:05:19 -0500 Subject: [PATCH] doc: fix napi_create_*_error signatures in n-api Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13544 Reviewed-By: James M Snell Reviewed-By: Anna M. Kedzierska Reviewed-By: Chris Dickinson Reviewed-By: Jason Ginchereau --- doc/api/n-api.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 5a343ef377cfe3..72b35f3810bbbd 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -407,7 +407,9 @@ This API queries a `napi_value` to check if it represents an error object. added: v8.0.0 --> ```C -NODE_EXTERN napi_status napi_create_error(napi_env env, const char* msg); +NODE_EXTERN napi_status napi_create_error(napi_env env, + const char* msg, + napi_value* result); ``` - `[in] env`: The environment that the API is invoked under. - `[in] msg`: C string representing the text to be associated with. @@ -422,7 +424,9 @@ This API returns a JavaScript Error with the text provided. added: v8.0.0 --> ```C -NODE_EXTERN napi_status napi_create_type_error(napi_env env, const char* msg); +NODE_EXTERN napi_status napi_create_type_error(napi_env env, + const char* msg, + napi_value* result); ``` - `[in] env`: The environment that the API is invoked under. - `[in] msg`: C string representing the text to be associated with. @@ -438,7 +442,9 @@ This API returns a JavaScript TypeError with the text provided. added: v8.0.0 --> ```C -NODE_EXTERN napi_status napi_create_range_error(napi_env env, const char* msg); +NODE_EXTERN napi_status napi_create_range_error(napi_env env, + const char* msg, + napi_value* result); ``` - `[in] env`: The environment that the API is invoked under. - `[in] msg`: C string representing the text to be associated with.