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

Indexes created Thu Nov 07 10:32:03 CST 2024