Miguel Marcondes Filho
a556db4782
node-api: add napi_create_object_with_properties
...
PR-URL: https://github.com/nodejs/node/pull/59953
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com >
2025-10-30 14:10:44 +00:00
Chengzhong Wu
52fcf14258
node-api: return napi_exception_pending on proxy handlers
...
Accessing JS objects can be trapped with proxy handlers. These
handlers can throw when no node-api errors occur. In such cases,
`napi_pending_exception` should be returned.
PR-URL: https://github.com/nodejs/node/pull/48607
Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com >
Reviewed-By: Michael Dawson <midawson@redhat.com >
2023-10-23 18:17:49 -04:00
legendecas
178dff255f
test: avoid copying test source files
...
Converting the helper functions to be inlined and making the helper file
header only.
PR-URL: https://github.com/nodejs/node/pull/49515
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com >
2023-09-10 06:11:36 +00:00
Gabriel Schulhof
42995a3a11
test: cover property n-api null cases
...
Add test coverage for passing `NULL` to each parameter of
`napi.*(propert|element)` and `napi_set_prototype`. In the case of
`napi_define_properties` also test setting various initializer fields
to `NULL`.
PR-URL: https://github.com/nodejs/node/pull/31488
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-01-25 21:23:05 -08:00
Octavian Soldea
db1c4a7592
n-api: refactor a previous commit
...
This is a refactoring of https://github.com/nodejs/node/issues/27628
following https://github.com/nodejs/node/pull/28505 .
This change factors out functions `add_last_status()` and
`add_returned_status()` so they may be reused in the tests for passing
information about the last error status and/or a returned `napi_status`
to JavaScript.
PR-URL: https://github.com/nodejs/node/pull/28848
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com >
2019-07-26 15:09:04 -07:00
Gabriel Schulhof
938e11882b
test: partition N-API tests
...
Partition test/addons-napi into test/js-native-api and test/node-api to
isolate the Node.js-agnostic portion of the N-API tests from the
Node.js-specific portion.
PR-URL: https://github.com/nodejs/node/pull/24557
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
2018-12-04 13:58:17 -08:00