Hi, just trying converting some code from nan to n-api using this library and the docs have been pretty good except for this.
Napi::FunctionReference::Persistent is listed here: https://github.com/nodejs/node-addon-api/blob/44f0695533327a12548a5015c444a3a5d731bb5c/doc/function_reference.md#persistent
However the actual method is Napi::Persistent overloaded to take a Napi::Function as seen in the source code here:
|
FunctionReference Persistent(Function value); |
The mistake seems to have been introduced a few months ago in a docs tidy up: fc11c94#diff-9562158c05ed3ee744cdc12bad121e87L39
The same mistake seems to exist for all Persistent and Weak across Reference and its subclasses.
This could be part of the confusion in #392.
Hi, just trying converting some code from nan to n-api using this library and the docs have been pretty good except for this.
Napi::FunctionReference::Persistentis listed here: https://github.com/nodejs/node-addon-api/blob/44f0695533327a12548a5015c444a3a5d731bb5c/doc/function_reference.md#persistentHowever the actual method is
Napi::Persistentoverloaded to take aNapi::Functionas seen in the source code here:node-addon-api/napi.h
Line 1130 in 44f0695
The mistake seems to have been introduced a few months ago in a docs tidy up: fc11c94#diff-9562158c05ed3ee744cdc12bad121e87L39
The same mistake seems to exist for all Persistent and Weak across Reference and its subclasses.
This could be part of the confusion in #392.