Kevin Eady

Results 125 comments of Kevin Eady

I am hesitant of adding these APIs, as the functionality to do what you want already exists using both `node_api_create_property_key_utf16()` and `napi_set_property()`. I do not follow the argument of "an...

Old behavior: https://github.com/user-attachments/assets/f63c4d99-4200-4b16-aebb-f231152eebe9 --- New behavior: https://github.com/user-attachments/assets/7c3d4129-a01b-4996-8845-fe3cf7a2d5db

Any thoughts on this merge request...? I can rebase the branch if so.

Currently, the four nogc methods call `NAPI_THROW_IF_FAILED_VOID`, creating a new `Napi::Error`. This won't work in nogc-land since it's creating a new Value. I would like to discuss this on the...

Also struggling a bit with figuring out how to make `napi[-inl].h` smart enough to know when `node_api_nogc_env` is available for use. For example, we cannot use these new types if...

Discussed in 24 May Node-API meeting: - Check under which circumstances the `nogc` functions could fail; if they are "reasonable" (eg. invalid parameters passed), we could just some fatal exception...

Another issue that i'm struggling with regarding `ObjectWrap`. The destructor uses `Reference::Value()` which calls `napi_get_reference_value`, and this method cannot be used inside GC: https://github.com/nodejs/node-addon-api/blob/7c79c331405ffc41f8d5dab958cde3e93bf90306/napi-inl.h#L4438-L4450 https://github.com/nodejs/node-addon-api/blob/7c79c331405ffc41f8d5dab958cde3e93bf90306/napi-inl.h#L3265-L3275 Thoughts on how to proceed...

Additionally, in ObjectWrap construction, the `napi_wrap` gets passed `ObjectWrap::FinalizeCallback`, which in turn creates some handle scopes, which cannot be done in finalization. https://github.com/nodejs/node-addon-api/blob/7c79c331405ffc41f8d5dab958cde3e93bf90306/napi-inl.h#L4431 Not sure how to proceed on this...

So continuing to dig a bit, mostly keeping this as notes... The combination of the destructor `~ObjectWrap` and the `FinalizeCallback` is supposed to behave in this manner: - When the...

> `napi_get_reference_value` will fail if it is called in finalizers without opening a handle scope. From my understanding, this is intended behavior...? Since the function takes a `napi_env` (vs. the...