| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0257e80 commit 19efe60
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -322,6 +322,13 @@ void AsyncWrap::AsyncReset(const FunctionCallbackInfo<Value>& args) { | |||
| 322 | 322 | wrap->AsyncReset(resource, execution_async_id); | |
| 323 | 323 | } | |
| 324 | 324 | ||
| 325 | + // Useful for debugging async context propagation. Not intended for public use. | ||
| 326 | + void AsyncWrap::GetAsyncContextFrame(const FunctionCallbackInfo<Value>& args) { | ||
| 327 | + AsyncWrap* wrap; | ||
| 328 | + ASSIGN_OR_RETURN_UNWRAP(&wrap, args.This()); | ||
| 329 | + | ||
| 330 | + args.GetReturnValue().Set(wrap->context_frame()); | ||
| 331 | + } | ||
| 325 | 332 | ||
| 326 | 333 | void AsyncWrap::GetProviderType(const FunctionCallbackInfo<Value>& args) { | |
| 327 | 334 | AsyncWrap* wrap; | |
@@ -372,6 +379,10 @@ Local<FunctionTemplate> AsyncWrap::GetConstructorTemplate( | |||
| 372 | 379 | FIXED_ONE_BYTE_STRING(isolate_data->isolate(), "AsyncWrap")); | |
| 373 | 380 | SetProtoMethod(isolate, tmpl, "getAsyncId", AsyncWrap::GetAsyncId); | |
| 374 | 381 | SetProtoMethod(isolate, tmpl, "asyncReset", AsyncWrap::AsyncReset); | |
| 382 | + SetProtoMethod(isolate, | ||
| 383 | + tmpl, | ||
| 384 | + "getAsyncContextFrameForDebuggingOnly", | ||
| 385 | + AsyncWrap::GetAsyncContextFrame); | ||
| 375 | 386 | SetProtoMethod( | |
| 376 | 387 | isolate, tmpl, "getProviderType", AsyncWrap::GetProviderType); | |
| 377 | 388 | isolate_data->set_async_wrap_ctor_template(tmpl); | |
@@ -501,6 +512,7 @@ void AsyncWrap::RegisterExternalReferences( | |||
| 501 | 512 | registry->Register(RegisterDestroyHook); | |
| 502 | 513 | registry->Register(AsyncWrap::GetAsyncId); | |
| 503 | 514 | registry->Register(AsyncWrap::AsyncReset); | |
| 515 | + registry->Register(AsyncWrap::GetAsyncContextFrame); | ||
| 504 | 516 | registry->Register(AsyncWrap::GetProviderType); | |
| 505 | 517 | } | |
| 506 | 518 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -166,6 +166,8 @@ class AsyncWrap : public BaseObject { | |||
| 166 | 166 | static void ClearAsyncIdStack( | |
| 167 | 167 | const v8::FunctionCallbackInfo<v8::Value>& args); | |
| 168 | 168 | static void AsyncReset(const v8::FunctionCallbackInfo<v8::Value>& args); | |
| 169 | + static void GetAsyncContextFrame( | ||
| 170 | + const v8::FunctionCallbackInfo<v8::Value>& args); | ||
| 169 | 171 | static void GetProviderType(const v8::FunctionCallbackInfo<v8::Value>& args); | |
| 170 | 172 | static void QueueDestroyAsyncId( | |
| 171 | 173 | const v8::FunctionCallbackInfo<v8::Value>& args); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments