From 616706bb86cf2d28c5e2be426f811c0ea4654d9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cgaoshunli?= <“gaoshunli@huawei.com> Date: Fri, 21 Oct 2022 15:20:06 +0800 Subject: [PATCH] codex clean MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: “gaoshunli" --- interfaces/kits/js/src/mod_fileio/properties/open_v9.cpp | 4 ++-- interfaces/kits/js/src/mod_fileio/properties/open_v9.h | 2 +- interfaces/kits/js/src/mod_fileio/properties/stat_v9.cpp | 4 ++-- interfaces/kits/js/src/mod_fileio/properties/stat_v9.h | 2 +- interfaces/kits/js/src/mod_fileio/properties/truncate_v9.cpp | 5 ++--- interfaces/kits/js/src/mod_fileio/properties/truncate_v9.h | 2 +- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/interfaces/kits/js/src/mod_fileio/properties/open_v9.cpp b/interfaces/kits/js/src/mod_fileio/properties/open_v9.cpp index 208a938e0..a8a1542f4 100644 --- a/interfaces/kits/js/src/mod_fileio/properties/open_v9.cpp +++ b/interfaces/kits/js/src/mod_fileio/properties/open_v9.cpp @@ -146,11 +146,11 @@ napi_value OpenV9::Async(napi_env env, napi_callback_info info) NVal thisVar(env, funcArg.GetThisVar()); if (funcArg.GetArgc() == NARG_CNT::ONE || (funcArg.GetArgc() == NARG_CNT::TWO && NVal(env, funcArg[NARG_POS::SECOND]).TypeIs(napi_number))) { - return NAsyncWorkPromise(env, thisVar).Schedule(openV9ProcedureName, cbExec, cbCompl).val_; + return NAsyncWorkPromise(env, thisVar).Schedule(PROCEDURE_OPEN_NAME, cbExec, cbCompl).val_; } else { int cbIdx = ((funcArg.GetArgc() == NARG_CNT::THREE) ? NARG_POS::THIRD : NARG_POS::SECOND); NVal cb(env, funcArg[cbIdx]); - return NAsyncWorkCallback(env, thisVar, cb).Schedule(openV9ProcedureName, cbExec, cbCompl).val_; + return NAsyncWorkCallback(env, thisVar, cb).Schedule(PROCEDURE_OPEN_NAME, cbExec, cbCompl).val_; } } } // namespace ModuleFileIO diff --git a/interfaces/kits/js/src/mod_fileio/properties/open_v9.h b/interfaces/kits/js/src/mod_fileio/properties/open_v9.h index 5bb57a661..93fbfd3e0 100644 --- a/interfaces/kits/js/src/mod_fileio/properties/open_v9.h +++ b/interfaces/kits/js/src/mod_fileio/properties/open_v9.h @@ -26,7 +26,7 @@ public: static napi_value Async(napi_env env, napi_callback_info info); static napi_value Sync(napi_env env, napi_callback_info info); }; -const std::string openV9ProcedureName = "FILEIO_OPEN_V9"; +const std::string PROCEDURE_OPEN_NAME = "FileIOOpenV9"; } // namespace ModuleFileIO } // namespace DistributedFS } // namespace OHOS diff --git a/interfaces/kits/js/src/mod_fileio/properties/stat_v9.cpp b/interfaces/kits/js/src/mod_fileio/properties/stat_v9.cpp index e777f821c..86322baa7 100644 --- a/interfaces/kits/js/src/mod_fileio/properties/stat_v9.cpp +++ b/interfaces/kits/js/src/mod_fileio/properties/stat_v9.cpp @@ -142,10 +142,10 @@ napi_value StatV9::Async(napi_env env, napi_callback_info info) }; NVal thisVar(env, funcArg.GetThisVar()); if (funcArg.GetArgc() == NARG_CNT::ONE) { - return NAsyncWorkPromise(env, thisVar).Schedule(procedureStatName, cbExec, cbCompl).val_; + return NAsyncWorkPromise(env, thisVar).Schedule(PROCEDURE_STAT_NAME, cbExec, cbCompl).val_; } else { NVal cb(env, funcArg[NARG_POS::SECOND]); - return NAsyncWorkCallback(env, thisVar, cb).Schedule(procedureStatName, cbExec, cbCompl).val_; + return NAsyncWorkCallback(env, thisVar, cb).Schedule(PROCEDURE_STAT_NAME, cbExec, cbCompl).val_; } } } // namespace ModuleFileIO diff --git a/interfaces/kits/js/src/mod_fileio/properties/stat_v9.h b/interfaces/kits/js/src/mod_fileio/properties/stat_v9.h index 08eed2e5a..ecdd703cd 100644 --- a/interfaces/kits/js/src/mod_fileio/properties/stat_v9.h +++ b/interfaces/kits/js/src/mod_fileio/properties/stat_v9.h @@ -26,7 +26,7 @@ public: static napi_value Async(napi_env env, napi_callback_info info); static napi_value Sync(napi_env env, napi_callback_info info); }; -const std::string procedureStatName = "FILEIO_STAT_V9"; +const std::string PROCEDURE_STAT_NAME = "FileIOStatV9"; } // namespace ModuleFileIO } // namespace DistributedFS } // namespace OHOS diff --git a/interfaces/kits/js/src/mod_fileio/properties/truncate_v9.cpp b/interfaces/kits/js/src/mod_fileio/properties/truncate_v9.cpp index e76741757..fd7777b63 100644 --- a/interfaces/kits/js/src/mod_fileio/properties/truncate_v9.cpp +++ b/interfaces/kits/js/src/mod_fileio/properties/truncate_v9.cpp @@ -122,14 +122,13 @@ napi_value TruncateV9::Async(napi_env env, napi_callback_info info) return NVal::CreateUndefined(env); } }; - NVal thisVar(env, funcArg.GetThisVar()); if (funcArg.GetArgc() == NARG_CNT::ONE || (funcArg.GetArgc() == NARG_CNT::TWO && NVal(env, funcArg[NARG_POS::SECOND]).TypeIs(napi_number))) { - return NAsyncWorkPromise(env, thisVar).Schedule(procedureTruncateName, cbExec, cbCompl).val_; + return NAsyncWorkPromise(env, thisVar).Schedule(PROCEDURE_TRUNCATE_NAME, cbExec, cbCompl).val_; } else { NVal cb(env, funcArg[NARG_POS::THIRD]); - return NAsyncWorkCallback(env, thisVar, cb).Schedule(procedureTruncateName, cbExec, cbCompl).val_; + return NAsyncWorkCallback(env, thisVar, cb).Schedule(PROCEDURE_TRUNCATE_NAME, cbExec, cbCompl).val_; } } } // namespace ModuleFileIO diff --git a/interfaces/kits/js/src/mod_fileio/properties/truncate_v9.h b/interfaces/kits/js/src/mod_fileio/properties/truncate_v9.h index 37217db45..2defe6b2d 100644 --- a/interfaces/kits/js/src/mod_fileio/properties/truncate_v9.h +++ b/interfaces/kits/js/src/mod_fileio/properties/truncate_v9.h @@ -29,7 +29,7 @@ public: static napi_value Sync(napi_env env, napi_callback_info info); static napi_value Async(napi_env env, napi_callback_info info); }; -const std::string procedureTruncateName = "FILEIO_TRUNCATE_V9"; +const std::string PROCEDURE_TRUNCATE_NAME = "FileIOTruncateV9"; } // namespace ModuleFileIO } // namespace DistributedFS } // namespace OHOS -- Gitee