Skip to content

Reference Persistent and Weak shortcuts incorrect in documentation #427

@DuBistKomisch

Description

@DuBistKomisch

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions