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 55ac3fa commit bfa2637Copy full SHA for bfa2637
bindings/profilers/wall.cc
@@ -1021,8 +1021,13 @@ NAN_METHOD(WallProfiler::Dispose) {
1021
}
1022
1023
double GetAsyncIdNoGC(v8::Isolate* isolate) {
1024
- return isolate->InContext() ? node::AsyncHooksGetExecutionAsyncId(isolate)
1025
- : -1;
+#if NODE_MAJOR_VERSION >= 24
+ HandleScope scope(isolate);
1026
+ auto context = isolate->GetEnteredOrMicrotaskContext();
1027
+ return context.IsEmpty() ? -1 : node::AsyncHooksGetExecutionAsyncId(context);
1028
+#else
1029
+ return node::AsyncHooksGetExecutionAsyncId(isolate);
1030
+#endif
1031
1032
1033
double WallProfiler::GetAsyncId(v8::Isolate* isolate) {
0 commit comments