You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to store V8 callbacks as weak references, with the finalizer callback so I can remove the reference when appropriate.
I've worked out how to do this with v8::Function, but I was hoping to keep the Nan::Callback wrapper intact in case of future API changes. Unfortunately the documentation is quite bare.
Is there a way to do this?
The text was updated successfully, but these errors were encountered:
Nan::Persistent<v8::Function>::SetWeak() coupled with Nan::Call() to actually invoke the function should do it.
Nan::Callback could in theory be extended to offer that functionality (internally it already uses a Nan::Persistent<v8::Function>) but I don't know, that's probably too esoteric and uncommon. A Nan::Callback is usually embedded in some other weak object.
Hey.
I need to store V8 callbacks as weak references, with the finalizer callback so I can remove the reference when appropriate.
I've worked out how to do this with v8::Function, but I was hoping to keep the Nan::Callback wrapper intact in case of future API changes. Unfortunately the documentation is quite bare.
Is there a way to do this?
The text was updated successfully, but these errors were encountered: