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

Function CreateExternalWithFinalizeException

test/external.cc:57–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57Value CreateExternalWithFinalizeException(const CallbackInfo& info) {
58 return External<int>::New(info.Env(), new int(1), [](Env env, int* data) {
59 Error error = Error::New(env, "Finalizer exception");
60 delete data;
61#ifdef NAPI_CPP_EXCEPTIONS
62 throw error;
63#else
64 error.ThrowAsJavaScriptException();
65#endif
66 });
67}
68
69} // end anonymous namespace
70

Callers

nothing calls this directly

Calls 2

EnvMethod · 0.80

Tested by

no test coverage detected