Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference Persistent and Weak shortcuts incorrect in documentation #427

Closed
DuBistKomisch opened this issue Jan 19, 2019 · 3 comments
Closed

Comments

@DuBistKomisch
Copy link
Contributor

DuBistKomisch commented Jan 19, 2019

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.

@mhdawson
Copy link
Member

@DuBistKomisch thanks for the report. Do you want to submit a PR to fix this up?

@DuBistKomisch
Copy link
Contributor Author

@mhdawson sure

@mhdawson
Copy link
Member

mhdawson commented Mar 4, 2019

Closing this issue as a PR to fix has landed (Thanks @DuBistKomisch).

@mhdawson mhdawson closed this as completed Mar 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants