MCPcopy Index your code
hub / github.com/nodejs/node-addon-api / Test

Method Test

test/callbackInfo.cc:6–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4
5struct TestCBInfoSetData {
6 static void Test(napi_env env, napi_callback_info info) {
7 Napi::CallbackInfo cbInfo(env, info);
8 int valuePointer = 1220202;
9 cbInfo.SetData(&valuePointer);
10
11 int* placeHolder = static_cast<int*>(cbInfo.Data());
12 assert(*(placeHolder) == valuePointer);
13 assert(placeHolder == &valuePointer);
14 }
15};
16
17void TestCallbackInfoSetData(const Napi::CallbackInfo& info) {

Callers

nothing calls this directly

Calls 2

SetDataMethod · 0.80
DataMethod · 0.80

Tested by

no test coverage detected