change return value from const char pointer to string

Signed-off-by: sunyaozu <sunyaozu@huawei.com>
This commit is contained in:
sunyaozu 2024-05-29 12:07:47 +08:00
parent 06fb6dd45e
commit 60086407c4

View File

@ -103,7 +103,8 @@ std::string VariableConvertor::GetString(napi_env &env, napi_value &value, int32
code = 1;
return "";
}
return buf.data();
std::string result(buf.data());
return result;
}
bool VariableConvertor::GetStringArrayFromJsParam(napi_env env, napi_value &jsArray, const std::string& valueName,