@@ -279,6 +279,8 @@ Do not rely on the content or format of any of the extended information as it
279
279
is not subject to SemVer and may change at any time. It is intended only for
280
280
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
@@ -683,6 +690,8 @@ Returns `napi_ok` if the API succeeded.
683
690
This API closes the scope passed in. Scopes must be closed in the
684
691
reverse order from which they were created.
685
692
693
+ This API can be called even if there is a pending JavaScript exception.
694
+
686
695
#### napi_open_escapable_handle_scope
687
696
<!-- YAML
688
697
added: v8.0.0
@@ -717,6 +726,8 @@ Returns `napi_ok` if the API succeeded.
717
726
This API closes the scope passed in. Scopes must be closed in the
718
727
reverse order from which they were created.
719
728
729
+ This API can be called even if there is a pending JavaScript exception.
730
+
720
731
#### napi_escape_handle
721
732
<!-- YAML
722
733
added: v8.0.0
@@ -740,7 +751,10 @@ This API promotes the handle to the JavaScript object so that it is valid
740
751
for the lifetime of the outer scope. It can only be called once per scope.
741
752
If it is called more than once an error will be returned.
742
753
754
+ This API can be called even if there is a pending JavaScript exception.
755
+
743
756
### References to objects with a lifespan longer than that of the native method
757
+
744
758
In some cases an addon will need to be able to create and reference objects
745
759
with a lifespan longer than that of a single native method invocation. For
746
760
example, to create a constructor and later use that constructor
@@ -815,6 +829,8 @@ Returns `napi_ok` if the API succeeded.
815
829
816
830
This API deletes the reference passed in.
817
831
832
+ This API can be called even if there is a pending JavaScript exception.
833
+
818
834
#### napi_reference_ref
819
835
<!-- YAML
820
836
added: v8.0.0
@@ -833,7 +849,6 @@ Returns `napi_ok` if the API succeeded.
833
849
This API increments the reference count for the reference
834
850
passed in and returns the resulting reference count.
835
851
836
-
837
852
#### napi_reference_unref
838
853
<!-- YAML
839
854
added: v8.0.0
@@ -852,7 +867,6 @@ Returns `napi_ok` if the API succeeded.
852
867
This API decrements the reference count for the reference
853
868
passed in and returns the resulting reference count.
854
869
855
-
856
870
#### napi_get_reference_value
857
871
<!-- YAML
858
872
added: v8.0.0
@@ -1667,8 +1681,6 @@ This API returns various properties of a typed array.
1667
1681
*Warning*: Use caution while using this API since the underlying data buffer
1668
1682
is managed by the VM
1669
1683
1670
-
1671
-
1672
1684
#### napi_get_dataview_info
1673
1685
<!-- YAML
1674
1686
added: v8.3.0
@@ -1696,7 +1708,6 @@ Returns `napi_ok` if the API succeeded.
1696
1708
1697
1709
This API returns various properties of a DataView.
1698
1710
1699
-
1700
1711
#### napi_get_value_bool
1701
1712
<!-- YAML
1702
1713
added: v8.0.0
@@ -1737,7 +1748,6 @@ in it returns `napi_number_expected`.
1737
1748
This API returns the C double primitive equivalent of the given JavaScript
1738
1749
Number.
1739
1750
1740
-
1741
1751
#### napi_get_value_external
1742
1752
<!-- YAML
1743
1753
added: v8.0.0
@@ -1799,7 +1809,7 @@ Returns `napi_ok` if the API succeeded. If a non-number `napi_value`
1799
1809
is passed in it returns `napi_number_expected`.
1800
1810
1801
1811
This API returns the C int64 primitive equivalent of the given
1802
- JavaScript Number
1812
+ JavaScript Number.
1803
1813
1804
1814
#### napi_get_value_string_latin1
1805
1815
<!-- YAML
@@ -2191,8 +2201,6 @@ Returns `napi_ok` if the API succeeded.
2191
2201
2192
2202
This API checks if the Object passsed in is a typed array.
2193
2203
2194
-
2195
-
2196
2204
### napi_is_dataview
2197
2205
<!-- YAML
2198
2206
added: v8.3.0
@@ -3308,6 +3316,8 @@ Returns `napi_ok` if the API succeeded.
3308
3316
3309
3317
This API frees a previously allocated work object.
3310
3318
3319
+ This API can be called even if there is a pending JavaScript exception.
3320
+
3311
3321
### napi_queue_async_work
3312
3322
<!-- YAML
3313
3323
added: v8.0.0
@@ -3346,6 +3356,8 @@ the `complete` callback will be invoked with a status value of
3346
3356
`napi_cancelled`. The work should not be deleted before the `complete`
3347
3357
callback invocation, even if it has been successfully cancelled.
3348
3358
3359
+ This API can be called even if there is a pending JavaScript exception.
3360
+
3349
3361
## Custom Asynchronous Operations
3350
3362
The simple asynchronous work APIs above may not be appropriate for every
3351
3363
scenario. When using any other asynchronous mechanism, the following APIs
@@ -3387,6 +3399,8 @@ napi_status napi_async_destroy(napi_env env,
3387
3399
3388
3400
Returns `napi_ok` if the API succeeded.
3389
3401
3402
+ This API can be called even if there is a pending JavaScript exception.
3403
+
3390
3404
### napi_make_callback
3391
3405
<!-- YAML
3392
3406
added: v8.0.0
@@ -3469,6 +3483,8 @@ NAPI_EXTERN napi_status napi_close_callback_scope(napi_env env,
3469
3483
- `[in] env`: The environment that the API is invoked under.
3470
3484
- `[in] scope`: The scope to be closed.
3471
3485
3486
+ This API can be called even if there is a pending JavaScript exception.
3487
+
3472
3488
## Version Management
3473
3489
3474
3490
### napi_get_node_version
0 commit comments