Skip to content

Why do these two examples need a static FunctionReference? #169

Description

@seishun

Napi::FunctionReference NativeAddon::constructor;

Napi::FunctionReference NativeEmitter::constructor;

It's not referred anywhere other than the Init function and having an "immortal" Napi::FunctionReference seems unnecessary since the constructor isn't invoked from native code.

Curiously, these two examples were untouched by dc86a66, which replaced the usage of a static FunctionReference with instance data in examples that do need to keep the constructor alive.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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