From 638a57610b060d77878cde56cc33c8edbd51d23a Mon Sep 17 00:00:00 2001 From: yourspectrum <2725096176@qq.com> Date: Thu, 16 Jun 2022 17:36:29 +0800 Subject: [PATCH] Fix a typo Signed-off-by: yourspectrum <2725096176@qq.com> --- .../js/src/common/napi/n_async/n_async_work_callback.cpp | 4 ++-- .../js/src/common/napi/n_async/n_async_work_promise.cpp | 2 +- interfaces/kits/js/src/common/uni_error.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/interfaces/kits/js/src/common/napi/n_async/n_async_work_callback.cpp b/interfaces/kits/js/src/common/napi/n_async/n_async_work_callback.cpp index 6b6d0b70a..8c3af6149 100644 --- a/interfaces/kits/js/src/common/napi/n_async/n_async_work_callback.cpp +++ b/interfaces/kits/js/src/common/napi/n_async/n_async_work_callback.cpp @@ -69,7 +69,7 @@ static void CallbackComplete(napi_env env, napi_status status, void *data) NVal NAsyncWorkCallback::Schedule(string procedureName, NContextCBExec cbExec, NContextCBComplete cbComplete) { if (!ctx_->cb_ || !ctx_->cb_.Deref(env_).TypeIs(napi_function)) { - UniError(EINVAL).ThrowErr(env_, "The callback shall be a funciton"); + UniError(EINVAL).ThrowErr(env_, "The callback shall be a function"); return NVal(); } @@ -91,7 +91,7 @@ NVal NAsyncWorkCallback::Schedule(string procedureName, NContextCBExec cbExec, N return NVal(); } - ctx_ = nullptr; // The ownership of ctx_ has been transfered + ctx_ = nullptr; // The ownership of ctx_ has been transferred return NVal::CreateUndefined(env_); } } // namespace DistributedFS diff --git a/interfaces/kits/js/src/common/napi/n_async/n_async_work_promise.cpp b/interfaces/kits/js/src/common/napi/n_async/n_async_work_promise.cpp index 3809c1a4b..f0ef6df49 100644 --- a/interfaces/kits/js/src/common/napi/n_async/n_async_work_promise.cpp +++ b/interfaces/kits/js/src/common/napi/n_async/n_async_work_promise.cpp @@ -84,7 +84,7 @@ NVal NAsyncWorkPromise::Schedule(string procedureName, NContextCBExec cbExec, NC return NVal(); } - ctx_ = nullptr; // The ownership of ctx_ has been transfered + ctx_ = nullptr; // The ownership of ctx_ has been transferred return { env_, result }; } } // namespace DistributedFS diff --git a/interfaces/kits/js/src/common/uni_error.cpp b/interfaces/kits/js/src/common/uni_error.cpp index 010aa3dad..ff101f808 100644 --- a/interfaces/kits/js/src/common/uni_error.cpp +++ b/interfaces/kits/js/src/common/uni_error.cpp @@ -97,7 +97,7 @@ void UniError::ThrowErr(napi_env env) string msg = GetDefaultErrstr(); napi_value tmp = nullptr; napi_get_and_clear_last_exception(env, &tmp); - // Note that ace engine cannot thow errors created by napi_create_error so far + // Note that ace engine cannot throw,tow errors created by napi_create_error so far napi_status throwStatus = napi_throw_error(env, nullptr, msg.c_str()); if (throwStatus != napi_ok) { HILOGE("Failed to throw an exception, %{public}d, code = %{public}s", throwStatus, msg.c_str()); @@ -108,11 +108,11 @@ void UniError::ThrowErr(napi_env env, string errMsg) { napi_value tmp = nullptr; napi_get_and_clear_last_exception(env, &tmp); - // Note that ace engine cannot thow errors created by napi_create_error so far + // Note that ace engine cannot throw,tow errors created by napi_create_error so far napi_status throwStatus = napi_throw_error(env, nullptr, errMsg.c_str()); if (throwStatus != napi_ok) { HILOGE("Failed to throw an exception, %{public}d, code = %{public}s", throwStatus, errMsg.c_str()); } } } // namespace DistributedFS -} // namespace OHOS \ No newline at end of file +} // namespace OHOS -- Gitee