Files
Gabriel Schulhof 860c0d89b6 n-api: add APIs for per-instance state management
Adds `napi_set_instance_data()` and `napi_get_instance_data()`, which
allow native addons to store their data on and retrieve their data from
`napi_env`. `napi_set_instance_data()` accepts a finalizer which is
called when the `node::Environment()` is destroyed.

This entails rendering the `napi_env` local to each add-on.

Fixes: https://github.com/nodejs/abi-stable-node/issues/378
PR-URL: https://github.com/nodejs/node/pull/28682
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2019-08-02 22:19:01 +02:00

12 lines
164 B
Python

{
"targets": [
{
"target_name": "test_instance_data",
"sources": [
"../entry_point.c",
"test_instance_data.c"
]
}
]
}