Commit Graph

5 Commits

Author SHA1 Message Date
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
Joyee Cheung
7c8d98ea84
test: pass data into napi_create_external
Since v8 10.1 v8::External::New DCHECKs that the data passed
into it cannot be a nullptr because that's not serializable
as external references. This updates the test to pass a
dummy data pointer to the call - which does not matter for the
test since we only care about whether the finalizer is
called.

Refs: https://chromium-review.googlesource.com/c/v8/v8/+/3513234

PR-URL: https://github.com/nodejs/node/pull/42532
Refs: https://github.com/nodejs/node/pull/42115
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-04-02 23:57:33 +01:00
legendecas
78af363aa7 node-api: rtn pending excep on napi_new_instance
When there are any JavaScript exceptions pending,
`napi_pending_exception` should be returned.

PR-URL: https://github.com/nodejs/node/pull/38798
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2021-06-04 16:38:06 -04:00
Gabriel Schulhof
4b7f23f868 test: rename n-api to node-api
This renames the macros used in the tests from `NAPI_*` to
`NODE_API_*`.

PR-URL: https://github.com/nodejs/node/pull/37217
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-02-06 05:03:38 -08: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