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 6b6d0b70a6fd54e7c9193d4867600aae41e70759..8c3af6149c68a3270987cb6e9c7c15710bcc1d2a 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 3809c1a4b0255236ceb8dadfb3d05c77b67366d9..f0ef6df4985a4e6b7b6618d3c917179c66625f7d 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 010aa3dad835557c4d19f4631e9a9ba0d5f7e28c..ff101f808623148022382f1cd3dda8f8510129f8 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