| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f3d8639 commit 8bc1651
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -527,6 +527,15 @@ exception is pending and no additional action is required. If the | |||
| 527 | 527 | instead of simply returning immediately, [`napi_is_exception_pending`][] | |
| 528 | 528 | must be called in order to determine if an exception is pending or not. | |
| 529 | 529 | ||
| 530 | + In many cases when an N-API function is called and an exception is | ||
| 531 | + already pending, the function will return immediately with a | ||
| 532 | + `napi_status` of `napi_pending_exception`. However, this is not the case | ||
| 533 | + for all functions. N-API allows a subset of the functions to be | ||
| 534 | + called to allow for some minimal cleanup before returning to JavaScript. | ||
| 535 | + In that case, `napi_status` will reflect the status for the function. It | ||
| 536 | + will not reflect previous pending exceptions. To avoid confusion, check | ||
| 537 | + the error status after every function call. | ||
| 538 | + | ||
| 530 | 539 | When an exception is pending one of two approaches can be employed. | |
| 531 | 540 | ||
| 532 | 541 | The first approach is to do any appropriate cleanup and then return so that | |
| Back | FazBrowse Home | New Git URL |
0 commit comments