Skip to content

Commit 53ec50d

Browse files
jamenaddaleax
authored andcommitted
doc: fix napi_create_*_error signatures in n-api
PR-URL: #13544 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna M. Kedzierska <[email protected]> Reviewed-By: Chris Dickinson <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]>
1 parent d51b1c2 commit 53ec50d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

doc/api/n-api.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,9 @@ This API queries a `napi_value` to check if it represents an error object.
407407
added: v8.0.0
408408
-->
409409
```C
410-
NODE_EXTERN napi_status napi_create_error(napi_env env, const char* msg);
410+
NODE_EXTERN napi_status napi_create_error(napi_env env,
411+
const char* msg,
412+
napi_value* result);
411413
```
412414
- `[in] env`: The environment that the API is invoked under.
413415
- `[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.
422424
added: v8.0.0
423425
-->
424426
```C
425-
NODE_EXTERN napi_status napi_create_type_error(napi_env env, const char* msg);
427+
NODE_EXTERN napi_status napi_create_type_error(napi_env env,
428+
const char* msg,
429+
napi_value* result);
426430
```
427431
- `[in] env`: The environment that the API is invoked under.
428432
- `[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.
438442
added: v8.0.0
439443
-->
440444
```C
441-
NODE_EXTERN napi_status napi_create_range_error(napi_env env, const char* msg);
445+
NODE_EXTERN napi_status napi_create_range_error(napi_env env,
446+
const char* msg,
447+
napi_value* result);
442448
```
443449
- `[in] env`: The environment that the API is invoked under.
444450
- `[in] msg`: C string representing the text to be associated with.

0 commit comments

Comments
 (0)