Commit Graph

5 Commits

Author SHA1 Message Date
Antoine du Hamel
7079158d29
test: add trailing commas in test/js-native-api
PR-URL: https://github.com/nodejs/node/pull/46385
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2023-02-03 17:12:18 +01:00
Voltrex
29f1b609ba
test: call functions internally
All (or at least most) of the tests uses lambdas (or arrow functions
if you will) to call these functions internally inside of directly
calling them, this should also use this technique for consistency.

PR-URL: https://github.com/nodejs/node/pull/38560
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2021-05-07 15:17:44 -07:00
Gabriel Schulhof
0cc2a54a53 n-api: simplify bigint-from-word creation
Macro `CHECK_MAYBE_EMPTY_WITH_PREAMBLE()` does the work of checking
the `TryCatch` and returning `napi_pending_exception` so this change
reuses it for `napi_create_bigint_words()`.

Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
PR-URL: https://github.com/nodejs/node/pull/34554
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2020-07-31 13:45:25 -07:00
legendecas
689ab46c64 n-api: return napi_invalid_arg on napi_create_bigint_words
N-API statuses shall be preferred over throwing JavaScript Errors on
checks occurred in N-APIs.

PR-URL: https://github.com/nodejs/node/pull/31312
Refs: https://github.com/nodejs/node/issues/29849
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2020-01-13 21:16:05 -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