From de2d3a687f1facceb7b4489d12e06607907f64fe Mon Sep 17 00:00:00 2001 From: Gabriel Schulhof Date: Thu, 1 Mar 2018 17:44:51 -0500 Subject: [PATCH] n-api: update documentation Document which APIs work while an exception is pending. This is the list of all APIs which do not start with `NAPI_PREAMBLE(env)`. Fixes: https://github.com/nodejs/abi-stable-node/issues/257 PR-URL: https://github.com/nodejs/node/pull/19078 Reviewed-By: Michael Dawson --- doc/api/n-api.md | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 9055e44da7b562..27cf19bf947183 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -279,6 +279,8 @@ valid up until an n-api function is called on the same `env`. information as it is not subject to SemVer and may change at any time. It is intended only for logging purposes. +This API can be called even if there is a pending JavaScript exception. + ### Exceptions Any N-API function call may result in a pending JavaScript exception. This is @@ -504,7 +506,6 @@ Returns `napi_ok` if the API succeeded. This API returns a JavaScript RangeError with the text provided. - #### napi_get_and_clear_last_exception