MCPcopy Create free account
hub / github.com/nodejs/node-addon-api / Test

Class Test

test/objectwrap_removewrap.cc:20–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20class Test : public Napi::ObjectWrap<Test> {
21 public:
22 Test(const Napi::CallbackInfo& info) : Napi::ObjectWrap<Test>(info) {
23#ifdef NAPI_CPP_EXCEPTIONS
24 throw Napi::Error::New(Env(), "Some error");
25#else
26 Napi::Error::New(Env(), "Some error").ThrowAsJavaScriptException();
27#endif
28 }
29
30 static void Initialize(Napi::Env env, Napi::Object exports) {
31 exports.Set("Test", DefineClass(env, "Test", {}));
32 exports.Set("getDtorCalled", Napi::Function::New(env, GetDtorCalled));
33 }
34
35 private:
36 DtorCounter dtor_counter_;
37};
38
39} // anonymous namespace
40

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected