Lines Matching defs:env

23 napi_value TextNapi::Constructor(napi_env env)
34 return NapiDataUtils::DefineClass(env, "Text", properties, count, TextNapi::New);
37 napi_value TextNapi::New(napi_env env, napi_callback_info info)
41 ctxt->GetCbInfoSync(env, info);
42 ASSERT_ERR(ctxt->env, ctxt->status == napi_ok, Status::E_ERROR, ctxt->error);
45 ASSERT_ERR(ctxt->env, text != nullptr, Status::E_ERROR, "no memory for text!");
47 ASSERT_CALL(ctxt->env, napi_wrap(env, ctxt->self, text, Destructor, nullptr, nullptr), text);
51 void TextNapi::NewInstance(napi_env env, std::shared_ptr<UnifiedRecord> in, napi_value &out)
54 ASSERT_CALL_VOID(env, napi_new_instance(env, Constructor(env), 0, nullptr, &out));
56 ASSERT_ERR_VOID(env, text != nullptr, Status::E_ERROR, "no memory for text!");
58 ASSERT_CALL_DELETE(env, napi_wrap(env, out, text, Destructor, nullptr, nullptr), text);
61 void TextNapi::Destructor(napi_env env, void *data, void *hint)
69 TextNapi *TextNapi::GetText(napi_env env, napi_callback_info info, std::shared_ptr<ContextBase> ctxt)
72 ctxt->GetCbInfoSync(env, info);
73 ASSERT_ERR(ctxt->env, ctxt->status == napi_ok, Status::E_ERROR, ctxt->error);
77 napi_value TextNapi::GetDetails(napi_env env, napi_callback_info info)
81 auto text = GetText(env, info, ctxt);
83 ctxt->env, (text != nullptr && text->value_ != nullptr), Status::E_ERROR, "invalid object!");
84 ctxt->status = NapiDataUtils::SetValue(env, text->value_->GetDetails(), ctxt->output);
85 ASSERT_ERR(ctxt->env, ctxt->status == napi_ok, Status::E_ERROR, "set details failed!");
89 napi_value TextNapi::SetDetails(napi_env env, napi_callback_info info)
94 auto input = [env, ctxt, &details](size_t argc, napi_value *argv) {
97 ctxt->status = NapiDataUtils::GetValue(env, argv[0], details);
101 ctxt->GetCbInfoSync(env, info, input);
102 ASSERT_ERR(ctxt->env, ctxt->status == napi_ok, Status::E_ERROR, ctxt->error);
105 ctxt->env, (text != nullptr && text->value_ != nullptr), Status::E_ERROR, "invalid object!");