node/test/js-native-api
Michael Dawson 2dbeb889f6
node-api: handle no support for external buffers
Refs: https://github.com/electron/electron/issues/35801
Refs: https://github.com/nodejs/abi-stable-node/issues/441

Electron recently dropped support for external
buffers. Provide a way for addon authors to:
- hide the methods to create external buffers so they can
  avoid using them if they want the broadest compatibility.
- call the methods that create external buffers at runtime
  to check if external buffers are supported and either
  use them or not based on the return code.

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: https://github.com/nodejs/node/pull/45181
Backport-PR-URL: https://github.com/nodejs/node/pull/45616
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2022-12-07 08:49:39 -05:00
..
2_function_arguments test: give js-native-api tests consistent names 2021-07-20 07:11:18 -04:00
3_callbacks test: give js-native-api tests consistent names 2021-07-20 07:11:18 -04:00
4_object_factory test: give js-native-api tests consistent names 2021-07-20 07:11:18 -04:00
5_function_factory test: give js-native-api tests consistent names 2021-07-20 07:11:18 -04:00
6_object_wrap test: give js-native-api tests consistent names 2021-07-20 07:11:18 -04:00
7_factory_wrap test: give js-native-api tests consistent names 2021-07-20 07:11:18 -04:00
8_passing_wrapped test: give js-native-api tests consistent names 2021-07-20 07:11:18 -04:00
test_array test: prepare for consistent comma-dangle lint rule 2021-09-04 12:24:57 +02:00
test_bigint test: call functions internally 2021-06-11 09:30:14 +02:00
test_constructor
test_conversions test: add n-api null checks for conversions 2020-07-16 17:09:11 -04:00
test_dataview
test_date
test_error
test_exception test: prepare for consistent comma-dangle lint rule 2021-09-04 12:24:57 +02:00
test_function node-api: handle pending exception in cb wrapper 2021-09-04 15:14:46 +02:00
test_general node-api: handle no support for external buffers 2022-12-07 08:49:39 -05:00
test_handle_scope
test_instance_data module: deprecate module.parent 2020-07-16 17:09:13 -04:00
test_new_target test: give js-native-api tests consistent names 2021-07-20 07:11:18 -04:00
test_number n-api: add uint32 test for -1 2020-05-07 08:25:57 -07:00
test_object test: prepare for consistent comma-dangle lint rule 2021-09-04 12:24:57 +02:00
test_promise
test_properties
test_reference src: make napi_create_reference accept symbol 2022-01-25 12:38:26 -05:00
test_reference_double_free node-api: force env shutdown deferring behavior 2021-04-26 12:42:05 +02:00
test_string napi: fix memory corruption vulnerability 2020-06-02 15:56:39 +02:00
test_symbol
test_typedarray n-api: create N-API version 7 2020-09-21 13:36:03 -04:00
.gitignore
common.c
common.h
entry_point.c
testcfg.py