diff --git a/include/event-emitter.hpp b/include/event-emitter.hpp index d371ce3..44361ac 100644 --- a/include/event-emitter.hpp +++ b/include/event-emitter.hpp @@ -106,7 +106,8 @@ public: Nan::Callback callback(Nan::New(*it)); if ( ! callback.IsEmpty() ) { - callback.Call(argc, argv); + Nan::AsyncResource async("EventEmitter::cpp_emit()"); + callback.Call(argc, argv, &async); } } @@ -128,7 +129,8 @@ public: this->Wrap(emitter); v8::Local argv[] = { emitter, JS_STR(name.c_str()), that, JS_STR(method.c_str()) }; - connectorCb.Call(4, argv); + Nan::AsyncResource async("EventEmitter::cpp_on()"); + connectorCb.Call(4, argv, &async); } @@ -397,7 +399,9 @@ private: v8::Local decor = v8::Local::Cast(v8::Script::Compile(code)->Run()); Nan::Callback decorCb(decor); v8::Local argv[] = { info.This(), info[0], raw }; - v8::Local wrap = v8::Local::Cast(decorCb.Call(3, argv)); + Nan::AsyncResource async("EventEmitter::js_once()"); + v8::Local wrapValue = decorCb.Call(3, argv, &async).ToLocalChecked(); + v8::Local wrap = v8::Local::Cast(wrapValue); Nan::Persistent persistentWrap; persistentWrap.Reset(wrap); diff --git a/package.json b/package.json index 5a3f88d..2c460b2 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,6 @@ "url": "https://github.com/raub/node-addon-tools.git" }, "dependencies": { - "nan": "2.9.2" + "nan": "2.10.0" } }