Commit 4ed4739d by Marcin Cieslak

Add explicit Local<> scope for wrapper construction

parent 8420fd9d
...@@ -59,6 +59,7 @@ CallbackBridge<T, L>::CallbackBridge(Nan::Callback* callback, bool is_sync) : ca ...@@ -59,6 +59,7 @@ CallbackBridge<T, L>::CallbackBridge(Nan::Callback* callback, bool is_sync) : ca
* This is invoked from the main JavaScript thread. * This is invoked from the main JavaScript thread.
* V8 context is available. * V8 context is available.
*/ */
Nan::HandleScope scope;
if (!is_sync) { if (!is_sync) {
this->async = new uv_async_t; this->async = new uv_async_t;
this->async->data = (void*) this; this->async->data = (void*) this;
...@@ -180,6 +181,7 @@ NAN_METHOD(CallbackBridge<T COMMA L>::ReturnCallback) { ...@@ -180,6 +181,7 @@ NAN_METHOD(CallbackBridge<T COMMA L>::ReturnCallback) {
template <typename T, typename L> template <typename T, typename L>
Nan::MaybeLocal<v8::Function> CallbackBridge<T, L>::get_wrapper_constructor() { Nan::MaybeLocal<v8::Function> CallbackBridge<T, L>::get_wrapper_constructor() {
/* Uses handle scope created in the CallbackBridge<T, L> constructor */
if (wrapper_constructor.IsEmpty()) { if (wrapper_constructor.IsEmpty()) {
v8::Local<v8::FunctionTemplate> tpl = Nan::New<v8::FunctionTemplate>(New); v8::Local<v8::FunctionTemplate> tpl = Nan::New<v8::FunctionTemplate>(New);
tpl->SetClassName(Nan::New("CallbackBridge").ToLocalChecked()); tpl->SetClassName(Nan::New("CallbackBridge").ToLocalChecked());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment