diff options
author | Gabriel Schulhof <gabriel.schulhof@intel.com> | 2018-04-29 23:49:30 +0300 |
---|---|---|
committer | Gabriel Schulhof <gabriel.schulhof@intel.com> | 2018-05-02 16:23:38 +0300 |
commit | bdf5be98dd901f6c312938198439dbda0b20d517 (patch) | |
tree | 3be2540235dd45e6c179ed8d0e315d0f96e70abc /doc/api/n-api.md | |
parent | 9c8b479467a5f2b68f967444fbc2f7528082ab23 (diff) |
n-api: test and doc napi_throw() of a primitive
Ensure that napi_throw() is able to throw a primitive value, and
document that it is able to throw any JavaScript value.
Fixes: https://github.com/nodejs/abi-stable-node/issues/309
PR-URL: https://github.com/nodejs/node/pull/20428
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'doc/api/n-api.md')
-rw-r--r-- | doc/api/n-api.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 85993639dc8..fcbd4decb35 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -344,11 +344,11 @@ added: v8.0.0 NODE_EXTERN napi_status napi_throw(napi_env env, napi_value error); ``` - `[in] env`: The environment that the API is invoked under. -- `[in] error`: The `napi_value` for the `Error` to be thrown. +- `[in] error`: The JavaScript value to be thrown. Returns `napi_ok` if the API succeeded. -This API throws the JavaScript `Error` provided. +This API throws the JavaScript value provided. #### napi_throw_error <!-- YAML |