|
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.
node-addon-examples/function-reference-demo/node-addon-api/src/native-addon.cc
Line 4 in c1bdff0
node-addon-examples/inherits_from_event_emitter/node-addon-api/src/native-emitter.cc
Line 7 in c1bdff0
It's not referred anywhere other than the
Initfunction and having an "immortal"Napi::FunctionReferenceseems 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.