#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::新建
Buffer::新建 / Buffer::新建OrCopy
ThreadSafeFunction::新建
TypedThreadSafeFunction::新建
Callback candidates:
Function::新建 — 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::新建Buffer::新建/Buffer::新建OrCopyThreadSafeFunction::新建TypedThreadSafeFunction::新建Callback candidates:
Function::新建— the JS callback (Callable)PropertyDescriptor::Accessor—Getter/SetterPropertyDescriptor::Function—CallableThreadSafeFunction::BlockingCall/NonBlockingCall—CallbackTypedThreadSafeFunction::BlockingCall/NonBlockingCall—CallbackTypedThreadSafeFunction— theCallJscallback