From 38fe8dc78f36772d8105c2785b532ad81485e8a2 Mon Sep 17 00:00:00 2001 From: pkg Date: Fri, 27 Dec 2024 12:15:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E9=99=A4=E8=93=9D=E5=8C=BA=E5=91=8A?= =?UTF-8?q?=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kits/js/src/mod_fileio/class_dir/dir_n_exporter.cpp | 6 +++--- interfaces/kits/js/src/mod_fileio/properties/copy_file.cpp | 6 +++--- interfaces/kits/js/src/mod_fileio/properties/ftruncate.cpp | 6 +++--- interfaces/kits/js/src/mod_fileio/properties/truncate.cpp | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/interfaces/kits/js/src/mod_fileio/class_dir/dir_n_exporter.cpp b/interfaces/kits/js/src/mod_fileio/class_dir/dir_n_exporter.cpp index ed53fb3ea..c44743680 100644 --- a/interfaces/kits/js/src/mod_fileio/class_dir/dir_n_exporter.cpp +++ b/interfaces/kits/js/src/mod_fileio/class_dir/dir_n_exporter.cpp @@ -196,12 +196,12 @@ napi_value DirNExporter::Read(napi_env env, napi_callback_info info) return DoReadComplete(env, err, arg); }; NVal thisVar(env, funcArg.GetThisVar()); - const string PROCEDURE_NAME = "fileioDirRead"; + const string procedureName = "fileioDirRead"; if (funcArg.GetArgc() == NARG_CNT::ZERO) { - return NAsyncWorkPromise(env, thisVar).Schedule(PROCEDURE_NAME, cbExec, cbCompl).val_; + return NAsyncWorkPromise(env, thisVar).Schedule(procedureName, cbExec, cbCompl).val_; } else { NVal cb(env, funcArg[NARG_POS::FIRST]); - return NAsyncWorkCallback(env, thisVar, cb).Schedule(PROCEDURE_NAME, cbExec, cbCompl).val_; + return NAsyncWorkCallback(env, thisVar, cb).Schedule(procedureName, cbExec, cbCompl).val_; } } diff --git a/interfaces/kits/js/src/mod_fileio/properties/copy_file.cpp b/interfaces/kits/js/src/mod_fileio/properties/copy_file.cpp index b81501a40..13430b6d5 100644 --- a/interfaces/kits/js/src/mod_fileio/properties/copy_file.cpp +++ b/interfaces/kits/js/src/mod_fileio/properties/copy_file.cpp @@ -191,14 +191,14 @@ napi_value CopyFile::Async(napi_env env, napi_callback_info info) return {NVal::CreateUndefined(env)}; }; - const string PROCEDURENAME = "FileIOCopyFile"; + const string procedureName = "FileIOCopyFile"; NVal thisVar(env, funcArg.GetThisVar()); if (funcArg.GetArgc() == NARG_CNT::TWO || (funcArg.GetArgc() == NARG_CNT::THREE && !NVal(env, funcArg[NARG_POS::THIRD]).TypeIs(napi_function))) { - return NAsyncWorkPromise(env, thisVar).Schedule(PROCEDURENAME, cbExec, cbCompl).val_; + return NAsyncWorkPromise(env, thisVar).Schedule(procedureName, cbExec, cbCompl).val_; } else { NVal cb(env, funcArg[((funcArg.GetArgc() == NARG_CNT::THREE) ? NARG_POS::THIRD : NARG_POS::FOURTH)]); - return NAsyncWorkCallback(env, thisVar, cb).Schedule(PROCEDURENAME, cbExec, cbCompl).val_; + return NAsyncWorkCallback(env, thisVar, cb).Schedule(procedureName, cbExec, cbCompl).val_; } } } // namespace ModuleFileIO diff --git a/interfaces/kits/js/src/mod_fileio/properties/ftruncate.cpp b/interfaces/kits/js/src/mod_fileio/properties/ftruncate.cpp index 5052a1b23..ed0fb67fe 100644 --- a/interfaces/kits/js/src/mod_fileio/properties/ftruncate.cpp +++ b/interfaces/kits/js/src/mod_fileio/properties/ftruncate.cpp @@ -101,14 +101,14 @@ napi_value Ftruncate::Async(napi_env env, napi_callback_info info) } }; - const string PROCEDURENAME = "fileIOFtruncate"; + const string procedureName = "fileIOFtruncate"; NVal thisVar(env, funcArg.GetThisVar()); if (funcArg.GetArgc() == NARG_CNT::ONE || (funcArg.GetArgc() == NARG_CNT::TWO && !NVal(env, funcArg[NARG_POS::SECOND]).TypeIs(napi_function))) { - return NAsyncWorkPromise(env, thisVar).Schedule(PROCEDURENAME, cbExec, cbComplete).val_; + return NAsyncWorkPromise(env, thisVar).Schedule(procedureName, cbExec, cbComplete).val_; } else { NVal cb(env, funcArg[((funcArg.GetArgc() == NARG_CNT::TWO) ? NARG_POS::SECOND : NARG_POS::THIRD)]); - return NAsyncWorkCallback(env, thisVar, cb).Schedule(PROCEDURENAME, cbExec, cbComplete).val_; + return NAsyncWorkCallback(env, thisVar, cb).Schedule(procedureName, cbExec, cbComplete).val_; } } } // namespace ModuleFileIO diff --git a/interfaces/kits/js/src/mod_fileio/properties/truncate.cpp b/interfaces/kits/js/src/mod_fileio/properties/truncate.cpp index c2f06f611..14e804ea0 100644 --- a/interfaces/kits/js/src/mod_fileio/properties/truncate.cpp +++ b/interfaces/kits/js/src/mod_fileio/properties/truncate.cpp @@ -97,13 +97,13 @@ napi_value Truncate::Async(napi_env env, napi_callback_info info) }; NVal thisVar(env, funcArg.GetThisVar()); - const string PROCEDURENAME = "FileIOTruncate"; + const string procedureName = "FileIOTruncate"; if (funcArg.GetArgc() == NARG_CNT::ONE || (funcArg.GetArgc() == NARG_CNT::TWO && !NVal(env, funcArg[NARG_POS::SECOND]).TypeIs(napi_function))) { - return NAsyncWorkPromise(env, thisVar).Schedule(PROCEDURENAME, cbExec, cbCompl).val_; + return NAsyncWorkPromise(env, thisVar).Schedule(procedureName, cbExec, cbCompl).val_; } else { NVal cb(env, funcArg[funcArg.GetArgc() - 1]); - return NAsyncWorkCallback(env, thisVar, cb).Schedule(PROCEDURENAME, cbExec, cbCompl).val_; + return NAsyncWorkCallback(env, thisVar, cb).Schedule(procedureName, cbExec, cbCompl).val_; } } } // namespace ModuleFileIO -- Gitee