@@ -279,6 +279,8 @@ valid up until an n-api function is called on the same `env`. |
279 | 279 | information as it is not subject to SemVer and may change at any time. |
280 | 280 | It is intended only for logging purposes. |
281 | 281 |
|
| 282 | +This API can be called even if there is a pending JavaScript exception. |
| 283 | + |
282 | 284 |
|
283 | 285 | ### Exceptions |
284 | 286 | 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. |
504 | 506 |
|
505 | 507 | This API returns a JavaScript RangeError with the text provided. |
506 | 508 |
|
507 | | - |
508 | 509 | #### napi_get_and_clear_last_exception |
509 | 510 | <!-- YAML |
510 | 511 | added: v8.0.0 |
@@ -521,6 +522,8 @@ Returns `napi_ok` if the API succeeded. |
521 | 522 |
|
522 | 523 | This API returns true if an exception is pending. |
523 | 524 |
|
| 525 | +This API can be called even if there is a pending JavaScript exception. |
| 526 | + |
524 | 527 | #### napi_is_exception_pending |
525 | 528 | <!-- YAML |
526 | 529 | added: v8.0.0 |
@@ -536,6 +539,8 @@ Returns `napi_ok` if the API succeeded. |
536 | 539 |
|
537 | 540 | This API returns true if an exception is pending. |
538 | 541 |
|
| 542 | +This API can be called even if there is a pending JavaScript exception. |
| 543 | + |
539 | 544 | ### Fatal Errors |
540 | 545 |
|
541 | 546 | In the event of an unrecoverable error in a native module, a fatal error can be |
@@ -562,6 +567,8 @@ null-terminated. |
562 | 567 |
|
563 | 568 | The function call does not return, the process will be terminated. |
564 | 569 |
|
| 570 | +This API can be called even if there is a pending JavaScript exception. |
| 571 | + |
565 | 572 | ## Object Lifetime management |
566 | 573 |
|
567 | 574 | As N-API calls are made, handles to objects in the heap for the underlying |
@@ -682,6 +689,8 @@ Returns `napi_ok` if the API succeeded. |
682 | 689 | This API closes the scope passed in. Scopes must be closed in the |
683 | 690 | reverse order from which they were created. |
684 | 691 |
|
| 692 | +This API can be called even if there is a pending JavaScript exception. |
| 693 | + |
685 | 694 | #### napi_open_escapable_handle_scope |
686 | 695 | <!-- YAML |
687 | 696 | added: v8.0.0 |
@@ -716,6 +725,8 @@ Returns `napi_ok` if the API succeeded. |
716 | 725 | This API closes the scope passed in. Scopes must be closed in the |
717 | 726 | reverse order from which they were created. |
718 | 727 |
|
| 728 | +This API can be called even if there is a pending JavaScript exception. |
| 729 | + |
719 | 730 | #### napi_escape_handle |
720 | 731 | <!-- YAML |
721 | 732 | added: v8.0.0 |
@@ -739,7 +750,10 @@ This API promotes the handle to the JavaScript object so that it is valid |
739 | 750 | for the lifetime of the outer scope. It can only be called once per scope. |
740 | 751 | If it is called more than once an error will be returned. |
741 | 752 |
|
| 753 | +This API can be called even if there is a pending JavaScript exception. |
| 754 | + |
742 | 755 | ### References to objects with a lifespan longer than that of the native method |
| 756 | + |
743 | 757 | In some cases an addon will need to be able to create and reference objects |
744 | 758 | with a lifespan longer than that of a single native method invocation. For |
745 | 759 | example, to create a constructor and later use that constructor |
@@ -814,6 +828,8 @@ Returns `napi_ok` if the API succeeded. |
814 | 828 |
|
815 | 829 | This API deletes the reference passed in. |
816 | 830 |
|
| 831 | +This API can be called even if there is a pending JavaScript exception. |
| 832 | + |
817 | 833 | #### napi_reference_ref |
818 | 834 | <!-- YAML |
819 | 835 | added: v8.0.0 |
@@ -832,7 +848,6 @@ Returns `napi_ok` if the API succeeded. |
832 | 848 | This API increments the reference count for the reference |
833 | 849 | passed in and returns the resulting reference count. |
834 | 850 |
|
835 | | - |
836 | 851 | #### napi_reference_unref |
837 | 852 | <!-- YAML |
838 | 853 | added: v8.0.0 |
@@ -851,7 +866,6 @@ Returns `napi_ok` if the API succeeded. |
851 | 866 | This API decrements the reference count for the reference |
852 | 867 | passed in and returns the resulting reference count. |
853 | 868 |
|
854 | | - |
855 | 869 | #### napi_get_reference_value |
856 | 870 | <!-- YAML |
857 | 871 | added: v8.0.0 |
@@ -1678,8 +1692,6 @@ This API returns various properties of a typed array. |
1678 | 1692 | *Warning*: Use caution while using this API since the underlying data buffer |
1679 | 1693 | is managed by the VM |
1680 | 1694 |
|
1681 | | - |
1682 | | - |
1683 | 1695 | #### napi_get_dataview_info |
1684 | 1696 | <!-- YAML |
1685 | 1697 | added: v8.3.0 |
@@ -1707,7 +1719,6 @@ Returns `napi_ok` if the API succeeded. |
1707 | 1719 |
|
1708 | 1720 | This API returns various properties of a DataView. |
1709 | 1721 |
|
1710 | | - |
1711 | 1722 | #### napi_get_value_bool |
1712 | 1723 | <!-- YAML |
1713 | 1724 | added: v8.0.0 |
@@ -1748,7 +1759,6 @@ in it returns `napi_number_expected`. |
1748 | 1759 | This API returns the C double primitive equivalent of the given JavaScript |
1749 | 1760 | Number. |
1750 | 1761 |
|
1751 | | - |
1752 | 1762 | #### napi_get_value_external |
1753 | 1763 | <!-- YAML |
1754 | 1764 | added: v8.0.0 |
@@ -1810,7 +1820,7 @@ Returns `napi_ok` if the API succeeded. If a non-number `napi_value` |
1810 | 1820 | is passed in it returns `napi_number_expected`. |
1811 | 1821 |
|
1812 | 1822 | This API returns the C int64 primitive equivalent of the given |
1813 | | -JavaScript Number |
| 1823 | +JavaScript Number. |
1814 | 1824 |
|
1815 | 1825 | #### napi_get_value_string_latin1 |
1816 | 1826 | <!-- YAML |
@@ -2202,8 +2212,6 @@ Returns `napi_ok` if the API succeeded. |
2202 | 2212 |
|
2203 | 2213 | This API checks if the Object passsed in is a typed array. |
2204 | 2214 |
|
2205 | | - |
2206 | | - |
2207 | 2215 | ### napi_is_dataview |
2208 | 2216 | <!-- YAML |
2209 | 2217 | added: v8.3.0 |
@@ -3323,6 +3331,8 @@ Returns `napi_ok` if the API succeeded. |
3323 | 3331 |
|
3324 | 3332 | This API frees a previously allocated work object. |
3325 | 3333 |
|
| 3334 | +This API can be called even if there is a pending JavaScript exception. |
| 3335 | + |
3326 | 3336 | ### napi_queue_async_work |
3327 | 3337 | <!-- YAML |
3328 | 3338 | added: v8.0.0 |
@@ -3361,6 +3371,8 @@ the `complete` callback will be invoked with a status value of |
3361 | 3371 | `napi_cancelled`. The work should not be deleted before the `complete` |
3362 | 3372 | callback invocation, even if it has been successfully cancelled. |
3363 | 3373 |
|
| 3374 | +This API can be called even if there is a pending JavaScript exception. |
| 3375 | + |
3364 | 3376 | ## Custom Asynchronous Operations |
3365 | 3377 | The simple asynchronous work APIs above may not be appropriate for every |
3366 | 3378 | scenario. When using any other asynchronous mechanism, the following APIs |
@@ -3402,6 +3414,8 @@ napi_status napi_async_destroy(napi_env env, |
3402 | 3414 |
|
3403 | 3415 | Returns `napi_ok` if the API succeeded. |
3404 | 3416 |
|
| 3417 | +This API can be called even if there is a pending JavaScript exception. |
| 3418 | + |
3405 | 3419 | ### napi_make_callback |
3406 | 3420 | <!-- YAML |
3407 | 3421 | added: v8.0.0 |
@@ -3484,6 +3498,8 @@ NAPI_EXTERN napi_status napi_close_callback_scope(napi_env env, |
3484 | 3498 | - `[in] env`: The environment that the API is invoked under. |
3485 | 3499 | - `[in] scope`: The scope to be closed. |
3486 | 3500 |
|
| 3501 | +This API can be called even if there is a pending JavaScript exception. |
| 3502 | + |
3487 | 3503 | ## Version Management |
3488 | 3504 |
|
3489 | 3505 | ### napi_get_node_version |
|