Lines Matching refs:ctx
77 aCtx->ctx = std::move(ctxt);
81 if (aCtx->ctx->callbackRef == nullptr) {
95 LOG_DEBUG("AsyncWork napi_async_execute_callback ctxt->status=%{public}d", actx->ctx->status);
96 if (actx->execute && actx->ctx->status == napi_ok) {
104 status, actx->ctx->status);
105 if ((status != napi_ok) && (actx->ctx->status == napi_ok)) {
106 actx->ctx->status = status;
109 if ((actx->complete) && (status == napi_ok) && (actx->ctx->status == napi_ok)) {
124 void NapiQueue::GenerateOutput(AsyncContext &ctx, napi_value output)
127 if (ctx.ctx->status == napi_ok) {
128 napi_get_undefined(ctx.env, &result[RESULT_ERROR]);
130 napi_get_undefined(ctx.env, &output);
135 napi_create_string_utf8(ctx.env, ctx.ctx->error.c_str(), NAPI_AUTO_LENGTH, &message);
136 napi_create_error(ctx.env, nullptr, message, &result[RESULT_ERROR]);
137 napi_get_undefined(ctx.env, &result[RESULT_DATA]);
139 if (ctx.deferred != nullptr) {
140 if (ctx.ctx->status == napi_ok) {
142 napi_resolve_deferred(ctx.env, ctx.deferred, result[RESULT_DATA]);
145 napi_reject_deferred(ctx.env, ctx.deferred, result[RESULT_ERROR]);
149 napi_get_reference_value(ctx.env, ctx.ctx->callbackRef, &callback);
152 napi_call_function(ctx.env, nullptr, callback, RESULT_ALL, result, &callbackResult);