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

Method DoWork

test/async_worker.cc:153–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151class TestWorkerNoCallback : public AsyncWorker {
152 public:
153 static Value DoWork(const CallbackInfo& info) {
154 bool succeed = info[0].As<Boolean>();
155
156 TestWorkerNoCallback* worker = new TestWorkerNoCallback(info.Env());
157 worker->_succeed = succeed;
158 worker->Queue();
159 return worker->_deferred.Promise();
160 }
161
162 static Value DoWorkWithAsyncRes(const CallbackInfo& info) {
163 napi_env env = info.Env();

Callers

nothing calls this directly

Calls 3

EnvMethod · 0.80
QueueMethod · 0.80
PromiseMethod · 0.80

Tested by

no test coverage detected