@@ -277,6 +277,8 @@ valid up until an n-api function is called on the same `env`.
277
277
information as it is not subject to SemVer and may change at any time.
278
278
It is intended only for logging purposes.
279
279
280
+ This API can be called even if there is a pending JavaScript exception.
281
+
280
282
281
283
### Exceptions
282
284
Any N-API function call may result in a pending JavaScript exception. This is
@@ -502,7 +504,6 @@ Returns `napi_ok` if the API succeeded.
502
504
503
505
This API returns a JavaScript RangeError with the text provided.
504
506
505
-
506
507
#### napi_get_and_clear_last_exception
507
508
<!-- YAML
508
509
added: v8.0.0
@@ -519,6 +520,8 @@ Returns `napi_ok` if the API succeeded.
519
520
520
521
This API returns true if an exception is pending.
521
522
523
+ This API can be called even if there is a pending JavaScript exception.
524
+
522
525
#### napi_is_exception_pending
523
526
<!-- YAML
524
527
added: v8.0.0
@@ -534,6 +537,8 @@ Returns `napi_ok` if the API succeeded.
534
537
535
538
This API returns true if an exception is pending.
536
539
540
+ This API can be called even if there is a pending JavaScript exception.
541
+
537
542
### Fatal Errors
538
543
539
544
In the event of an unrecoverable error in a native module, a fatal error can be
@@ -560,6 +565,8 @@ null-terminated.
560
565
561
566
The function call does not return, the process will be terminated.
562
567
568
+ This API can be called even if there is a pending JavaScript exception.
569
+
563
570
## Object Lifetime management
564
571
565
572
As N-API calls are made, handles to objects in the heap for the underlying
@@ -680,6 +687,8 @@ Returns `napi_ok` if the API succeeded.
680
687
This API closes the scope passed in. Scopes must be closed in the
681
688
reverse order from which they were created.
682
689
690
+ This API can be called even if there is a pending JavaScript exception.
691
+
683
692
#### napi_open_escapable_handle_scope
684
693
<!-- YAML
685
694
added: v8.0.0
@@ -714,6 +723,8 @@ Returns `napi_ok` if the API succeeded.
714
723
This API closes the scope passed in. Scopes must be closed in the
715
724
reverse order from which they were created.
716
725
726
+ This API can be called even if there is a pending JavaScript exception.
727
+
717
728
#### napi_escape_handle
718
729
<!-- YAML
719
730
added: v8.0.0
@@ -737,7 +748,10 @@ This API promotes the handle to the JavaScript object so that it is valid
737
748
for the lifetime of the outer scope. It can only be called once per scope.
738
749
If it is called more than once an error will be returned.
739
750
751
+ This API can be called even if there is a pending JavaScript exception.
752
+
740
753
### References to objects with a lifespan longer than that of the native method
754
+
741
755
In some cases an addon will need to be able to create and reference objects
742
756
with a lifespan longer than that of a single native method invocation. For
743
757
example, to create a constructor and later use that constructor
@@ -812,6 +826,8 @@ Returns `napi_ok` if the API succeeded.
812
826
813
827
This API deletes the reference passed in.
814
828
829
+ This API can be called even if there is a pending JavaScript exception.
830
+
815
831
#### napi_reference_ref
816
832
<!-- YAML
817
833
added: v8.0.0
@@ -830,7 +846,6 @@ Returns `napi_ok` if the API succeeded.
830
846
This API increments the reference count for the reference
831
847
passed in and returns the resulting reference count.
832
848
833
-
834
849
#### napi_reference_unref
835
850
<!-- YAML
836
851
added: v8.0.0
@@ -849,7 +864,6 @@ Returns `napi_ok` if the API succeeded.
849
864
This API decrements the reference count for the reference
850
865
passed in and returns the resulting reference count.
851
866
852
-
853
867
#### napi_get_reference_value
854
868
<!-- YAML
855
869
added: v8.0.0
@@ -1676,8 +1690,6 @@ This API returns various properties of a typed array.
1676
1690
*Warning*: Use caution while using this API since the underlying data buffer
1677
1691
is managed by the VM
1678
1692
1679
-
1680
-
1681
1693
#### napi_get_dataview_info
1682
1694
<!-- YAML
1683
1695
added: REPLACEME
@@ -1705,7 +1717,6 @@ Returns `napi_ok` if the API succeeded.
1705
1717
1706
1718
This API returns various properties of a DataView.
1707
1719
1708
-
1709
1720
#### napi_get_value_bool
1710
1721
<!-- YAML
1711
1722
added: v8.0.0
@@ -1746,7 +1757,6 @@ in it returns `napi_number_expected`.
1746
1757
This API returns the C double primitive equivalent of the given JavaScript
1747
1758
Number.
1748
1759
1749
-
1750
1760
#### napi_get_value_external
1751
1761
<!-- YAML
1752
1762
added: v8.0.0
@@ -1808,7 +1818,7 @@ Returns `napi_ok` if the API succeeded. If a non-number `napi_value`
1808
1818
is passed in it returns `napi_number_expected`.
1809
1819
1810
1820
This API returns the C int64 primitive equivalent of the given
1811
- JavaScript Number
1821
+ JavaScript Number.
1812
1822
1813
1823
#### napi_get_value_string_latin1
1814
1824
<!-- YAML
@@ -2200,8 +2210,6 @@ Returns `napi_ok` if the API succeeded.
2200
2210
2201
2211
This API checks if the Object passsed in is a typed array.
2202
2212
2203
-
2204
-
2205
2213
### napi_is_dataview
2206
2214
<!-- YAML
2207
2215
added: REPLACEME
@@ -3321,6 +3329,8 @@ Returns `napi_ok` if the API succeeded.
3321
3329
3322
3330
This API frees a previously allocated work object.
3323
3331
3332
+ This API can be called even if there is a pending JavaScript exception.
3333
+
3324
3334
### napi_queue_async_work
3325
3335
<!-- YAML
3326
3336
added: v8.0.0
@@ -3359,6 +3369,8 @@ the `complete` callback will be invoked with a status value of
3359
3369
`napi_cancelled`. The work should not be deleted before the `complete`
3360
3370
callback invocation, even if it has been successfully cancelled.
3361
3371
3372
+ This API can be called even if there is a pending JavaScript exception.
3373
+
3362
3374
## Custom Asynchronous Operations
3363
3375
The simple asynchronous work APIs above may not be appropriate for every
3364
3376
scenario. When using any other asynchronous mechanism, the following APIs
@@ -3400,6 +3412,8 @@ napi_status napi_async_destroy(napi_env env,
3400
3412
3401
3413
Returns `napi_ok` if the API succeeded.
3402
3414
3415
+ This API can be called even if there is a pending JavaScript exception.
3416
+
3403
3417
### napi_make_callback
3404
3418
<!-- YAML
3405
3419
added: v8.0.0
@@ -3482,6 +3496,8 @@ NAPI_EXTERN napi_status napi_close_callback_scope(napi_env env,
3482
3496
- `[in] env`: The environment that the API is invoked under.
3483
3497
- `[in] scope`: The scope to be closed.
3484
3498
3499
+ This API can be called even if there is a pending JavaScript exception.
3500
+
3485
3501
## Version Management
3486
3502
3487
3503
### napi_get_node_version
0 commit comments