diff --git a/src/binding.cpp b/src/binding.cpp index 4f2cfdaac..de0a5234a 100644 --- a/src/binding.cpp +++ b/src/binding.cpp @@ -229,6 +229,7 @@ int GetResult(sass_context_wrapper* ctx_w, Sass_Context* ctx, bool is_sync = fal void MakeCallback(uv_work_t* req) { Nan::HandleScope scope; + Nan::AsyncResource async("sass:MakeCallback"); Nan::TryCatch try_catch; sass_context_wrapper* ctx_w = static_cast(req->data); @@ -245,7 +246,7 @@ void MakeCallback(uv_work_t* req) { if (status == 0 && ctx_w->success_callback) { // if no error, do callback(null, result) - ctx_w->success_callback->Call(0, 0); + ctx_w->success_callback->Call(0, 0, &async); } else if (ctx_w->error_callback) { // if error, do callback(error) @@ -253,7 +254,7 @@ void MakeCallback(uv_work_t* req) { v8::Local argv[] = { Nan::New(err).ToLocalChecked() }; - ctx_w->error_callback->Call(1, argv); + ctx_w->error_callback->Call(1, argv, &async); } if (try_catch.HasCaught()) { Nan::FatalException(try_catch); diff --git a/src/callback_bridge.h b/src/callback_bridge.h index 2670fa1dc..68ecaa809 100644 --- a/src/callback_bridge.h +++ b/src/callback_bridge.h @@ -151,6 +151,7 @@ void CallbackBridge::dispatched_async_uv_callback(uv_async_t *req) { * post_process_args(). */ Nan::HandleScope scope; + Nan::AsyncResource async("sass:CallbackBridge"); Nan::TryCatch try_catch; std::vector> argv_v8 = bridge->pre_process_args(bridge->argv); @@ -159,7 +160,7 @@ void CallbackBridge::dispatched_async_uv_callback(uv_async_t *req) { } argv_v8.push_back(Nan::New(bridge->wrapper)); - bridge->callback->Call(argv_v8.size(), &argv_v8[0]); + bridge->callback->Call(argv_v8.size(), &argv_v8[0], &async); if (try_catch.HasCaught()) { Nan::FatalException(try_catch);