• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include "node.h"
2 
3 namespace {
4 
5 using v8::FunctionCallbackInfo;
6 using v8::Local;
7 using v8::Object;
8 using v8::Value;
9 
GetExecutionAsyncId(const FunctionCallbackInfo<Value> & args)10 void GetExecutionAsyncId(const FunctionCallbackInfo<Value>& args) {
11   args.GetReturnValue().Set(
12     node::AsyncHooksGetExecutionAsyncId(args.GetIsolate()));
13 }
14 
GetTriggerAsyncId(const FunctionCallbackInfo<Value> & args)15 void GetTriggerAsyncId(const FunctionCallbackInfo<Value>& args) {
16   args.GetReturnValue().Set(
17     node::AsyncHooksGetTriggerAsyncId(args.GetIsolate()));
18 }
19 
Initialize(Local<Object> exports)20 void Initialize(Local<Object> exports) {
21   NODE_SET_METHOD(exports, "getExecutionAsyncId", GetExecutionAsyncId);
22   NODE_SET_METHOD(exports, "getTriggerAsyncId", GetTriggerAsyncId);
23 }
24 
25 }  // anonymous namespace
26 
27 NODE_MODULE(NODE_GYP_MODULE_NAME, Initialize)
28