Commit Graph

6 Commits (91f05448894e07831eb91118e5ab361a1c350116)

Author SHA1 Message Date
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
Octavian Soldea 3da44b0b52 test: propagate napi_status to JS
Re: https://github.com/nodejs/node/pull/27945#discussion_r288833979

This commit regards reporting to the JS level an actual event
that happens when using suspected improper null arguments. It is better
to report the exact reason from N-API to the JS level.

PR-URL: https://github.com/nodejs/node/pull/28505
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-07-18 13:27:06 -07:00
legendecas 10a346edde
n-api: define ECMAScript-compliant accessors on napi_define_class
PR-URL: https://github.com/nodejs/node/pull/27851
Fixes: https://github.com/nodejs/node/issues/26551
Fixes: https://github.com/nodejs/node-addon-api/issues/485
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-06-17 12:07:08 +02:00
Octavian Soldea a18e27df9e src: add napi_define_class() null checks
napi_define_class is tested by passing NULL to all parameters that are
pointers, one at a time. Moreover, two bugs were corrected. One was
utf8name and the second was the property descriptor pointer. These
pointers were assumed to be non-NULL and now we have NULL checks.

PR-URL: https://github.com/nodejs/node/pull/27945
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
2019-06-07 21:33:00 -07:00
Ruben Bridgewater 50dd555910
doc,lib,test: capitalize comment sentences
This activates the eslint capitalize comment rule for comments
above 50 characters.

PR-URL: https://github.com/nodejs/node/pull/24996
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-17 17:14:35 +01: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