!56 fix new constructor for API8

Merge pull request !56 from 王国强/0223
This commit is contained in:
openharmony_ci
2022-02-24 06:11:30 +00:00
committed by Gitee
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -213,6 +213,12 @@ void Init(napi_env env, napi_value exports)
status = napi_define_properties(env, exports, sizeof(exportFuncs) / sizeof(*exportFuncs), exportFuncs);
if (status != napi_ok) {
USERAUTH_HILOGE(MODULE_JS_NAPI, "napi_define_properties faild");
return;
}
status = napi_set_named_property(env, exports, "UserAuth", GetCtor(env));
if (status != napi_ok) {
USERAUTH_HILOGE(MODULE_JS_NAPI, "napi_set_named_property faild");
}
}
+6
View File
@@ -55,6 +55,12 @@ void Init(napi_env env, napi_value exports)
status = napi_define_properties(env, exports, sizeof(exportFuncs) / sizeof(*exportFuncs), exportFuncs);
if (status != napi_ok) {
USERAUTH_HILOGE(MODULE_JS_NAPI, "napi_define_properties faild");
return;
}
status = napi_set_named_property(env, exports, "UserAuthNorth", GetCtor(env));
if (status != napi_ok) {
USERAUTH_HILOGE(MODULE_JS_NAPI, "napi_set_named_property faild");
}
}