We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 91ce665 commit 83008b7Copy full SHA for 83008b7
bindings/profilers/wall.cc
@@ -1062,8 +1062,13 @@ NAN_METHOD(WallProfiler::Dispose) {
1062
}
1063
1064
double GetAsyncIdNoGC(v8::Isolate* isolate) {
1065
- return isolate->InContext() ? node::AsyncHooksGetExecutionAsyncId(isolate)
1066
- : -1;
+#if NODE_MAJOR_VERSION >= 24
+ HandleScope scope(isolate);
1067
+ auto context = isolate->GetEnteredOrMicrotaskContext();
1068
+ return context.IsEmpty() ? -1 : node::AsyncHooksGetExecutionAsyncId(context);
1069
+#else
1070
+ return node::AsyncHooksGetExecutionAsyncId(isolate);
1071
+#endif
1072
1073
1074
double WallProfiler::GetAsyncId(v8::Isolate* isolate) {
0 commit comments