mirror of
https://github.com/nodejs/node.git
synced 2026-11-30 11:55:44 -05:00
For tests that use anonymous namespaces, some tagged the close of the namespace with 'namespace' while others used 'anonymous namespace'. It was suggested I should use 'anonymous namespace' in a recent PR review so make all of the tests consistent with this. PR-URL: https://github.com/nodejs/node/pull/18583 Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
36 lines
984 B
C++
36 lines
984 B
C++
#include "node.h"
|
|
|
|
namespace {
|
|
|
|
using v8::FunctionCallbackInfo;
|
|
using v8::Local;
|
|
using v8::Object;
|
|
using v8::Value;
|
|
|
|
void GetExecutionAsyncId(const FunctionCallbackInfo<Value>& args) {
|
|
args.GetReturnValue().Set(
|
|
node::AsyncHooksGetExecutionAsyncId(args.GetIsolate()));
|
|
}
|
|
|
|
void GetTriggerAsyncId(const FunctionCallbackInfo<Value>& args) {
|
|
args.GetReturnValue().Set(
|
|
node::AsyncHooksGetTriggerAsyncId(args.GetIsolate()));
|
|
}
|
|
|
|
void EmitAsyncInit(const FunctionCallbackInfo<Value>& args) {
|
|
assert(args[0]->IsObject());
|
|
node::async_uid uid =
|
|
node::EmitAsyncInit(args.GetIsolate(), args[0].As<Object>(), "foobar");
|
|
args.GetReturnValue().Set(uid);
|
|
}
|
|
|
|
void Initialize(Local<Object> exports) {
|
|
NODE_SET_METHOD(exports, "getExecutionAsyncId", GetExecutionAsyncId);
|
|
NODE_SET_METHOD(exports, "getTriggerAsyncId", GetTriggerAsyncId);
|
|
NODE_SET_METHOD(exports, "emitAsyncInit", EmitAsyncInit);
|
|
}
|
|
|
|
} // anonymous namespace
|
|
|
|
NODE_MODULE(NODE_GYP_MODULE_NAME, Initialize)
|