#1738 documented the required signature of the templated finalizer callback parameters as inline comment hints.
These are human-only annotations. The compiler does not enforce them, so a mismatched callable fails deep inside the template instantiation with an unhelpful error.
Once C++20 is the minimum supported standard, we should replace these hints with C++ Concepts that constrain the Finalizer/FinalizerType template parameters. This gives compiler-enforced contracts and clear diagnostics at the call site.
Finalizer candidates:
BasicEnv::PostFinalizer
Object::AddFinalizer
External::New
Buffer::New / Buffer::NewOrCopy
ThreadSafeFunction::New
TypedThreadSafeFunction::New
Callback candidates:
Function::New — the JS callback (Callable)
PropertyDescriptor::Accessor — Getter / Setter
PropertyDescriptor::Function — Callable
ThreadSafeFunction::BlockingCall / NonBlockingCall — Callback
TypedThreadSafeFunction::BlockingCall / NonBlockingCall — Callback
TypedThreadSafeFunction — the CallJs callback
#1738 documented the required signature of the templated finalizer callback parameters as inline comment hints.
These are human-only annotations. The compiler does not enforce them, so a mismatched callable fails deep inside the template instantiation with an unhelpful error.
Once C++20 is the minimum supported standard, we should replace these hints with C++ Concepts that constrain the
Finalizer/FinalizerTypetemplate parameters. This gives compiler-enforced contracts and clear diagnostics at the call site.Finalizer candidates:
BasicEnv::PostFinalizerObject::AddFinalizerExternal::NewBuffer::New/Buffer::NewOrCopyThreadSafeFunction::NewTypedThreadSafeFunction::NewCallback candidates:
Function::New— the JS callback (Callable)PropertyDescriptor::Accessor—Getter/SetterPropertyDescriptor::Function—CallableThreadSafeFunction::BlockingCall/NonBlockingCall—CallbackTypedThreadSafeFunction::BlockingCall/NonBlockingCall—CallbackTypedThreadSafeFunction— theCallJscallback